parent
9408579862
commit
bd2e984963
17 changed files with 54 additions and 148 deletions
10
res/drawable-v21/conversation_list_item_background.xml
Normal file
10
res/drawable-v21/conversation_list_item_background.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/textsecure_primary">
|
||||
<item android:id="@android:id/mask" android:drawable="@android:color/black" />
|
||||
<item>
|
||||
<selector>
|
||||
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
4
res/drawable/conversation_list_item_background.xml
Normal file
4
res/drawable/conversation_list_item_background.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
|
||||
</selector>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_pressed="true" android:state_selected="false"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_selected="false" android:state_activated="false"
|
||||
android:drawable="@color/conversation_list_item_background_read_dark" />
|
||||
<item android:state_activated="true"
|
||||
android:drawable="@drawable/list_selector_background_selected" />
|
||||
</selector>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_pressed="true" android:state_selected="false"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_selected="false" android:state_activated="false"
|
||||
android:drawable="@color/conversation_list_item_background_read_light" />
|
||||
<item android:state_activated="true"
|
||||
android:drawable="@drawable/list_selector_background_selected" />
|
||||
</selector>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_pressed="true" android:state_selected="false"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_selected="false" android:state_activated="false"
|
||||
android:drawable="@color/conversation_list_item_background_unread_dark" />
|
||||
<item android:state_activated="true"
|
||||
android:drawable="@drawable/list_selector_background_selected" />
|
||||
</selector>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_pressed="true" android:state_selected="false"
|
||||
android:drawable="@android:color/transparent" />
|
||||
<item android:state_selected="false" android:state_activated="false"
|
||||
android:drawable="@color/conversation_list_item_background_unread_light" />
|
||||
<item android:state_activated="true"
|
||||
android:drawable="@drawable/list_selector_background_selected" />
|
||||
</selector>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#22000000" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:top="1px">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#33ffffff" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:bottom="1dp">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/black" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
|
@ -3,7 +3,6 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="?conversation_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
|
@ -60,12 +59,15 @@
|
|||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<View android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="?conversation_editor_background" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_panel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="?conversation_editor_background">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiToggle
|
||||
android:id="@+id/emoji_toggle"
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
android:divider="@android:color/transparent"
|
||||
android:dividerHeight="0dp"
|
||||
android:layout_marginBottom="1dip"
|
||||
android:cacheColorHint="?conversation_background" />
|
||||
android:cacheColorHint="?android:attr/windowBackground" />
|
||||
|
||||
</LinearLayout>
|
|
@ -47,8 +47,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:background="?conversation_background">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView android:id="@+id/sms_failed_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -4,30 +4,24 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/conversation_list_item_background"
|
||||
android:layout_height="70dp">
|
||||
|
||||
<FrameLayout android:id="@+id/contact_photo_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/contact_photo_image"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:cropToPadding="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_contact_picture"
|
||||
android:contentDescription="@string/conversation_list_item_view__contact_photo_image"
|
||||
android:layout_marginLeft="0dp" />
|
||||
</FrameLayout>
|
||||
<org.thoughtcrime.securesms.components.AvatarImageView
|
||||
android:id="@+id/contact_photo_image"
|
||||
android:foreground="@drawable/contact_photo_background"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:cropToPadding="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/ic_contact_picture"
|
||||
android:contentDescription="@string/conversation_list_item_view__contact_photo_image"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginLeft="10dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -37,7 +31,7 @@
|
|||
android:layout_marginRight="8dip"
|
||||
android:layout_marginBottom="4dip"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/contact_photo_frame"
|
||||
android:layout_toRightOf="@id/contact_photo_image"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -4,22 +4,12 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="?conversation_editor_background"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingLeft="15dp">
|
||||
|
||||
<EditText android:id="@+id/filter"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45sp"
|
||||
android:hint="@string/recipients_panel__to"
|
||||
android:background="@null"
|
||||
android:textColor="?conversation_editor_text_color" />
|
||||
|
||||
</FrameLayout>
|
||||
<EditText android:id="@+id/filter"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45sp"
|
||||
android:hint="@string/recipients_panel__to"
|
||||
android:textColor="?conversation_editor_text_color" />
|
||||
|
||||
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
|
||||
android:id="@android:id/list"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<attr name="ic_arrow_forward" format="reference" />
|
||||
|
||||
<attr name="conversation_background" format="reference|color"/>
|
||||
<attr name="conversation_editor_background" format="reference"/>
|
||||
<attr name="conversation_editor_background" format="reference|color"/>
|
||||
<attr name="conversation_editor_text_color" format="reference|color"/>
|
||||
<attr name="conversation_delivery_delivered" format="reference"/>
|
||||
<attr name="conversation_transport_sms_indicator" format="reference"/>
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
<color name="textsecure_primary">#ff2090ea</color>
|
||||
<color name="textsecure_primary_dark">#ff1c7ac5</color>
|
||||
|
||||
<color name="textsecure_primary_alpha33">#552090ea</color>
|
||||
|
||||
<color name="white">#ffffffff</color>
|
||||
<color name="black">#ff000000</color>
|
||||
<color name="gray5">#ffeeeeee</color>
|
||||
|
|
|
@ -28,9 +28,8 @@
|
|||
<item name="colorPrimary">@color/textsecure_primary</item>
|
||||
<item name="colorPrimaryDark">@color/textsecure_primary_dark</item>
|
||||
<item name="colorAccent">@color/textsecure_primary_dark</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<!--<item name="android:windowContentOverlay">@drawable/compat_actionbar_shadow_background</item>-->
|
||||
<item name="conversation_list_item_background_read">@drawable/conversation_list_item_background_read_light</item>
|
||||
<item name="conversation_list_item_background_unread">@drawable/conversation_list_item_background_unread_light</item>
|
||||
<item name="conversation_list_item_background_selected">@drawable/list_selected_holo_light</item>
|
||||
<item name="conversation_list_item_count_color">#66333333</item>
|
||||
<item name="conversation_list_item_contact_color">#FF333333</item>
|
||||
|
@ -55,8 +54,7 @@
|
|||
<item name="contact_selection_label_text">#66000000</item>
|
||||
<item name="conversation_selection_header_text">#44000000</item>
|
||||
|
||||
<item name="conversation_background">#ffffffff</item>
|
||||
<item name="conversation_editor_background">@drawable/textlines</item>
|
||||
<item name="conversation_editor_background">#22000000</item>
|
||||
<item name="conversation_editor_text_color">#ff111111</item>
|
||||
<item name="conversation_delivery_delivered">@drawable/ic_delivery_delivered_dark</item>
|
||||
<item name="conversation_transport_sms_indicator">@drawable/ic_send_sms_insecure</item>
|
||||
|
@ -138,9 +136,8 @@
|
|||
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||
<item name="android:textColor">@color/text_color_dark_theme</item>
|
||||
<item name="android:textColorSecondary">@color/text_color_secondary_dark_theme</item>
|
||||
<item name="android:windowBackground">@color/black</item>
|
||||
<item name="md_dark_theme">true</item>
|
||||
<item name="conversation_list_item_background_read">@drawable/conversation_list_item_background_read_dark</item>
|
||||
<item name="conversation_list_item_background_unread">@drawable/conversation_list_item_background_unread_dark</item>
|
||||
<item name="conversation_list_item_background_selected">@drawable/list_selected_holo_dark</item>
|
||||
<item name="conversation_list_item_count_color">#66dddddd</item>
|
||||
<item name="conversation_list_item_contact_color">#ffdddddd</item>
|
||||
|
@ -191,8 +188,7 @@
|
|||
<item name="fab_color">@color/textsecure_primary_dark</item>
|
||||
<item name="lower_right_divet">@drawable/divet_lower_right_light</item>
|
||||
|
||||
<item name="conversation_background">@color/black</item>
|
||||
<item name="conversation_editor_background">@drawable/textlines_dark</item>
|
||||
<item name="conversation_editor_background">#22ffffff</item>
|
||||
<item name="conversation_editor_text_color">#ffeeeeee</item>
|
||||
<item name="conversation_delivery_delivered">@drawable/ic_delivery_delivered_dark</item>
|
||||
<item name="conversation_transport_sms_indicator">@drawable/ic_send_sms_insecure_dark</item>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
|
@ -104,7 +103,7 @@ public class ConversationListItem extends RelativeLayout
|
|||
dateView.setTypeface(read ? LIGHT_TYPEFACE : BOLD_TYPEFACE);
|
||||
}
|
||||
|
||||
setBackground(read, batchMode);
|
||||
setBatchState(batchMode);
|
||||
this.contactPhotoImage.setAvatar(recipients.getPrimaryRecipient(), true);
|
||||
}
|
||||
|
||||
|
@ -117,22 +116,8 @@ public class ConversationListItem extends RelativeLayout
|
|||
contactPhotoImage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void setBackground(boolean read, boolean batch) {
|
||||
int[] attributes = new int[]{R.attr.conversation_list_item_background_selected,
|
||||
R.attr.conversation_list_item_background_read,
|
||||
R.attr.conversation_list_item_background_unread};
|
||||
|
||||
TypedArray drawables = context.obtainStyledAttributes(attributes);
|
||||
|
||||
if (batch && selectedThreads.contains(threadId)) {
|
||||
setBackgroundDrawable(drawables.getDrawable(0));
|
||||
} else if (read) {
|
||||
setBackgroundDrawable(drawables.getDrawable(1));
|
||||
} else {
|
||||
setBackgroundDrawable(drawables.getDrawable(2));
|
||||
}
|
||||
|
||||
drawables.recycle();
|
||||
private void setBatchState(boolean batch) {
|
||||
setSelected(batch && selectedThreads.contains(threadId));
|
||||
}
|
||||
|
||||
public Recipients getRecipients() {
|
||||
|
|
Loading…
Add table
Reference in a new issue