Media download controls

Closes #3991
// FREEBIE
This commit is contained in:
Jake McGinty
2015-08-24 15:24:31 -07:00
committed by Moxie Marlinspike
parent 7e2c9f97e9
commit 80ce83ef9d
54 changed files with 606 additions and 204 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

View File

@@ -20,4 +20,12 @@
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:layout="@layout/thumbnail_view_remove_button" />
<ImageButton android:id="@+id/download_button"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:background="@drawable/progress_background"
android:src="@drawable/ic_file_download_white_36dp"
android:visibility="gone" />
</merge>

View File

@@ -193,4 +193,29 @@
<item>contact</item>
<item>none</item>
</string-array>
<!-- discrete MIME type (the part before the "/") -->
<string-array name="pref_media_download_entries">
<item>image</item>
<item>audio</item>
<item>video</item>
</string-array>
<string-array name="pref_media_download_values">
<item>@string/arrays__images</item>
<item>@string/arrays__audio</item>
<item>@string/arrays__video</item>
</string-array>
<string-array name="pref_media_download_mobile_data_default">
<item>image</item>
</string-array>
<string-array name="pref_media_download_wifi_default">
<item>image</item>
<item>audio</item>
<item>video</item>
</string-array>
<string-array name="pref_media_download_roaming_default" />
</resources>

View File

@@ -106,6 +106,7 @@
<attr name="pref_ic_app_protection" format="reference" />
<attr name="pref_ic_appearance" format="reference" />
<attr name="pref_ic_storage" format="reference" />
<attr name="pref_ic_chats" format="reference" />
<attr name="pref_ic_devices" format="reference" />
<attr name="pref_ic_advanced" format="reference" />

View File

@@ -762,6 +762,10 @@
<string name="arrays__name_only">Name only</string>
<string name="arrays__neither">Neither</string>
<string name="arrays__images">Images</string>
<string name="arrays__audio">Audio</string>
<string name="arrays__video">Video</string>
<!-- plurals.xml -->
<plurals name="hours_ago">
<item quantity="one">%d hour</item>
@@ -847,6 +851,7 @@
<string name="preferences__request_a_delivery_report_for_each_sms_message_you_send">Request a delivery report for each SMS message you send</string>
<string name="preferences__automatically_delete_older_messages_once_a_conversation_thread_exceeds_a_specified_length">Automatically delete older messages once a conversation thread exceeds a specified length</string>
<string name="preferences__delete_old_messages">Delete old messages</string>
<string name="preferences__chats">Chats and media</string>
<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>

View File

@@ -169,11 +169,11 @@
<item name="reminder_header_background">#ff1d85d7</item>
<item name="pref_ic_sms_mms">@drawable/ic_message_black</item>
<item name="pref_ic_sms_mms">@drawable/ic_textsms_black_32dp</item>
<item name="pref_ic_notifications">@drawable/ic_notifications_black</item>
<item name="pref_ic_app_protection">@drawable/ic_app_protection_black</item>
<item name="pref_ic_appearance">@drawable/ic_brightness_6_black</item>
<item name="pref_ic_storage">@drawable/ic_delete_black</item>
<item name="pref_ic_chats">@drawable/ic_forum_black_32dp</item>
<item name="pref_ic_devices">@drawable/ic_devices_black_48dp</item>
<item name="pref_ic_advanced">@drawable/ic_advanced_black</item>
@@ -281,11 +281,11 @@
<item name="reminder_header_background">@color/textsecure_primary_dark</item>
<item name="pref_ic_sms_mms">@drawable/ic_message_gray</item>
<item name="pref_ic_sms_mms">@drawable/ic_textsms_grey_32dp</item>
<item name="pref_ic_notifications">@drawable/ic_notifications_gray</item>
<item name="pref_ic_app_protection">@drawable/ic_app_protection_gray</item>
<item name="pref_ic_appearance">@drawable/ic_brightness_6_gray</item>
<item name="pref_ic_storage">@drawable/ic_delete_gray</item>
<item name="pref_ic_chats">@drawable/ic_forum_grey_32dp</item>
<item name="pref_ic_devices">@drawable/ic_devices_grey600_48dp</item>
<item name="pref_ic_advanced">@drawable/ic_advanced_gray</item>

View File

@@ -17,9 +17,9 @@
android:title="@string/preferences__appearance"
android:icon="?pref_ic_appearance"/>
<Preference android:key="preference_category_storage"
android:title="@string/preferences__delete_old_messages"
android:icon="?pref_ic_storage"/>
<Preference android:key="preference_category_chats"
android:title="@string/preferences__chats"
android:icon="?pref_ic_chats"/>
<!--<Preference android:key="preference_category_devices"-->
<!--android:title="Devices"-->

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:key="media_download" android:title="Media auto-download">
<com.h6ah4i.android.compat.preference.MultiSelectListPreferenceCompat
android:title="When using mobile data"
android:key="pref_media_download_mobile"
android:defaultValue="@array/pref_media_download_mobile_data_default"
android:persistent="true"
android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" />
<com.h6ah4i.android.compat.preference.MultiSelectListPreferenceCompat
android:title="When using Wi-Fi"
android:key="pref_media_download_wifi"
android:defaultValue="@array/pref_media_download_wifi_default"
android:persistent="true"
android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" />
<com.h6ah4i.android.compat.preference.MultiSelectListPreferenceCompat
android:title="When roaming"
android:key="pref_media_download_roaming"
android:defaultValue="@array/pref_media_download_roaming_default"
android:persistent="true"
android:entries="@array/pref_media_download_values"
android:entryValues="@array/pref_media_download_entries" />
</PreferenceCategory>
<PreferenceCategory android:key="message_trimming" android:title="Message trimming">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_trim_threads"
android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_thread_exceeds_a_specified_length"
android:title="@string/preferences__delete_old_messages" />
<EditTextPreference android:defaultValue="500"
android:key="pref_trim_length"
android:title="@string/preferences__conversation_length_limit"
android:inputType="number"
android:dependency="pref_trim_threads" />
<Preference android:key="pref_trim_now"
android:title="@string/preferences__trim_all_threads_now"
android:summary="@string/preferences__scan_through_all_conversation_threads_and_enforce_conversation_length_limits"
android:dependency="pref_trim_threads" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_trim_threads"
android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_thread_exceeds_a_specified_length"
android:title="@string/preferences__delete_old_messages" />
<EditTextPreference android:defaultValue="500"
android:key="pref_trim_length"
android:title="@string/preferences__conversation_length_limit"
android:inputType="number"
android:dependency="pref_trim_threads" />
<Preference android:key="pref_trim_now"
android:title="@string/preferences__trim_all_threads_now"
android:summary="@string/preferences__scan_through_all_conversation_threads_and_enforce_conversation_length_limits"
android:dependency="pref_trim_threads" />
</PreferenceScreen>