Update to V7 PreferencesCompat library

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-09-20 18:10:44 -07:00
parent cb9bc9659b
commit a1c276f70b
35 changed files with 1788 additions and 657 deletions

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" />

10
res/drawable/ic_add.xml Normal file
View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?colorAccent"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
</vector>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2016 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:scaleType="centerCrop"
app:srcCompat="@drawable/ic_add" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/add_ringtone_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="20dp"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:maxLines="3"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingEnd="?dialogPreferredPadding"
android:paddingRight="?dialogPreferredPadding"
android:text="@string/RingtonePreference_add_ringtone_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?colorAccent" />
</LinearLayout>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/color_picker_widget"
android:layout_width="24dp"
android:layout_height="24dp"
android:clickable="false"
android:focusable="false" />

View File

@@ -133,14 +133,12 @@
<item>@string/preferences__fast</item>
<item>@string/preferences__normal</item>
<item>@string/preferences__slow</item>
<item>@string/preferences__custom</item>
</string-array>
<string-array name="pref_led_blink_pattern_values" translatable="false">
<item>300,300</item>
<item>500,2000</item>
<item>3000,3000</item>
<item>custom</item>
</string-array>
<string-array name="pref_repeat_alerts_entries">

View File

@@ -199,4 +199,26 @@
<attr name="scaleEmojis" format="boolean" />
</declare-styleable>
<declare-styleable name="RingtonePreference">
<attr name="showAdd" format="boolean" />
<attr name="summaryHasRingtone" format="string|reference" />
</declare-styleable>
<declare-styleable name="ColorPickerPreference">
<attr name="currentColor" format="reference" />
<attr name="colors" format="reference" />
<attr name="sortColors" format="boolean|reference" />
<attr name="colorDescriptions" format="reference" />
<attr name="columns" format="integer|reference" />
<attr name="colorSize" format="enum|reference">
<enum name="large" value="1" />
<enum name="small" value="2" />
</attr>
</declare-styleable>
</resources>

View File

@@ -1460,6 +1460,14 @@
<string name="preferences__read_receipts">Read receipts</string>
<string name="preferences__if_read_receipts_are_disabled_you_wont_be_able_to_see_read_receipts">If you read receipts are disabled, you won\'t be able to see read receipts from others.</string>
<string name="RingtonePreference_ringtone_default">Default ringtone</string>
<string name="RingtonePreference_ringtone_silent">None</string>
<string name="RingtonePreference_ringtone_picker_title">Ringtones</string>
<string name="RingtonePreference_notification_sound_default">Default notification sound</string>
<string name="RingtonePreference_alarm_sound_default">Default alarm sound</string>
<string name="RingtonePreference_add_ringtone_text">Add ringtone</string>
<string name="RingtonePreference_unable_to_add_ringtone">Unable to add custom ringtone</string>
<!-- EOF -->

View File

@@ -256,4 +256,7 @@
<item name="android:focusable">false</item>
</style>
<style name="PreferenceThemeOverlay.Fix" parent="PreferenceThemeOverlay.v14.Material">
</style>
</resources>

View File

@@ -18,6 +18,8 @@
<item name="contact_selection_lay_user">#a0000000</item>
<item name="contact_selection_header_text">@color/textsecure_primary_dark</item>
<item name="dialog_background_color">@color/background_material_light</item>
<item name="pref_divider">@drawable/preference_divider_light</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
</style>
<style name="TextSecure.DarkNoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
@@ -34,6 +36,8 @@
<item name="contact_selection_lay_user">#afeeeeee</item>
<item name="contact_selection_header_text">#66eeeeee</item>
<item name="dialog_background_color">@color/background_material_dark</item>
<item name="pref_divider">@drawable/preference_divider_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
</style>
<style name="TextSecure.HighlightTheme" parent="@style/TextSecure.LightTheme">
@@ -212,6 +216,7 @@
<item name="app_protect_timeout_picker_color">@style/BetterPickersDialogFragment.Light</item>
<item name="group_members_dialog_icon">@drawable/ic_group_grey600_24dp</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
</style>
<style name="TextSecure.DarkTheme" parent="@style/Theme.AppCompat">
@@ -335,5 +340,6 @@
<item name="app_protect_timeout_picker_color">@style/BetterPickersDialogFragment</item>
<item name="group_members_dialog_icon">@drawable/ic_group_white_24dp</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
</style>
</resources>

View File

@@ -30,7 +30,7 @@
android:entries="@array/pref_led_color_entries"
android:entryValues="@array/pref_led_color_values" />
<org.thoughtcrime.securesms.preferences.LedBlinkPatternListPreference
<org.thoughtcrime.securesms.preferences.SignalListPreference
android:key="pref_led_blink"
android:defaultValue="500,2000"
android:title="@string/preferences__pref_led_blink_title"