mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 02:01:56 +00:00
Fix task form issues
This commit is contained in:
parent
6640e570b5
commit
b94549684d
3 changed files with 5 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import io.reactivex.Maybe
|
|||
import io.realm.Realm
|
||||
import io.realm.RealmObject
|
||||
import io.realm.RealmResults
|
||||
import io.realm.Sort
|
||||
|
||||
class RealmTaskLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm), TaskLocalRepository {
|
||||
|
||||
|
|
@ -14,7 +15,7 @@ class RealmTaskLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm),
|
|||
return realm.where(Task::class.java)
|
||||
.equalTo("type", taskType)
|
||||
.equalTo("userId", userID)
|
||||
.sort("position")
|
||||
.sort("position", Sort.ASCENDING, "dateCreated", Sort.DESCENDING)
|
||||
.findAll()
|
||||
.asFlowable()
|
||||
.filter { it.isLoaded }
|
||||
|
|
@ -23,7 +24,7 @@ class RealmTaskLocalRepository(realm: Realm) : RealmBaseLocalRepository(realm),
|
|||
|
||||
override fun getTasks(userId: String): Flowable<RealmResults<Task>> {
|
||||
return realm.where(Task::class.java).equalTo("userId", userId)
|
||||
.sort("position")
|
||||
.sort("position", Sort.ASCENDING, "dateCreated", Sort.DESCENDING)
|
||||
.findAll()
|
||||
.asFlowable()
|
||||
.filter { it.isLoaded }
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@ class TaskFormActivity : BaseActivity() {
|
|||
if (thisTask == null) {
|
||||
thisTask = Task()
|
||||
thisTask.type = taskType
|
||||
thisTask.dateCreated = Date()
|
||||
}
|
||||
thisTask.text = textEditText.text.toString()
|
||||
thisTask.notes = notesEditText.text.toString()
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class TaskSchedulingControls @JvmOverloads constructor(
|
|||
configureViewsForFrequency()
|
||||
}
|
||||
var everyX
|
||||
get() = (repeatsEveryEdittext.text ?: "1").toString().toInt()
|
||||
get() = (repeatsEveryEdittext.text ?: "1").toString().toIntOrNull() ?: 1
|
||||
set(value) {
|
||||
try {
|
||||
repeatsEveryEdittext.setText(value.toString())
|
||||
|
|
|
|||
Loading…
Reference in a new issue