mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added pressed effect on some actions & menus
This commit is contained in:
parent
bde1258c87
commit
4c2b67a5aa
11 changed files with 38 additions and 12 deletions
9
app/src/main/res/drawable/action_background.xml
Normal file
9
app/src/main/res/drawable/action_background.xml
Normal 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>
|
||||
|
|
@ -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>
|
||||
9
app/src/main/res/drawable/menu_item_background.xml
Normal file
9
app/src/main/res/drawable/menu_item_background.xml
Normal 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>
|
||||
4
app/src/main/res/drawable/shape_menu_item_background.xml
Normal file
4
app/src/main/res/drawable/shape_menu_item_background.xml
Normal 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>
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue