Anki-Android
Anki-Android copied to clipboard
refactor(DeckPicker): simplify type inference and null handling
Purpose / Description
Refactoring DeckPickerViewModel.kt to remove redundant types and use idiomatic Kotlin null-safety.
Fixes
- Part of #13282
Approach
- Type Inference: Removed
<OpChanges>fromundoableOp(compiler infers this automatically). - Null Safety: Replaced
if (auth == null)with the Elvis operator?:for cleaner null safety checks.
How Has This Been Tested?
- Built the project successfully in Android Studio (Otter).
- Verified that Android Studio no longer shows warnings for these lines.
Learning (optional, can help others)
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [ ] You have commented your code, particularly in hard-to-understand areas
- [x] You have performed a self-review of your own code
- [ ] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
Built the project successfully in Android Studio (Otter). Verified that Android Studio no longer shows warnings for these lines.
Did you test the functionality still works? opChanges has cases where this would cause a crash