Add touch highlight to contact photos

This commit is contained in:
Veeti Paananen
2014-02-25 05:07:12 +02:00
parent 4f066757e7
commit 757cb1c846
5 changed files with 250 additions and 9 deletions

View 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>

View File

@@ -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"

View File

@@ -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"

View File

@@ -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>