Skip to content

Commit

Permalink
Visual feedback when tapping the action button on messages, attempt 2 (
Browse files Browse the repository at this point in the history
  • Loading branch information
Hocuri authored Oct 17, 2024
1 parent efc09f1 commit 90c8650
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/main/res/drawable-v21/touch_highlight_background_strong.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Like touch_highlight_background, but creates a stronger (i.e. better visible)
visual feedback when the button is pressed. -->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/delta_primary">
<item android:id="@android:id/mask" android:drawable="@android:color/white" />
<item>
<selector>
<item android:drawable="@color/touch_highlight_strong" android:state_pressed="true" />
</selector>
</item>
</ripple>
6 changes: 6 additions & 0 deletions src/main/res/drawable/touch_highlight_background_strong.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@color/touch_highlight_strong" />
<item android:state_focused="true" android:drawable="@color/delta_primary" />
<item android:drawable="@android:color/transparent" />
</selector>
2 changes: 1 addition & 1 deletion src/main/res/layout/conversation_item_received.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
android:paddingBottom="@dimen/message_bubble_showmore_padding"
android:minHeight="1dp"
android:minWidth="0dp"
android:background="@android:color/transparent"
android:background="@drawable/touch_highlight_background_strong"
android:textColor="@color/delta_accent_darker"
android:text="@string/show_full_message"
android:textAllCaps="false"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/res/layout/conversation_item_sent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
android:paddingBottom="@dimen/message_bubble_showmore_padding"
android:minHeight="1dp"
android:minWidth="0dp"
android:background="@android:color/transparent"
android:background="@drawable/touch_highlight_background_strong"
android:textColor="@color/delta_accent_darker"
android:text="@string/show_full_message"
android:textAllCaps="false"/>
Expand Down
1 change: 1 addition & 0 deletions src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

<color name="action_mode_status_bar">@color/gray50</color>
<color name="touch_highlight">#400099cc</color>
<color name="touch_highlight_strong">#5C4CB8DB</color>

<color name="sticker_selected_color">#99ffffff</color>
<color name="transparent">#00FFFFFF</color>
Expand Down

0 comments on commit 90c8650

Please sign in to comment.