chore: convert DeckPicker to ViewBinding#19420
Merged
BrayanDSO merged 2 commits intoankidroid:mainfrom Nov 6, 2025
Merged
Conversation
'0' is acceptable to use as 'no layout' Improves support for View Bindings * `activityName` was unused Issue 11116
We do not use `by viewBinding` here due to how 'NavigationDrawerActivity'
updates the view hierarchy
```
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ichi2.anki.debug/com.ichi2.anki.DeckPicker}: java.lang.ClassCastException: androidx.drawerlayout.widget.ClosableDrawerLayout cannot be cast to androidx.coordinatorlayout.widget.CoordinatorLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)
...
Caused by: java.lang.ClassCastException: androidx.drawerlayout.widget.ClosableDrawerLayout cannot be cast to androidx.coordinatorlayout.widget.CoordinatorLayout
at com.ichi2.anki.databinding.HomescreenBinding.bind(HomescreenBinding.java:130)
at com.ichi2.anki.DeckPicker$special$$inlined$viewBindingActivityWithCallbacks$default$1.invoke(ActivityViewBindings.kt:162)
at com.ichi2.anki.DeckPicker$special$$inlined$viewBindingActivityWithCallbacks$default$1.invoke(ActivityViewBindings.kt:141)
at dev.androidbroadcast.vbpd.LazyViewBindingProperty.getValue(ViewBindingProperty.kt:78)
at dev.androidbroadcast.vbpd.ActivityViewBindingProperty.getValue(ActivityViewBindings.kt:62)
at dev.androidbroadcast.vbpd.ActivityViewBindingProperty.getValue(ActivityViewBindings.kt:50)
at com.ichi2.anki.DeckPicker.getBinding(DeckPicker.kt:254)
at com.ichi2.anki.DeckPicker.onCreate(DeckPicker.kt:534)
...
```
Issue 11116
lukstbit
approved these changes
Nov 4, 2025
Member
lukstbit
left a comment
There was a problem hiding this comment.
A bit complicated with all the bindings but looks good.
BrayanDSO
approved these changes
Nov 5, 2025
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approach
by viewBindingsyntaxAnkiActivity- this was useful anywayHow Has This Been Tested?
Brief test using
Checklist