1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-23 11:56:09 -06:00

Fix no expandable grades (#184)

This commit is contained in:
Rafał Borcz 2018-11-15 17:33:12 +01:00 committed by Mikołaj Pich
parent 9f04dbf60f
commit c2b8f85ad9
3 changed files with 14 additions and 8 deletions

View File

@ -81,11 +81,12 @@ class GradeDetailsFragment : BaseFragment(), GradeDetailsView, GradeView.GradeCh
gradeDetailsAdapter.clear()
}
override fun resetView() {
gradeDetailsAdapter.apply {
smoothScrollToPosition(0)
collapseAll()
}
override fun collapseAllItems() {
gradeDetailsAdapter.collapseAll()
}
override fun scrollToStart() {
gradeDetailsAdapter.smoothScrollToPosition(0)
}
override fun getHeaderOfItem(item: AbstractFlexibleItem<*>): IExpandable<*, out IFlexible<*>>? {

View File

@ -80,7 +80,10 @@ class GradeDetailsPresenter @Inject constructor(
fun onParentViewReselected() {
view?.run {
if (!isViewEmpty) resetView()
if (!isViewEmpty) {
if (preferencesRepository.isGradeExpandable) collapseAllItems()
scrollToStart()
}
}
}

View File

@ -22,10 +22,12 @@ interface GradeDetailsView : BaseView {
fun updateItem(item: AbstractFlexibleItem<*>)
fun resetView()
fun clearView()
fun scrollToStart()
fun collapseAllItems()
fun showGradeDialog(grade: Grade)
fun showContent(show: Boolean)