fix(bottom-nav-bar): enforce scoping of the nav bar to mobile only - #22234
Conversation
david-allison
left a comment
There was a problem hiding this comment.
Knowing whether the table is being used is tricky.
Consider scoping your checks to DeckPicker via a context receiver/parameter, so you can just check if the fragment is visible
875d022 to
98857b2
Compare
a93671c to
f999adf
Compare
|
Snapshot diff report: Previous regressions were resolved by the latest commit. |
sanjaysargam
left a comment
There was a problem hiding this comment.
Enforced the dev preference so that it is always false
This line looks incorrect can be misread, cuz the pref is actually hidden and gated
Rest looks good to me. Tested on Pixel 10 Pro Fold
There was a problem hiding this comment.
LGTM, one nit:
Subject: [PATCH] fix(preferences): hide bottom nav if unavailable
---
Index: AnkiDroid/src/main/java/com/ichi2/anki/preferences/HeaderFragment.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/HeaderFragment.kt b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/HeaderFragment.kt
--- a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/HeaderFragment.kt (revision f999adfb8878bf72f706782a5f98d01611b6d625)
+++ b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/HeaderFragment.kt (revision e02eda0887a518032b29a6155978e09d663d3b6b)
@@ -195,6 +195,9 @@
if (BuildConfig.DEBUG) {
searchConfiguration.ignorePreference(activity.getString(R.string.developer_options_enabled_by_user_key))
}
+ if (!activity.resources.getBoolean(R.bool.bottom_navigation_available)) {
+ searchConfiguration.ignorePreference(activity.getString(R.string.dev_bottom_nav_key))
+ }
}
// From [HeaderFragment.onCreatePreferences]
Edited! |
Assisted-by: GPT-6
f999adf to
cf71db1
Compare
Purpose / Description
Scopes the bottom navigation bar to mobile, earlier there was bleeding to tablet still.
Fixes
Approach
Enforced the dev preference so that it does not show for tablets, made sure the switch is hidden on tablets and finally made sure hierarchy lines only work for bottom nav bar enabled devices.
How Has This Been Tested?
Checklist
Please, go through these checks before submitting the PR.