Skip to content

Commit

Permalink
Less bright outline on outline buttons with icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Nov 17, 2023
1 parent 1947a91 commit ece3c9e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<attr name="sgColorShadow" format="reference|color" />
<attr name="sgColorStatusBarOverlay" format="reference|color" />
<attr name="sgColorTopAppBar" format="reference|color" />
<attr name="sgColorOutlineLighter" format="reference|color" />

<!-- Custom view attributes -->
<declare-styleable name="EmptyView">
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

<!-- 38% primary, not using color state list as using theme-dependant attribute is API 23+. -->
<color name="sg_color_control_activated">#606545a0</color>
<color name="sg_color_outline_dark">#58535D</color>
<color name="sg_color_outline_light">#A5A2A8</color>

<color name="sg_background_gradient_start">#aaffffff</color>
<color name="sg_background_gradient_end">#ffffffff</color>
Expand Down
12 changes: 11 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,23 @@
<!-- Buttons -->
<style name="Widget.SeriesGuide.Button" parent="Widget.Material3.Button" />
<style name="Widget.SeriesGuide.Button.Outlined" parent="Widget.Material3.Button.OutlinedButton" />

<!-- With less bright outline. -->
<style name="Widget.SeriesGuide.Button.Outlined.Icon" parent="Widget.Material3.Button.OutlinedButton.Icon">
<!-- Parent style decreases only left margin which looks off, so reduce both. -->
<item name="android:paddingLeft">16dp</item>
<item name="android:paddingRight">16dp</item>
<item name="materialThemeOverlay">@style/ThemeOverlay.SeriesGuide.Button.Outlined</item>
</style>

<style name="Widget.SeriesGuide.Button.IconButton.Outlined" parent="Widget.Material3.Button.IconButton.Outlined">
<item name="materialThemeOverlay">@style/ThemeOverlay.SeriesGuide.Button.Outlined</item>
</style>

<style name="Widget.SeriesGuide.Button.IconButton.Outlined" parent="Widget.Material3.Button.IconButton.Outlined" />
<style name="ThemeOverlay.SeriesGuide.Button.Outlined" parent="ThemeOverlay.Material3.Button.TextButton">
<item name="colorOutline">?attr/sgColorOutlineLighter</item>
<item name="colorOnContainer">?attr/colorOnSurfaceVariant</item>
</style>

<style name="Widget.SeriesGuide.Button.Borderless" parent="Widget.Material3.Button.TextButton">
<item name="android:maxLines">2</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<item name="sgColorShadow">@color/sg_black_40</item>
<item name="sgColorStatusBarOverlay">@color/sg_black_87</item>
<item name="sgColorTopAppBar">@color/sg_background_app_bar_dark</item>
<item name="sgColorOutlineLighter">@color/sg_color_outline_dark</item>

<!-- dialogTheme is used by AppCompatDialogFragment. -->
<item name="dialogTheme">@style/ThemeOverlay.Material3.Dialog</item>
Expand Down Expand Up @@ -137,6 +138,7 @@
<item name="sgColorShadow">@color/sg_black_7</item>
<item name="sgColorStatusBarOverlay">@color/sg_white_87</item>
<item name="sgColorTopAppBar">@color/sg_color_background</item>
<item name="sgColorOutlineLighter">@color/sg_color_outline_light</item>

<!-- dialogTheme is used by AppCompatDialogFragment. -->
<item name="dialogTheme">@style/ThemeOverlay.Material3.Dialog</item>
Expand Down

0 comments on commit ece3c9e

Please sign in to comment.