Public Access
Let the phone's theme past the activity it is attached to
The head has now run on a device, and the first thing it did was die on the way up. DodoTheme parented @android:style/Theme.Material.NoActionBar, but AvaloniaMainActivity descends from AndroidX's AppCompatActivity, which asserts its own theme attributes while inflating and throws — "You need to use a Theme.AppCompat theme (or descendant)" — before a single Avalonia frame exists. The platform's own parents are the ones that look right, which is why the audit read as correct and the launcher icon still opened onto a splash screen and then nothing. Theme.AppCompat.NoActionBar instead, dark rather than .Light because every override below it repaints the window near-black regardless. The no-action-bar and status-bar decisions those overrides carry are untouched, so the reason they are there — a header that has to hold the vault name, and a clock that would otherwise be dark-on-dark — still holds. Verified on a OnePlus CPH2765: builds, deploys, and reaches the sign-in screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--
|
||||
The AppCompat parent is not a preference. Avalonia's AvaloniaMainActivity descends from AndroidX's
|
||||
AppCompatActivity, which checks for its own theme attributes while inflating and throws
|
||||
IllegalStateException — "You need to use a Theme.AppCompat theme (or descendant)" — before a single
|
||||
Avalonia frame exists. The platform's own Theme.Material parents look right and crash on launch.
|
||||
|
||||
The dark variant rather than .Light, because everything below repaints the window near-black anyway.
|
||||
|
||||
No action bar: this head draws its own header, because the design's header carries the vault name and
|
||||
the sync dot, which a system action bar has nowhere to put.
|
||||
|
||||
@@ -8,7 +15,7 @@
|
||||
strip is #7E8A84 text on near-black, and leaving this at its default renders dark-on-dark — legible
|
||||
on the mock-up and invisible on a device.
|
||||
-->
|
||||
<style name="DodoTheme" parent="@android:style/Theme.Material.NoActionBar">
|
||||
<style name="DodoTheme" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="android:windowBackground">@color/dodo_window</item>
|
||||
<item name="android:statusBarColor">@color/dodo_window</item>
|
||||
<item name="android:navigationBarColor">@color/dodo_window</item>
|
||||
|
||||
Reference in New Issue
Block a user