Hopefully fixed now that AllAccount menu item's selection state didn't get updated properly

This commit is contained in:
dankito 2020-04-29 22:15:02 +02:00
parent 479f4ec47e
commit b18cd322e0
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import com.mikepenz.materialdrawer.model.SectionDrawerItem
import com.mikepenz.materialdrawer.model.interfaces.* import com.mikepenz.materialdrawer.model.interfaces.*
import com.mikepenz.materialdrawer.util.addItems import com.mikepenz.materialdrawer.util.addItems
import com.mikepenz.materialdrawer.util.addItemsAtPosition import com.mikepenz.materialdrawer.util.addItemsAtPosition
import com.mikepenz.materialdrawer.util.getDrawerItem
import com.mikepenz.materialdrawer.util.removeItemByPosition import com.mikepenz.materialdrawer.util.removeItemByPosition
import com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView import com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView
import net.dankito.banking.fints4java.android.R import net.dankito.banking.fints4java.android.R
@ -106,6 +107,11 @@ open class DrawerView(
val accountItems = createAccountsDrawerItems() val accountItems = createAccountsDrawerItems()
slider.addItemsAtPosition(CountDefaultAccountItems, *accountItems.toTypedArray()) 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<IDrawerItem<*>> { private fun createAccountsDrawerItems(): List<IDrawerItem<*>> {