Skip to content

fix(bottom-nav-bar): enforce scoping of the nav bar to mobile only - #22234

Merged
david-allison merged 1 commit into
ankidroid:mainfrom
ShaanNarendran:fix/scope-bottom-nav-to-phones
Oct 4, 2026
Merged

david-allison merged 1 commit into
ankidroid:mainfrom
ShaanNarendran:fix/scope-bottom-nav-to-phones

Conversation

@ShaanNarendran

@ShaanNarendran ShaanNarendran commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Purpose / Description

Scopes the bottom navigation bar to mobile, earlier there was bleeding to tablet still.

Fixes

  • For GSoC 2026: Redesign Deck Picker

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?

image image Manually tested.

Checklist

Please, go through these checks before submitting the PR.

  • 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
  • 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

@ShaanNarendran ShaanNarendran added the GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors label Oct 1, 2026
Comment thread AnkiDroid/src/androidTest/java/com/ichi2/anki/DeckPickerTest.kt Outdated

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/settings/Prefs.kt Outdated
@ShaanNarendran
ShaanNarendran force-pushed the fix/scope-bottom-nav-to-phones branch from 875d022 to 98857b2 Compare October 1, 2026 18:22
@ShaanNarendran
ShaanNarendran force-pushed the fix/scope-bottom-nav-to-phones branch 2 times, most recently from a93671c to f999adf Compare October 1, 2026 18:55
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Snapshot diff report: Previous regressions were resolved by the latest commit.

@sanjaysargam
sanjaysargam self-requested a review October 3, 2026 13:22

@sanjaysargam sanjaysargam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@david-allison david-allison left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Review labels Oct 3, 2026
@ShaanNarendran

Copy link
Copy Markdown
Contributor Author

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

Edited!

@ShaanNarendran
ShaanNarendran force-pushed the fix/scope-bottom-nav-to-phones branch from f999adf to cf71db1 Compare October 3, 2026 23:54
@ShaanNarendran ShaanNarendran removed the Needs Author Reply Waiting for a reply from the original author label Oct 4, 2026
@david-allison
david-allison added this pull request to the merge queue Oct 4, 2026
Merged via the queue into ankidroid:main with commit 91c3408 Oct 4, 2026
23 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 4, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Pull requests authored by a Google Summer of Code participant [Candidate/Selected], for GSoC mentors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants