Added pressed effect on some actions & menus

This commit is contained in:
Sylvain Berfini 2023-08-19 10:05:36 +02:00
parent bde1258c87
commit 4c2b67a5aa
11 changed files with 38 additions and 12 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/shape_selected_list_cell_background" />
<item android:state_pressed="true"
android:drawable="@drawable/shape_selected_list_cell_background" />
<item
android:drawable="@color/transparent_color" />
</selector>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/shape_conversation_selected_cell_background" />
android:drawable="@drawable/shape_selected_list_cell_background" />
<item android:state_pressed="true"
android:drawable="@drawable/shape_conversation_selected_cell_background" />
android:drawable="@drawable/shape_selected_list_cell_background" />
<item
android:drawable="@drawable/shape_conversation_cell_background" />
android:drawable="@drawable/shape_list_cell_background" />
</selector>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true"
android:drawable="@drawable/shape_selected_list_cell_background" />
<item android:state_pressed="true"
android:drawable="@drawable/shape_selected_list_cell_background" />
<item
android:drawable="@drawable/shape_menu_item_background" />
</selector>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/gray_2"/>
</shape>

View file

@ -15,7 +15,7 @@
android:onClick="@{() -> model.setAsDefault()}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_conversation_cell_background">
android:background="@drawable/shape_list_cell_background">
<androidx.constraintlayout.widget.Barrier
android:id="@+id/left_barrier"

View file

@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:text="Ajouter aux contacts"
style="@style/context_menu_action_label_style"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/new_contact"
app:layout_constraintBottom_toTopOf="@id/share"
@ -41,7 +41,7 @@
android:layout_height="wrap_content"
android:text="Copier le numéro"
style="@style/context_menu_action_label_style"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/copy"
app:layout_constraintBottom_toTopOf="@id/delete"
@ -55,7 +55,7 @@
android:layout_height="wrap_content"
android:text="Supprimer"
style="@style/context_menu_danger_action_label_style"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/delete"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -474,6 +474,7 @@
android:layout_marginEnd="17dp"
android:text="Edit"
android:drawableStart="@drawable/edit"
android:background="@drawable/action_background"
app:layout_constraintTop_toTopOf="@id/actions_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
@ -496,6 +497,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:background="@drawable/action_background"
android:text="@{viewModel.isFavourite ? `Remove from favourites` : `Add to favourites`, default=`Add to favourites`}"
android:drawableStart="@{viewModel.isFavourite ? @drawable/favourite : @drawable/not_favourite, default=@drawable/favourite}"
android:drawableTint="@{viewModel.isFavourite ? @color/red_danger : @color/gray_1, default=@color/gray_1}"
@ -521,6 +523,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:background="@drawable/action_background"
android:text="Share"
android:drawableStart="@drawable/share"
app:layout_constraintTop_toBottomOf="@id/action_favorite"
@ -545,6 +548,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginEnd="17dp"
android:background="@drawable/action_background"
android:text="Delete"
android:drawableStart="@drawable/delete"
app:layout_constraintTop_toBottomOf="@id/action_share"

View file

@ -27,7 +27,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Copier le numéro"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/copy"
app:layout_constraintBottom_toTopOf="@id/invite"
@ -42,7 +42,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Inviter"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/invite"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -33,7 +33,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:text="@{isFavourite ? `Remove from favourites` : `Add to favourites`, default=`Add to favourites`}"
android:drawableStart="@{isFavourite ? @drawable/favourite : @drawable/not_favourite, default=@drawable/favourite}"
android:drawableTint="@{isFavourite ? @color/red_danger : @color/gray_1, default=@color/gray_1}"
@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:text="Partager"
style="@style/context_menu_action_label_style"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/share"
app:layout_constraintBottom_toTopOf="@id/delete"
@ -62,7 +62,7 @@
android:layout_height="wrap_content"
android:text="Supprimer"
style="@style/context_menu_danger_action_label_style"
android:background="@color/gray_2"
android:background="@drawable/menu_item_background"
android:layout_marginBottom="1dp"
android:drawableStart="@drawable/delete"
app:layout_constraintBottom_toBottomOf="parent"