Improve report creation

dev
Aurelien Hubert 7 years ago
parent 156ff4ce98
commit f70133a00e
  1. 7
      app/src/main/java/net/pokeranalytics/android/ui/adapter/RowRepresentableAdapter.kt
  2. 4
      app/src/main/java/net/pokeranalytics/android/ui/fragment/ReportCreationFragment.kt
  3. 1
      app/src/main/java/net/pokeranalytics/android/ui/fragment/data/EditableDataFragment.kt

@ -55,13 +55,12 @@ class RowRepresentableAdapter(
return
}
/*
val index = this.dataSource.indexForRow(row)
val index = this.dataSource.adapterRows()?.indexOf(row) ?: -1
if (index >= 0) {
notifyItemChanged(index)
}
*/
notifyDataSetChanged()
//notifyDataSetChanged()
}
/**

@ -82,6 +82,7 @@ class ReportCreationFragment : RealmFragment(), RowRepresentableDataSource, RowR
setDisplayHomeAsUpEnabled(true)
this.optionsAdapter = RowRepresentableAdapter(this, this)
this.optionsAdapter.setHasStableIds(true)
val viewManager = LinearLayoutManager(requireContext())
recyclerView.apply {
@ -179,7 +180,7 @@ class ReportCreationFragment : RealmFragment(), RowRepresentableDataSource, RowR
this.updateUIWithCurrentStep()
} else {
this.next.isEnabled = this.assistant.nextEnabled
this.optionsAdapter.refreshRow(row)
this.optionsAdapter.notifyDataSetChanged()
}
}
@ -256,6 +257,7 @@ class Assistant {
return when (this.step) {
Step.STAT -> this.stats.contains(row as Stat)
Step.COMPARATOR -> this.comparators.contains(row as Criteria)
Step.FILTER -> this.filter == row
else -> false
}
}

@ -89,6 +89,7 @@ open class EditableDataFragment : DataManagerFragment(), RowRepresentableDelegat
val dataSource = getDataSource()
this.rowRepresentableAdapter = RowRepresentableAdapter(getDataSource(), this)
this.rowRepresentableAdapter.setHasStableIds(true)
this.recyclerView.adapter = rowRepresentableAdapter
// When creating an object, open automatically the keyboard for the first row

Loading…
Cancel
Save