fix: Fix crash on entering MainActivity on some tablets #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First crash appeared to be caused by a failure to find the
attr/colorBackgroundAccent
colour from the theme.It wasn't clear why the attribute could not be found, so to fix it was simpler to remove the color and attribute entirely, and replace it with something more appropriate from the Material 3 tokens.
colorOutline
colorPrimary
(user's vote) orcolorSecondary
(other choices) with appropriate text colours.android:attr/textColorLink
?android/textColorLink
help_message_background
, and stroke with?colorOutline
Doing this I discovered several places where a colour was being specified unnecessarily, those have been removed.
To make it easier to understand the theme hierarchy that has been collapsed and renamed to follow Android conventions.
This unearthed a second crash, where
attr/actionBarSizeWithSubtitle
was not found.To fix that create an explicit style for toolbars that need it, and apply the style (
Pachli.Widget.Toolbar
).This also surfaced a third problem, where the
fragment_timeline*
layouts had not been updated inlayout-sw640dp
, so those have been updated to reflect the same views/IDs as the defaultfragment_timeline
layout.These changes caused a small chain of "unused resource" lint errors, which have been fixed by removing the unused colours.
The Android Material libraries were also being implicitly depended on through other library imports instead of being explicit. So include them as an explicit dependency.
Fixes #18