Skip to content

Commit

Permalink
Give action bar icons the right color during action mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbakker committed Mar 8, 2024
1 parent 52cb030 commit 5e84772
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions app/src/main/res/drawable/ic_content_copy_white_24dp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="?attr/colorControlNormal" android:pathData="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path android:fillColor="#fff" android:pathData="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />
</vector>
13 changes: 9 additions & 4 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
<!-- Styles -->
<item name="dropdownStyle">@style/Widget.Aegis.Dropdown</item>
<item name="preferenceTheme">@style/ThemeOverlay.Aegis.Preference</item>
<!-- The hack below is necessary to force the action mode overflow menu to the right color -->
<item name="actionBarPopupTheme">@style/Widget.Material3.PopupMenu.ContextMenu</item>
<item name="actionModeTheme">@style/ThemeOverlay.Aegis.ActionMode</item>
<!-- Settings -->
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBar">false</item>
Expand Down Expand Up @@ -125,8 +124,7 @@
<!-- Styles -->
<item name="dropdownStyle">@style/Widget.Aegis.Dropdown</item>
<item name="preferenceTheme">@style/ThemeOverlay.Aegis.Preference</item>
<!-- The hack below is necessary to force the action mode overflow menu to the right color -->
<item name="actionBarPopupTheme">@style/Widget.Material3.PopupMenu.ContextMenu</item>
<item name="actionModeTheme">@style/ThemeOverlay.Aegis.ActionMode</item>
<!-- Settings -->
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBar">false</item>
Expand Down Expand Up @@ -193,4 +191,11 @@
<style name="ThemeOverlay.Aegis.ErrorCardView" parent="">
<item name="colorSurfaceContainerHighest">?attr/colorErrorContainer</item>
</style>

<style name="ThemeOverlay.Aegis.ActionMode" parent="">
<!-- Magically give the action mode icons the right color -->
<item name="actionButtonStyle">@style/Widget.AppCompat.ActionButton</item>
<!-- The hack below is necessary to force the action mode overflow menu to the right color -->
<item name="actionBarPopupTheme">@style/Widget.Material3.PopupMenu.ContextMenu</item>
</style>
</resources>

0 comments on commit 5e84772

Please sign in to comment.