Skip to content

feat(card-browser): edge to edge support & code cleanup - #20938

Merged
david-allison merged 5 commits into
ankidroid:mainfrom
david-allison:edge-to-edge-browser
Aug 10, 2026
Merged

feat(card-browser): edge to edge support & code cleanup#20938
david-allison merged 5 commits into
ankidroid:mainfrom
david-allison:edge-to-edge-browser

Conversation

@david-allison

@david-allison david-allison commented May 4, 2026

Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Opus 4.7 - understanding and fix of windowBackground issue
Assisted-by: Claude Fable 5 - last commit

Fixes

How Has This Been Tested?

API 24 + API 33 emulators, private branch with Roborazzi

(scrolling to the bottom does not truncate rows)

image Screenshot 2026-05-04 at 08 11 24 Screenshot 2026-05-04 at 08 09 52
Subject: [PATCH] !!edge to edge
---
Index: AnkiDroid/src/main/res/values-v35/theme_black.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values-v35/theme_black.xml b/AnkiDroid/src/main/res/values-v35/theme_black.xml
--- a/AnkiDroid/src/main/res/values-v35/theme_black.xml	(revision 182e7993e1207d0c493df461beefb86e3d098849)
+++ b/AnkiDroid/src/main/res/values-v35/theme_black.xml	(revision 713e19ef60adb5637dc9243525f447dbe4e7b2cf)
@@ -15,9 +15,5 @@
   -->
 
 <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="DuplicateCrowdInStrings">
-    <style name="Base.V35.Dark.Black" parent="@style/Base.Theme.Dark.Black">
-        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
-    </style>
-
-    <style name="Theme_Dark.Black" parent="Base.V35.Dark.Black"/>
+    <style name="Theme_Dark.Black" parent="@style/Base.Theme.Dark.Black"/>
 </resources>
\ No newline at end of file
Index: AnkiDroid/src/main/res/values-v35/theme_dark.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values-v35/theme_dark.xml b/AnkiDroid/src/main/res/values-v35/theme_dark.xml
--- a/AnkiDroid/src/main/res/values-v35/theme_dark.xml	(revision 182e7993e1207d0c493df461beefb86e3d098849)
+++ b/AnkiDroid/src/main/res/values-v35/theme_dark.xml	(revision 713e19ef60adb5637dc9243525f447dbe4e7b2cf)
@@ -15,9 +15,5 @@
   -->
 
 <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="DuplicateCrowdInStrings">
-    <style name="Base.V35.Dark" parent="Base.V29.Dark">
-        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
-    </style>
-
-    <style name="Theme_Dark" parent="Base.V35.Dark"/>
+    <style name="Theme_Dark" parent="Base.V29.Dark"/>
 </resources>
Index: AnkiDroid/src/main/res/values-v35/theme_light.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values-v35/theme_light.xml b/AnkiDroid/src/main/res/values-v35/theme_light.xml
--- a/AnkiDroid/src/main/res/values-v35/theme_light.xml	(revision 182e7993e1207d0c493df461beefb86e3d098849)
+++ b/AnkiDroid/src/main/res/values-v35/theme_light.xml	(revision 713e19ef60adb5637dc9243525f447dbe4e7b2cf)
@@ -16,9 +16,5 @@
   -->
 
 <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="DuplicateCrowdInStrings">
-    <style name="Base.V35.Light" parent="Base.V29.Light">
-        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
-    </style>
-
-    <style name="Theme_Light" parent="Base.V35.Light"/>
+    <style name="Theme_Light" parent="Base.V29.Light"/>
 </resources>
Index: AnkiDroid/src/main/res/values-v35/theme_plain.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values-v35/theme_plain.xml b/AnkiDroid/src/main/res/values-v35/theme_plain.xml
--- a/AnkiDroid/src/main/res/values-v35/theme_plain.xml	(revision 182e7993e1207d0c493df461beefb86e3d098849)
+++ b/AnkiDroid/src/main/res/values-v35/theme_plain.xml	(revision 713e19ef60adb5637dc9243525f447dbe4e7b2cf)
@@ -15,9 +15,5 @@
   -->
 
 <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="DuplicateCrowdInStrings">
-    <style name="Base.V29.Light.Plain" parent="@style/Base.Theme.Light.Plain">
-        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
-    </style>
-
-    <style name="Theme_Light.Plain" parent="Base.V29.Light.Plain"/>
+    <style name="Theme_Light.Plain" parent="@style/Base.Theme.Light.Plain"/>
 </resources>
\ No newline at end of file
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml	(revision 182e7993e1207d0c493df461beefb86e3d098849)
+++ b/gradle/libs.versions.toml	(revision 713e19ef60adb5637dc9243525f447dbe4e7b2cf)
@@ -10,7 +10,7 @@
 # The API should be as low as possible in order to enable dependencies to stay on a lower minSdk.
 apiMinSdk = "16"
 
-targetSdk = "35"  # affects which SDKs download in ../robolectricDownloader.gradle
+targetSdk = "36"  # affects which SDKs download in ../robolectricDownloader.gradle
 acra = '5.13.1'
 ktlint = '1.8.0'
 # AGP is included in Android Studio and changelogs are not well maintained/at a stable URL

Checklist

  • 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

@david-allison david-allison added this to the 2.25 release milestone May 4, 2026
@david-allison
david-allison marked this pull request as draft May 4, 2026 08:29
@david-allison

This comment was marked as resolved.

@david-allison
david-allison force-pushed the edge-to-edge-browser branch from b6e5519 to 1815add Compare May 4, 2026 09:30
@david-allison

This comment was marked as resolved.

@david-allison
david-allison force-pushed the edge-to-edge-browser branch 2 times, most recently from 95ed22c to d126936 Compare May 4, 2026 17:54
@david-allison
david-allison marked this pull request as ready for review May 4, 2026 17:55
@david-allison
david-allison force-pushed the edge-to-edge-browser branch from d126936 to 725a33e Compare May 5, 2026 19:05
@david-allison

Copy link
Copy Markdown
Member Author

I want to fix this for rounded corners and the RecyclerFastScroller

@david-allison
david-allison marked this pull request as draft May 6, 2026 16:55
@david-allison
david-allison marked this pull request as draft May 6, 2026 16:55
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author labels May 6, 2026
@github-actions

This comment was marked as outdated.

@github-actions github-actions Bot added the Stale label May 20, 2026
@david-allison david-allison added the Review High Priority Request for high priority review label May 29, 2026
@david-allison
david-allison force-pushed the edge-to-edge-browser branch 2 times, most recently from 9981ea4 to 15968e5 Compare May 29, 2026 17:12
@github-actions

This comment was marked as outdated.

@ericli3690 ericli3690 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.

Looks awesome, thanks!! Tested on both my phone and tablet and looks good, code looks clean

CI is failing on MacOS only for some reason, I tried re-triggering it and it failed again, looks to be a CI environment link error. It's probably safe for me to hit merge right away but I'll leave it to your discretion.

* is a side inset (wider than the rounded corner it clears), with the camera cutout on the
* opposite side.
*/
private fun CardBrowser.simulateSideNavigationBar() {

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.

nit: there looks to be a lot of repetition between simulateNavigationBar, simulateGestureNavigationBar, and simulateSideNavigationBar that could maybe be extracted into a common function but eh it's probably fine since it's just a test file.

@ericli3690 ericli3690 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 Review High Priority Request for high priority review Needs Review labels Aug 8, 2026
@david-allison

david-allison commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

I was in the process of fixing up the commits, then went out for the weekend. Let's hold off on the merge for now, it's next on my TO-DO list

Thanks so much for the fast review!

@david-allison david-allison removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Aug 8, 2026
@david-allison
david-allison force-pushed the edge-to-edge-browser branch 2 times, most recently from 0e570ad to 87ea415 Compare August 8, 2026 18:01
@david-allison

david-allison commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

@david-allison david-allison added the Blocked by dependency Currently blocked by some other dependent / related change label Aug 8, 2026
Roborazzi test added to catch future regressions

Issue 17334 - edge to edge

Assisted-by: Claude Opus 4.7 - unit tests
Enable edge-to-edge support

* The app bar handles landscape mode (3-button navigation)
  * The color expands the full width; touchable elements are not
  underneath the nav
* The rows are drawn under the nav in portrait mode
* When scrolled to the bottom, the last row is tappable

Issue 17334

Assisted-by: Claude Opus 4.7 - unit tests + frame fix
Assisted-by: Claude Fable 5
Added at bind time in BrowserMultiColumnAdapter.kt

Assisted-by: Claude Opus 4.7 - diagnostic
After edge-to-edge, some interactive elements were hard to use as my
Google Pixel 9 Pro had rounded corners

* Corner handling is applied, so touchable controls at the bottom of the
 page are not obscured by the corner radius
  * Special-case: in landscape mode, the fast scroller does not hug the
  side if 3-button nav is implemented, so the corner detection is
  relaxed/removed depending on the corner radius

Asserted in CardBrowserInsetsTest; captured in a landscape
gesture-navigation screenshot test.

Assisted-by: Claude Fable 5
@david-allison david-allison added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Author Reply Waiting for a reply from the original author Blocked by dependency Currently blocked by some other dependent / related change labels Aug 9, 2026
@david-allison

Copy link
Copy Markdown
Member Author

@ericli3690 I've made a few updates, it could do with a second review if you have the time.

I'll merge in 24 hours - we've got a lot to get through with edge to edge, and I want to start aggressively tackling this

@david-allison david-allison added the Needs reviewer reply Waiting for a reply from another reviewer label Aug 9, 2026

@ericli3690 ericli3690 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.

All I see are minor changes to CardBrowserScreenshotTest (correct me if I'm wrong) and a rebase, so it looks good to me!! Not sure why macOS tests are failing now, I think I saw you retrigger them and they failed again, so I'll leave the merge to you.

@david-allison
david-allison added this pull request to the merge queue Aug 10, 2026
@david-allison

Copy link
Copy Markdown
Member Author

Seems like there's unrelated flakiness.

We /need/ these changes to get a new release out (edge to edge has become mandatory), so I'll merge to keep things moving.

Merged via the queue into ankidroid:main with commit f3c5944 Aug 10, 2026
26 of 29 checks passed
@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 Aug 10, 2026
@david-allison
david-allison deleted the edge-to-edge-browser branch August 10, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs reviewer reply Waiting for a reply from another reviewer

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants