Fixing bug #1153 Tasks: Keyboard goes away immediately when trying to adjust a streak (#1158)

* Fixing bug #1153 Tasks: Keyboard goes away immediately when trying to adjust a streak

Turned off keyboard hiding after scroll for Positive and Negative streak edittext fields.

* Fixing issue with saving positive and negative streak for Habits

Issue described here https://github.com/HabitRPG/habitica-android/issues/1153#issuecomment-493798106
This commit is contained in:
Remigiusz Samborski 2019-05-31 09:38:51 +02:00 committed by Phillip Thelen
parent 39587802df
commit a6cb52fc40
2 changed files with 5 additions and 1 deletions

View file

@ -272,6 +272,8 @@ open class Task : RealmObject, Parcelable {
dest.writeLong(this.dueDate?.time ?: -1)
dest.writeString(this.specialTag)
dest.writeString(this.id)
dest.writeInt(this.counterUp ?: 0)
dest.writeInt(this.counterDown ?: 0)
}
constructor()
@ -306,6 +308,8 @@ open class Task : RealmObject, Parcelable {
this.dueDate = if (tmpDuedate == -1L) null else Date(tmpDuedate)
this.specialTag = `in`.readString()
this.id = `in`.readString()
this.counterUp = `in`.readInt()
this.counterDown = `in`.readInt()
}

View file

@ -423,7 +423,7 @@ class TaskFormActivity : BaseActivity() {
private fun dismissKeyboard() {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
val currentFocus = currentFocus
if (currentFocus != null) {
if (currentFocus != null && !habitAdjustPositiveStreakView.isFocused && !habitAdjustNegativeStreakView.isFocused) {
imm?.hideSoftInputFromWindow(currentFocus.windowToken, 0)
}
}