mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 06:23:17 +00:00
Add touch highlight to contact photos
This commit is contained in:
10
res/drawable/contact_photo_background.xml
Normal file
10
res/drawable/contact_photo_background.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/touch_highlight" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
@@ -26,7 +26,9 @@
|
||||
android:layout_marginRight="0dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView android:id="@+id/contact_photo"
|
||||
<org.thoughtcrime.securesms.components.ForegroundImageView
|
||||
android:id="@+id/contact_photo"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="10dp"
|
||||
|
@@ -15,14 +15,16 @@
|
||||
android:paddingRight="10dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView android:id="@+id/contact_photo_image"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:cropToPadding="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="Contact Photo Image"
|
||||
android:layout_marginLeft="0dp" />
|
||||
<org.thoughtcrime.securesms.components.ForegroundImageView
|
||||
android:id="@+id/contact_photo_image"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:cropToPadding="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="Contact Photo Image"
|
||||
android:layout_marginLeft="0dp" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView android:id="@+id/from"
|
||||
|
@@ -58,4 +58,10 @@
|
||||
<attr name="menu_group_icon" format="reference" />
|
||||
<attr name="menu_split_icon" format="reference" />
|
||||
<attr name="menu_accept_icon" format="reference" />
|
||||
|
||||
<declare-styleable name="ForegroundImageView">
|
||||
<attr name="android:foreground" />
|
||||
<attr name="android:foregroundInsidePadding" />
|
||||
<attr name="android:foregroundGravity" />
|
||||
</declare-styleable>
|
||||
</resources>
|
Reference in New Issue
Block a user