From b18cd322e0bf46f35b7af29f5741d5570b226c2e Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 29 Apr 2020 22:15:02 +0200 Subject: [PATCH] Hopefully fixed now that AllAccount menu item's selection state didn't get updated properly --- .../banking/fints4java/android/ui/views/DrawerView.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt index 90eef09d..26ac12c5 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/ui/views/DrawerView.kt @@ -14,6 +14,7 @@ import com.mikepenz.materialdrawer.model.SectionDrawerItem import com.mikepenz.materialdrawer.model.interfaces.* import com.mikepenz.materialdrawer.util.addItems import com.mikepenz.materialdrawer.util.addItemsAtPosition +import com.mikepenz.materialdrawer.util.getDrawerItem import com.mikepenz.materialdrawer.util.removeItemByPosition import com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView import net.dankito.banking.fints4java.android.R @@ -106,6 +107,11 @@ open class DrawerView( val accountItems = createAccountsDrawerItems() slider.addItemsAtPosition(CountDefaultAccountItems, *accountItems.toTypedArray()) + + slider.getDrawerItem(AllAccountsId)?.let { allAccountsItem -> + if (presenter.areAllAccountSelected) slider.selectExtension.select(allAccountsItem, false) + else slider.selectExtension.deselectByItems(setOf(allAccountsItem)) + } } private fun createAccountsDrawerItems(): List> {