contact selection reeemix
1) RecyclerView-based, with better long scroller and more material-inspired look. 2) Add badge for Signal users to contact selection list. // FREEBIE


BIN
res/drawable-hdpi/ic_badge_24dp.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
res/drawable-hdpi/ic_signal_grey_24dp.png
Normal file
After Width: | Height: | Size: 875 B |
BIN
res/drawable-hdpi/ic_signal_white_48dp.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
res/drawable-mdpi/ic_badge_24dp.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
res/drawable-mdpi/ic_signal_grey_24dp.png
Normal file
After Width: | Height: | Size: 596 B |
BIN
res/drawable-mdpi/ic_signal_white_48dp.png
Normal file
After Width: | Height: | Size: 900 B |
9
res/drawable-v12/recycler_view_fast_scroller_bubble.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topLeftRadius="44dp"
|
||||
android:topRightRadius="44dp"
|
||||
android:bottomLeftRadius="44dp"
|
||||
android:bottomRightRadius="0dp"/>
|
||||
<solid android:color="#FF0288D1" />
|
||||
<size android:height="88dp" android:width="88dp" />
|
||||
</shape>
|
BIN
res/drawable-xhdpi/ic_badge_24dp.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
res/drawable-xhdpi/ic_signal_grey_24dp.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
res/drawable-xhdpi/ic_signal_white_48dp.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
res/drawable-xxhdpi/ic_badge_24dp.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
res/drawable-xxhdpi/ic_signal_grey_24dp.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
res/drawable-xxhdpi/ic_signal_white_48dp.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable-xxxhdpi/ic_badge_24dp.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
res/drawable-xxxhdpi/ic_signal_grey_24dp.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
res/drawable-xxxhdpi/ic_signal_white_48dp.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
6
res/drawable/badge_drawable.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<bitmap android:src="@drawable/ic_badge_24dp"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:gravity="bottom|right"
|
||||
android:tileMode="disabled" />
|
9
res/drawable/recycler_view_fast_scroller_bubble.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:topLeftRadius="44dp"
|
||||
android:topRightRadius="44dp"
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="44dp"/>
|
||||
<solid android:color="#FF0288D1" />
|
||||
<size android:height="88dp" android:width="88dp" />
|
||||
</shape>
|
17
res/drawable/recycler_view_fast_scroller_handle.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#FF0288D1"/>
|
||||
<size android:height="32dp" android:width="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#FF737373"/>
|
||||
<size android:height="32dp" android:width="4dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@@ -1,5 +1,5 @@
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
@@ -9,8 +9,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
|
||||
android:id="@android:id/list"
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
@@ -23,4 +23,11 @@
|
||||
android:textSize="20sp" />
|
||||
|
||||
</android.support.v4.widget.SwipeRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.RecyclerViewFastScroller
|
||||
android:id="@+id/fast_scroller"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@@ -1,72 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<org.thoughtcrime.securesms.contacts.ContactSelectionListItem
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:paddingRight="50dp">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/conversation_list_item_background"
|
||||
android:paddingLeft="48dp"
|
||||
android:paddingRight="20dp">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/contact_photo_image"
|
||||
android:layout_width="@dimen/contact_selection_photo_size"
|
||||
android:layout_height="@dimen/contact_selection_photo_size"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:cropToPadding="true"
|
||||
app:showBadge="true"
|
||||
tools:src="@color/md_material_blue_600"
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="@string/SingleContactSelectionActivity_contact_photo" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/number_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dip"
|
||||
android:layout_marginLeft="14dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toRightOf="@id/contact_photo_image">
|
||||
|
||||
<TextView android:id="@+id/number"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:fontFamily="sans-serif-light" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="16sp"
|
||||
tools:text="Frieeeeeeedrich Nieeeeeeeeeetzsche" />
|
||||
|
||||
<LinearLayout android:id="@+id/number_container"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView android:id="@+id/number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="sans-serif-light"
|
||||
tools:text="+1 (555) 555-5555" />
|
||||
|
||||
<TextView android:id="@+id/label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dip"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:fontFamily="sans-serif-light"
|
||||
tools:text="Mobile" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView android:id="@+id/label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dip"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:fontFamily="sans-serif-light"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/number_container"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="1dip"
|
||||
android:layout_marginLeft="14dip"
|
||||
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:layout_toRightOf="@id/contact_photo_image"
|
||||
android:gravity="center_vertical|left"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<CheckBox android:id="@+id/check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="13dp"
|
||||
android:focusable="false"
|
||||
android:clickable="false" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:focusable="false"
|
||||
android:clickable="false" />
|
||||
|
||||
</org.thoughtcrime.securesms.contacts.ContactSelectionListItem>
|
||||
|
9
res/layout/contact_selection_recyclerview_header.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:gravity="center"
|
||||
android:textColor="#666"
|
||||
android:textSize="22sp"
|
||||
tools:text="H" />
|
24
res/layout/recycler_view_fast_scroller.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView android:id="@+id/fastscroller_bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/recycler_view_fast_scroller_bubble"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="48sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:text="A" />
|
||||
|
||||
<ImageView android:id="@+id/fastscroller_handle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/recycler_view_fast_scroller_handle" />
|
||||
|
||||
</merge>
|
@@ -129,7 +129,8 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AvatarImageView">
|
||||
<attr name="inverted" format="boolean"/>
|
||||
<attr name="inverted" format="boolean" />
|
||||
<attr name="showBadge" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="ThumbnailView">
|
||||
|