Filter: fix issue with place holder

csv
Razmig Sarkissian 7 years ago
parent 2210016627
commit fbaf8c869e
  1. 4
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/bottomsheet/BottomSheetDoubleEditTextFragment.kt
  2. 7
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/FilterElementRow.kt

@ -71,8 +71,8 @@ class BottomSheetDoubleEditTextFragment : BottomSheetFragment() {
editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES editText2.inputType = data[1].inputType ?: InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
if (valueHasPlaceholder) { if (valueHasPlaceholder) {
editText1.hint = values[0] if (values[0].isNotBlank()) { editText1.hint = values[0] }
editText2.hint = values[1] if (values[1].isNotBlank()) { editText2.hint = values[1] }
} else { } else {
editText1.setText(values[0]) editText1.setText(values[0])
editText2.setText(values[1]) editText2.setText(values[1])

@ -22,8 +22,13 @@ interface FilterElementRow : RowRepresentable {
} }
is QueryCondition.ListOfValues<*> -> { is QueryCondition.ListOfValues<*> -> {
val valueAsString: String? by map val valueAsString: String? by map
val hint = when (this.operator) {
QueryCondition.Operator.MORE, QueryCondition.Operator.LESS -> this.filterSectionRow.resId
else -> this.resId
}
arrayListOf( arrayListOf(
RowRepresentableEditDescriptor(valueAsString, this.resId, inputType = InputType.TYPE_CLASS_NUMBER) RowRepresentableEditDescriptor(valueAsString, hint, inputType = InputType.TYPE_CLASS_NUMBER)
) )
} }
else -> super.editingDescriptors(map) else -> super.editingDescriptors(map)

Loading…
Cancel
Save