Skip to content

Commit

Permalink
Restore settings for thread timming. Dark and light pin theme
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewis13 committed Dec 18, 2017
1 parent 0e82c32 commit 50fb786
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
applicationId 'io.forsta.relay'
minSdkVersion 14
targetSdkVersion 22
versionName "0.1.79"
versionCode 179
versionName "0.1.80"
versionCode 180
multiDexEnabled true
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
resValue "string", "forsta_authorities", applicationId + '.provider.ccsm'
Expand Down
Binary file modified res/drawable-mdpi/ic_forsta_pin_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion res/layout/alert_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
android:id="@+id/pinned_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_forsta_pin_dark"
android:src="?pinned_icon"
android:visibility="gone"
android:layout_gravity="center_vertical"/>

Expand Down
1 change: 1 addition & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

<attr name="dialog_info_icon" format="reference" />
<attr name="dialog_alert_icon" format="reference" />
<attr name="pinned_icon" format="reference" />

<attr name="conversation_icon_attach_audio" format="reference"/>
<attr name="conversation_icon_attach_video" format="reference" />
Expand Down
2 changes: 2 additions & 0 deletions res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@

<item name="dialog_info_icon">@drawable/ic_info_outline_light</item>
<item name="dialog_alert_icon">@drawable/ic_warning_light</item>
<item name="pinned_icon">@drawable/ic_forsta_pin_dark</item>

<item name="device_link_item_card_background">@color/device_link_item_background_light</item>

Expand Down Expand Up @@ -241,6 +242,7 @@

<item name="dialog_info_icon">@drawable/ic_info_outline_dark</item>
<item name="dialog_alert_icon">@drawable/ic_warning_dark</item>
<item name="pinned_icon">@drawable/ic_forsta_pin_light</item>

<item name="device_link_item_card_background">@color/device_link_item_background_dark</item>

Expand Down
32 changes: 16 additions & 16 deletions res/xml/preferences_chats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
android:entryValues="@array/pref_media_download_entries" />
</PreferenceCategory>

<!--<PreferenceCategory android:key="message_trimming" android:title="@string/preferences_chats__message_trimming">-->
<!--<io.forsta.securesms.components.SwitchPreferenceCompat-->
<!--android:defaultValue="true"-->
<!--android:key="pref_trim_threads"-->
<!--android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_exceeds_a_specified_length"-->
<!--android:title="@string/preferences__delete_old_messages" android:enabled="false"/>-->
<PreferenceCategory android:key="message_trimming" android:title="@string/preferences_chats__message_trimming">
<io.forsta.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
android:key="pref_trim_threads"
android:summary="@string/preferences__automatically_delete_older_messages_once_a_conversation_exceeds_a_specified_length"
android:title="@string/preferences__delete_old_messages"/>

<!--<EditTextPreference android:defaultValue="5000"-->
<!--android:key="pref_trim_length"-->
<!--android:title="@string/preferences__conversation_length_limit"-->
<!--android:inputType="number"-->
<!--android:dependency="pref_trim_threads" />-->
<EditTextPreference android:defaultValue="5000"
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_conversations_now"-->
<!--android:summary="@string/preferences__scan_through_all_conversations_and_enforce_conversation_length_limits"-->
<!--android:dependency="pref_trim_threads" />-->
<!--</PreferenceCategory>-->
<Preference android:key="pref_trim_now"
android:title="@string/preferences__trim_all_conversations_now"
android:summary="@string/preferences__scan_through_all_conversations_and_enforce_conversation_length_limits"
android:dependency="pref_trim_threads" />
</PreferenceCategory>
</PreferenceScreen>
5 changes: 0 additions & 5 deletions src/io/forsta/securesms/ConversationListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ protected void onCreate(Bundle savedState, @NonNull MasterSecret masterSecret) {
RefreshUserOrg task = new RefreshUserOrg();
task.execute();

// Force set enable thread trimming to 30 days.
if (!TextSecurePreferences.isThreadLengthTrimmingEnabled(getApplicationContext())) {
TextSecurePreferences.setThreadTrimEnabled(getApplicationContext(), true);
}

if (ForstaPreferences.getForstaContactSync(this) == -1) {
syncIndicator.setVisibility(View.VISIBLE);
Account account = ForstaSyncAdapter.getAccount(getApplicationContext());
Expand Down
10 changes: 4 additions & 6 deletions src/io/forsta/securesms/preferences/ChatsPreferenceFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ public void onCreate(Bundle paramBundle) {
.setOnPreferenceChangeListener(new MediaDownloadChangeListener());
findPreference(TextSecurePreferences.MEDIA_DOWNLOAD_ROAMING_PREF)
.setOnPreferenceChangeListener(new MediaDownloadChangeListener());

// findPreference(TextSecurePreferences.THREAD_TRIM_NOW)
// .setOnPreferenceClickListener(new TrimNowClickListener());
// findPreference(TextSecurePreferences.THREAD_TRIM_LENGTH)
// .setOnPreferenceChangeListener(new TrimLengthValidationListener());

findPreference(TextSecurePreferences.THREAD_TRIM_NOW)
.setOnPreferenceClickListener(new TrimNowClickListener());
findPreference(TextSecurePreferences.THREAD_TRIM_LENGTH)
.setOnPreferenceChangeListener(new TrimLengthValidationListener());
}

@Override
Expand Down

0 comments on commit 50fb786

Please sign in to comment.