mirror of
https://github.com/cylonid/NativeAlphaForAndroid.git
synced 2026-11-05 00:47:30 +00:00
[PR #231] Support edge-to-edge and target Android 16 #235
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cylonid/NativeAlphaForAndroid#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cylonid/NativeAlphaForAndroid/pull/231
Author: @dkodr
Created: 9/11/2026
Status: 🔄 Open
Base:
dev← Head:feat/edge-to-edge-target-36📝 Commits (10+)
0df7b8bSupport edge-to-edge and target Android 166038466Blend the system bars into the web page14848daTint the toolbar icons for the signature background2c00511Even out the settings margins and free the scrollbar523bb0dMake the web app list and the settings actions read as Material46476abGive the settings actions a Material hierarchy2e253faGenerate both color schemes from the same seed983bc9bTake the swipe action colors from the schemebcd6675Colour each bar area from the part of the page behind itf8e7806Tidy up after review📊 Changes
23 files changed (+402 additions, -224 deletions)
View changed files
📝
app/build.gradle(+2 -2)📝
app/src/main/AndroidManifest.xml(+1 -1)📝
app/src/main/java/com/cylonid/nativealpha/AboutActivity.kt(+2 -0)📝
app/src/main/java/com/cylonid/nativealpha/MainActivity.kt(+2 -0)📝
app/src/main/java/com/cylonid/nativealpha/WebViewActivity.java(+33 -19)➕
app/src/main/java/com/cylonid/nativealpha/util/WindowInsetsUtils.kt(+124 -0)📝
app/src/main/kotlin/com/cylonid/nativealpha/activities/NewsActivity.kt(+2 -0)📝
app/src/main/kotlin/com/cylonid/nativealpha/activities/ToolbarBaseActivity.kt(+2 -0)📝
app/src/main/res/layout/activity_main.xml(+6 -2)📝
app/src/main/res/layout/fragment_adblock_list.xml(+1 -1)📝
app/src/main/res/layout/fragment_web_app_list.xml(+2 -2)📝
app/src/main/res/layout/global_settings.xml(+13 -5)📝
app/src/main/res/layout/toolbar_back_action.xml(+2 -1)📝
app/src/main/res/layout/web_app_list_item.xml(+4 -5)📝
app/src/main/res/layout/webapp_settings.xml(+15 -4)📝
app/src/main/res/values-night/colors.xml(+120 -120)📝
app/src/main/res/values-night/themes.xml(+8 -3)📝
app/src/main/res/values/colors.xml(+49 -53)📝
app/src/main/res/values/dimens.xml(+1 -0)📝
app/src/main/res/values/theme_overlays.xml(+3 -0)...and 3 more files
📄 Description
Android 16 deprecates and disables
windowOptOutEdgeToEdgeEnforcement(behaviour changes), so the opt-out added in
e5f97b3for the Android 15enforcement stops working the moment the target is raised. Since 31 August 2026
Google Play requires new submissions and updates to target API 36, so raising it
is no longer optional. This handles the insets instead of opting out.
Closes #171. Also fixes #193 and #194. It supersedes #216 and covers the same
ground as #217, which I only found after starting — thanks to @tedgravlin for
both; the back-navigation part here migrates to
OnBackPressedDispatcherratherthan only enabling the callback, because at target 36
onBackPressed()is nolonger called at all.
Target and toolchain
compileSdkandtargetSdkto 36; AGP to 8.13.2 and Gradle to 8.13, theminimum that supports API 36. Deliberately still on the 8.x line, since the
manifest-rewriting build logic does not survive AGP 9.
versionCodeandversionNameare untouched — that is your release step.Edge-to-edge
systemBars | displayCutout | imeand report thosetypes back as
Insets.NONE, per the WebView inset guidance, so theWebView does not pad them a second time.
fitsSystemWindows.setDecorFitsSystemWindows(false)plus transparent bar colours for API 28–34,where removing the opt-out alone does nothing.
That is #193.
OnBackPressedDispatcher(#194 is thekeyboard part; this is the predictive-back part).
Bars that match the page
Padding the WebView leaves two strips showing the window background, which does
not match the page behind them. After each load the page reports its
theme-colorand its computedbodybackground; the first fills the top strip,the second the bottom, and each bar takes its icon colour from its own side.
One sampled colour is not enough: on a page with a dark header over light
content the mismatched end was off by 224 of 255 per channel. Measured on three
pages, comparing theme-color for both strips, body background for both, and one
each:
Pages that do not handle safe-area insets themselves work the same as any
other, which is why this does not rely on
env(safe-area-inset-*).Visual cleanup
These are separate commits and can be dropped if you would rather keep this PR
to the release blocker.
Material tonal-spot scheme seeded with
#B71C1Cin 92 of 141 values; the darkone matched in 21, and its primary was
#F0BE6D, an amber from an unrelatedseed — hence amber switches under a red app bar in dark mode. Both are
regenerated with
material-color-utilities:new SchemeTonalSpot(Hct.fromInt(argbFromHex('#B71C1C')), isDark, contrast).This does change every dark-mode colour, so it is worth a look.
colorControlNormalon the red app bar, below the 3:1 WCAG needs forinterface icons.
#EF6C00next tothe signature red, and
#FD2C2Cfor delete, a third red. NowcolorErrorContainerandcolorTertiaryContainer, which follow the theme andhave dark variants.
outsideOverlayscrollbar floated 25dp from the screen edge.starts after the drag handle, which left them visibly off-centre.
buttons are also no longer a recommended pairing, so Save is filled now.
colorSignatureDarkandswipe_action_positive, both unreferenced.Testing
Pixel on Android 17 (API 37, WebView 151) and an API 34 emulator, light and dark
system themes: main screen, settings, a light and a dark page, immersive on and
off, back through WebView history → base URL → background, and a page with a
bottom-anchored input and a sticky bottom bar with the keyboard open.
Not tested: landscape, cutouts on the short edges, and
sw >= 600dp, wheretarget 36 additionally stops honouring the portrait lock.
RoboTests.initializationErrorandUtilUnitTests.faviconFromWebManifestfailidentically on unmodified
dev— the first has no runnable methods, the secondasserts against a live favicon URL that has changed.
Two notes on the build
libadblock-client.sofromEdsuns/AdblockAndroid:ad-filter:v0.9.1has 4 KBLOADalignment in all four ABIs. Android 17 shows a compatibility warningnaming it, and since 1 November 2025 Play rejects apps targeting Android 15+
whose native code is not 16 KB aligned. The library has had no release since
v0.9.1, so this needs a rebuilt or replaced dependency — independent of this PR,
but it will block the same release.
Also,
preBuild.dependsOn renameManifestmovesAndroidManifest.xmlout of theway and only
assemble'sdoLastmoves it back, so twoassembletasks in oneGradle invocation delete it, and a failed build leaves the tree dirty. Worth a
line in the README until it changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.