Theme Support

1) Broke out the UI elements of the major Activites into stylable
   attributes.

2) Created a 'light' and 'dark' theme for the newly stylable attrs.

3) Touched up some of the UI spacing.

4) Implemented dynamic theme switching support.
This commit is contained in:
Moxie Marlinspike
2013-06-21 11:56:59 -07:00
parent 2ffc70a95b
commit 5263ac1f1a
62 changed files with 443 additions and 156 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

View File

Before

Width:  |  Height:  |  Size: 927 B

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

View File

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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/read_bgcolor" />
<item android:state_activated="true"
android:drawable="@drawable/list_selector_background_selected" />
</selector>

View File

@@ -0,0 +1,11 @@
<?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>

View File

@@ -0,0 +1,11 @@
<?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>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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/unread_bgcolor" />
<item android:state_activated="true"
android:drawable="@drawable/list_selector_background_selected" />
</selector>

View File

@@ -0,0 +1,11 @@
<?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>

View File

@@ -0,0 +1,11 @@
<?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>

View File

@@ -18,7 +18,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/white_background"
android:background="?conversation_background"
android:gravity="bottom">
<fragment
@@ -38,7 +38,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="5dip"
android:background="#fff">
android:background="?conversation_background">
<LinearLayout
android:id="@+id/attachment_editor"
@@ -51,7 +51,8 @@
android:id="@+id/attachment_thumbnail"
android:layout_width="fill_parent"
android:layout_height="150dip"
android:layout_weight="1" />
android:layout_weight="1"
android:contentDescription="Attachment Thumbnail"/>
<LinearLayout
android:orientation="vertical"
@@ -70,9 +71,9 @@
</LinearLayout>
<View android:background="#eeeeee"
android:layout_width="match_parent"
android:layout_height="1dp" />
<View android:background="?conversation_editor_background"
android:layout_width="match_parent"
android:layout_height="1dp" />
<LinearLayout
android:id="@+id/bottom_panel"
@@ -97,7 +98,7 @@
android:maxLength="1000"
android:maxLines="4"
android:nextFocusRight="@+id/send_button"
android:textColor="@android:color/black" />
android:textColor="?conversation_editor_text_color" />
<ImageButton
android:id="@+id/send_button"
@@ -108,19 +109,17 @@
android:contentDescription="@string/conversation_activity__send"
android:nextFocusLeft="@+id/embedded_text_editor"
android:padding="12dp"
android:src="@drawable/ic_send_holo_light"
android:src="?conversation_send_button"
android:clickable="false"
android:enabled="false" />
<!-- android:tint="#66ffffff" />-->
"
</LinearLayout>
<TextView android:id="@+id/space_left"
android:paddingLeft="5dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="160/160 (1)"
/>
<TextView android:id="@+id/space_left"
android:paddingLeft="5dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="160/160 (1)" />
</LinearLayout>
</ScrollView>
</RelativeLayout>

View File

@@ -9,8 +9,9 @@
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="?conversation_card_background">
<view xmlns:android="http://schemas.android.com/apk/res/android"
class="org.thoughtcrime.securesms.components.ImageDivet"
@@ -20,14 +21,15 @@
android:layout_width="60dp"
android:layout_height="60dp"
android:cropToPadding="true"
android:layout_marginRight="10dip"
android:scaleType="centerCrop" />
<LinearLayout android:id="@+id/conversation_item_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/indicators_parent"
android:layout_toRightOf="@id/contact_photo"
android:background="?conversation_background"
android:paddingLeft="10dip"
android:orientation="vertical" >
<TextView android:id="@+id/conversation_item_body"
@@ -35,14 +37,16 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:linksClickable="true"
android:paddingTop="5dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ff000000"
android:textColor="?conversation_text_primary_color"
android:textSize="16sp" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mms_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:paddingTop="7dip"
android:paddingBottom="7dip">
@@ -54,7 +58,8 @@
android:scaleType="centerInside"
android:adjustViewBounds="true"
android:background="@android:drawable/picture_frame"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Message Media"/>
<ImageButton
android:id="@+id/play_slideshow_button"
@@ -62,7 +67,8 @@
android:layout_height="wrap_content"
android:src="@drawable/mms_play_btn"
android:layout_gravity="center"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Play Button"/>
</FrameLayout>
@@ -91,16 +97,18 @@
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="5dip"
android:gravity="left">
<ImageView android:id="@+id/delivered_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="3dip"
android:src="@drawable/ic_sms_mms_delivered"
android:visibility="gone" />
android:src="?conversation_delivered_indicator"
android:visibility="gone"
android:contentDescription="Delivered Indicator"/>
<TextView android:id="@+id/group_message_status"
android:layout_width="wrap_content"
@@ -108,7 +116,7 @@
android:linksClickable="false"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="left"
android:textColor="#ffcccccc"
android:textColor="?conversation_text_secondary_color"
android:visibility="gone"
android:layout_marginRight="8dip"
android:paddingTop="1dip"/>
@@ -120,7 +128,7 @@
android:linksClickable="false"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="left"
android:textColor="#ffcccccc"
android:textColor="?conversation_text_secondary_color"
android:paddingTop="1dip"/>
</LinearLayout>
@@ -128,34 +136,35 @@
<LinearLayout android:id="@+id/indicators_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentRight="true">
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:background="?conversation_background">
<ImageView
android:id="@+id/key_exchange_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_menu_login"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Key Exchange Indicator"/>
<ImageView
android:id="@+id/sms_secure_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_menu_lock_holo_light"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Secure Message Indicator"/>
<ImageView
android:id="@+id/sms_failed_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_list_alert_sms_failed"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Send Failed Indicator"/>
</LinearLayout>
</RelativeLayout>

View File

@@ -7,48 +7,51 @@
android:paddingLeft="10dip"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="?conversation_card_background">
<LinearLayout android:id="@+id/indicators_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true">
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:background="?conversation_background">
<ImageView
android:id="@+id/key_exchange_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_menu_login"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Key Exchange Indicator"/>
<ImageView
android:id="@+id/sms_secure_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_menu_lock_holo_light"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Secure Message Indicator"/>
<ImageView
android:id="@+id/sms_failed_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_list_alert_sms_failed"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Send Failed Indicator"/>
</LinearLayout>
<LinearLayout android:id="@+id/conversation_item_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/indicators_parent"
android:layout_toLeftOf="@+id/contact_photo"
android:background="?conversation_background"
android:paddingRight="10dip"
android:orientation="vertical" >
<TextView android:id="@+id/conversation_item_body"
@@ -58,13 +61,14 @@
android:linksClickable="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:gravity="right"
android:textColor="#ff000000"
android:textColor="?conversation_text_primary_color"
android:textSize="16sp" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mms_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:paddingTop="7dip"
android:paddingBottom="7dip">
@@ -76,7 +80,8 @@
android:scaleType="centerInside"
android:adjustViewBounds="true"
android:background="@android:drawable/picture_frame"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Media Message"/>
<ImageButton
android:id="@+id/play_slideshow_button"
@@ -84,7 +89,8 @@
android:layout_height="wrap_content"
android:src="@drawable/mms_play_btn"
android:layout_gravity="center"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Play Button"/>
</FrameLayout>
@@ -113,16 +119,18 @@
</LinearLayout>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="5dip"
android:gravity="right">
<ImageView android:id="@+id/delivered_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="3dip"
android:src="@drawable/ic_sms_mms_delivered"
android:visibility="gone" />
android:src="?conversation_delivered_indicator"
android:visibility="gone"
android:contentDescription="Delivered Indicator"/>
<TextView android:id="@+id/group_message_status"
android:layout_width="wrap_content"
@@ -130,7 +138,7 @@
android:linksClickable="false"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="right"
android:textColor="#ffcccccc"
android:textColor="?conversation_text_secondary_color"
android:visibility="gone"
android:layout_marginRight="8dip"
android:paddingTop="1dip"/>
@@ -142,7 +150,7 @@
android:linksClickable="false"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_gravity="right"
android:textColor="#ffcccccc"
android:textColor="?conversation_text_secondary_color"
android:paddingTop="1dip"/>
</LinearLayout>
@@ -158,7 +166,6 @@
android:layout_width="60dp"
android:layout_height="60dp"
android:cropToPadding="true"
android:layout_marginLeft="10dip"
android:layout_marginRight="0dip"
android:padding="0dip"
android:scaleType="centerCrop" />

View File

@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.ConversationListItem xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="10dip"
>
<org.thoughtcrime.securesms.ConversationListItem
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<FrameLayout android:id="@+id/contact_photo_frame"
android:layout_width="wrap_content"
@@ -11,6 +10,7 @@
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:visibility="visible">
<QuickContactBadge android:id="@+id/contact_photo_badge"
style="?android:attr/quickContactBadgeStyleWindowLarge"
android:visibility="gone" />
@@ -20,7 +20,8 @@
android:layout_height="60dp"
android:cropToPadding="true"
android:scaleType="centerCrop"
android:visibility="gone" />
android:visibility="gone"
android:contentDescription="Contact Photo Image"/>
</FrameLayout>
<!--<CheckBox android:id="@+id/checkbox"-->
@@ -37,18 +38,19 @@
android:singleLine="true"
android:layout_marginTop="6dip"
android:layout_marginRight="5dip"
android:layout_marginLeft="5dip"
android:layout_marginLeft="10dip"
android:layout_marginBottom="10dip"
android:layout_alignTop="@id/contact_photo_frame"
android:layout_toRightOf="@id/contact_photo_frame"
android:layout_alignWithParentIfMissing="true"
android:ellipsize="marquee"
android:textColor="#000000"/>
android:ellipsize="marquee"/>
<!--android:layout_toLeftOf="@id/checkbox"-->
<TextView android:id="@+id/date"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:paddingRight="10dip"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
@@ -64,7 +66,8 @@
android:layout_alignBottom="@id/date"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_list_alert_sms_failed" />
android:src="@drawable/ic_list_alert_sms_failed"
android:contentDescription="Error Alert"/>
<ImageView android:id="@+id/attachment"
android:layout_marginLeft="3dip"
@@ -73,7 +76,8 @@
android:visibility="gone"
android:layout_toLeftOf="@id/error"
android:layout_alignBottom="@id/date"
android:src="@drawable/ic_attachment_universal_small" />
android:src="@drawable/ic_attachment_universal_small"
android:contentDescription="Attachment Indicator"/>
<TextView android:id="@+id/subject"
android:layout_width="wrap_content"
@@ -81,7 +85,7 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:singleLine="true"
android:layout_marginBottom="10dip"
android:layout_marginLeft="5dip"
android:layout_marginLeft="10dip"
android:layout_alignBottom="@id/contact_photo_frame"
android:layout_toRightOf="@id/contact_photo_frame"
android:layout_toLeftOf="@id/date"

View File

@@ -18,7 +18,7 @@
<TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="@drawable/text_color_black"
android:textColor="@color/black"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_gravity="center_horizontal|center_vertical" />

View File

@@ -8,7 +8,7 @@
android:paddingBottom="5dip"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:background="@drawable/white_background"
android:background="?conversation_background"
android:orientation="vertical" >
<org.thoughtcrime.securesms.contacts.RecipientsEditor android:id="@+id/recipients_text"

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="edit_text_light_theme">#ff000000</color>
<color name="edit_text_dark_theme">#ffeeeeee</color>
</resources>

5
res/values-v8/colors.xml Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="edit_text_light_theme">#ff000000</color>
<color name="edit_text_dark_theme">#ff000000</color>
</resources>

View File

@@ -6,6 +6,16 @@
<item>@string/preferences__hours</item>
</string-array>
<string-array name="pref_theme_entries">
<item>@string/preferences__light_theme</item>
<item>@string/preferences__dark_theme</item>
</string-array>
<string-array name="pref_theme_values" translatable="false">
<item>light</item>
<item>dark</item>
</string-array>
<string-array name="pref_led_color_entries">
<item>@string/preferences__green</item>
<item>@string/preferences__red</item>

19
res/values/attrs.xml Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="conversation_list_item_background_selected" format="reference"/>
<attr name="conversation_list_item_background_read" format="reference"/>
<attr name="conversation_list_item_background_unread" format="reference"/>
<attr name="conversation_list_item_count_color" format="reference|color"/>
<attr name="conversation_background" format="reference|color"/>
<attr name="conversation_card_background" format="reference|color"/>
<attr name="conversation_text_primary_color" format="reference|color"/>
<attr name="conversation_text_secondary_color" format="reference|color"/>
<attr name="conversation_avatar_divet_right" format="reference"/>
<attr name="conversation_avatar_divet_left" format="reference"/>
<attr name="conversation_editor_background" format="reference|color"/>
<attr name="conversation_editor_text_color" format="reference|color"/>
<attr name="conversation_send_button" format="reference"/>
<attr name="conversation_send_secure_button" format="reference"/>
<attr name="conversation_delivered_indicator" format="reference"/>
</resources>

View File

@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="white_background">#ffffffff</drawable>
<drawable name="text_color_black">#ff000000</drawable>
<color name="unread_bgcolor">#ffffffff</color>
<color name="read_bgcolor">#ffeeeeee</color>
<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
<color name="conversation_list_item_background_read_light">#ffeeeeee</color>
<color name="conversation_list_item_background_unread_light">#ffffffff</color>
<color name="conversation_list_item_background_read_dark">#ff000000</color>
<color name="conversation_list_item_background_unread_dark">#ff333333</color>
</resources>

View File

@@ -457,7 +457,8 @@
<string name="preferences__conversation_length_limit">Conversation length limit</string>
<string name="preferences__trim_all_threads_now">Trim all threads now</string>
<string name="preferences__scan_through_all_conversation_threads_and_enforce_conversation_length_limits">Scan through all conversation threads and enforce conversation length limits</string>
<string name="preferences__light_theme">Light Theme</string>
<string name="preferences__dark_theme">Dark Theme</string>
<!-- **************************************** -->
<!-- menus -->
@@ -527,6 +528,8 @@
<!-- verify_keys -->
<string name="verify_keys__menu_verified">Verified</string>
<string name="preferences__appearance">Appearance</string>
<string name="preferences__theme">Theme</string>
<!-- EOF -->
</resources>

41
res/values/themes.xml Normal file
View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TextSecure.LightTheme" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<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_card_background">#ffdddddd</item>
<item name="conversation_background">@color/white</item>
<item name="conversation_text_primary_color">@color/abs__primary_text_holo_light</item>
<item name="conversation_text_secondary_color">#ffcccccc</item>
<item name="conversation_avatar_divet_right">@drawable/divet_right_light</item>
<item name="conversation_avatar_divet_left">@drawable/divet_left_light</item>
<item name="conversation_editor_background">#eeeeee</item>
<item name="conversation_editor_text_color">@color/edit_text_light_theme</item>
<item name="conversation_send_button">@drawable/ic_send_holo_light</item>
<item name="conversation_send_secure_button">@drawable/ic_send_encrypted_holo_light</item>
<item name="conversation_delivered_indicator">@drawable/ic_sms_mms_delivered_light</item>
</style>
<style name="TextSecure.DarkTheme" parent="@style/Theme.Sherlock">
<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_card_background">#ffdddddd</item>
<item name="conversation_background">@color/black</item>
<item name="conversation_text_primary_color">@color/abs__primary_text_holo_dark</item>
<item name="conversation_text_secondary_color">#ffcccccc</item>
<item name="conversation_avatar_divet_right">@drawable/divet_right_dark</item>
<item name="conversation_avatar_divet_left">@drawable/divet_left_dark</item>
<item name="conversation_editor_background">@color/black</item>
<item name="conversation_editor_text_color">@color/edit_text_dark_theme</item>
<item name="conversation_send_button">@drawable/ic_send_holo_dark</item>
<item name="conversation_send_secure_button">@drawable/ic_send_holo_dark_encrypted</item>
<item name="conversation_delivered_indicator">@drawable/ic_sms_mms_delivered_dark</item>
</style>
</resources>

View File

@@ -62,6 +62,15 @@
android:summary="@string/preferences__also_vibrate_when_notified" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/preferences__appearance">
<ListPreference android:key="pref_theme"
android:title="@string/preferences__theme"
android:entries="@array/pref_theme_entries"
android:entryValues="@array/pref_theme_values"
android:defaultValue="light">
</ListPreference>
</PreferenceCategory>
<PreferenceCategory android:title="@string/preferences__storage">
<CheckBoxPreference android:defaultValue="false"
android:key="pref_trim_threads"