Skip to content

Commit

Permalink
fix: Update themes to correct poll/black theme issues (#255)
Browse files Browse the repository at this point in the history
`Theme.Pachli` was being overriden on v29+ devices which meant that poll
options were showing with too much padding. Fix that by using `AppTheme`
as the final theme, and basing that off `Theme.Pachli`.

Black themes were using dark grey for toolbar and tab backgrounds, so
fix that too for a seamless experience with the black theme.
  • Loading branch information
nikclayton authored Nov 15, 2023
1 parent 09dc830 commit fce34cc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
26 changes: 13 additions & 13 deletions app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `@color/black` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `@color/black` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;@color/black&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1285,7 +1285,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?android:attr/colorBackground` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?android:attr/colorBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?android:attr/colorBackground&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1296,7 +1296,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?attr/selectableItemBackground&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1307,7 +1307,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?attr/selectableItemBackground&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1318,7 +1318,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackgroundBorderless` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackgroundBorderless` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?attr/selectableItemBackgroundBorderless&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1329,7 +1329,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?attr/selectableItemBackground&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand All @@ -1340,7 +1340,7 @@

<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/Theme.Pachli`)"
message="Possible overdraw: Root element paints background `?attr/selectableItemBackground` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
errorLine1=" android:background=&quot;?attr/selectableItemBackground&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
Expand Down Expand Up @@ -2049,7 +2049,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/styles.xml"
line="124"
line="126"
column="12"/>
</issue>

Expand All @@ -2060,7 +2060,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/styles.xml"
line="151"
line="164"
column="12"/>
</issue>

Expand Down Expand Up @@ -2511,7 +2511,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/components/conversation/ConversationsFragment.kt"
line="151"
line="152"
column="29"/>
</issue>

Expand All @@ -2522,7 +2522,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/components/conversation/ConversationsFragment.kt"
line="153"
line="154"
column="37"/>
</issue>

Expand Down Expand Up @@ -3644,7 +3644,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/fragment/SFragment.kt"
line="223"
line="225"
column="48"/>
</issue>

Expand Down Expand Up @@ -3754,7 +3754,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/app/pachli/components/timeline/TimelineFragment.kt"
line="194"
line="195"
column="47"/>
</issue>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Pachli"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="false"
android:localeConfig="@xml/locales_config">

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v29/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<resources>
<style name="Theme.Pachli" parent="Base.Theme.Pachli">
<style name="AppTheme" parent="Theme.Pachli">
<!-- Transparent system bars for edge-to-edge. -->
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
</style>

<style name="AppTheme" parent="Theme.Pachli" />

<style name="Pachli.Widget.Toolbar" parent="Widget.Material3.Toolbar">
<item name="android:minHeight">?attr/actionBarSize</item>
</style>
Expand Down Expand Up @@ -143,6 +145,17 @@

<!-- TODO: Remove this, use colorControlNormal everywhere instead of iconColor -->
<item name="iconColor">?attr/colorControlNormal</item>

<item name="toolbarStyle">@style/Pachli.Widget.Toolbar.Black</item>
<item name="tabStyle">@style/Pachli.Widget.Material3.TabLayout</item>
</style>

<style name="Pachli.Widget.Toolbar.Black" parent="Widget.Material3.Toolbar">
<item name="android:background">@color/black</item>
</style>

<style name="Pachli.Widget.Material3.TabLayout" parent="Widget.Material3.TabLayout">
<item name="android:background">@color/black</item>
</style>

<style name="Theme.Pachli.Black" parent="Base.Theme.Black" />
Expand Down

0 comments on commit fce34cc

Please sign in to comment.