From 815613cfaabdc456b86eb6fdccfcb61273d523f6 Mon Sep 17 00:00:00 2001 From: Lilia Markham Date: Thu, 28 Mar 2013 05:45:07 -0700 Subject: [PATCH] Reorganize settings menu Mostly xml work, with one small hack to fix the sub menu themes, found here: http://code.google.com/p/android/issues/detail?id=4611#c35 --- res/values/strings.xml | 6 +- res/xml/preferences.xml | 195 +++++++++--------- .../ApplicationPreferencesActivity.java | 14 ++ 3 files changed, 113 insertions(+), 102 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 08564888c8..31f3b4e0bf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -381,7 +381,7 @@ Select Passphrase Timeout Timeout interval The amount of time to wait before forgetting passphrase from memory - Identity Key Settings + Identity Keys View my identity key Export my identity key Import Contact\'s Key @@ -412,7 +412,9 @@ Normal Slow Custom - Advanced: MMS Access Point Names + Advanced + Passphrase + Fallback MMSC Enable Fallback MMSC Use MMSC information configured here when system APN information is unavailable. MMSC URL (Required) diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index c4d0f14a77..da13807fab 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -1,7 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java index 57469795a9..793c7a7aff 100644 --- a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java +++ b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java @@ -25,6 +25,7 @@ import android.net.Uri; import android.os.Bundle; import android.preference.EditTextPreference; import android.preference.Preference; +import android.preference.PreferenceScreen; import android.preference.PreferenceManager; import android.provider.ContactsContract; import android.util.Log; @@ -383,4 +384,17 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr } } + + /* http://code.google.com/p/android/issues/detail?id=4611#c35 */ + @SuppressWarnings("deprecation") + @Override + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) + { + super.onPreferenceTreeClick(preferenceScreen, preference); + if (preference!=null) + if (preference instanceof PreferenceScreen) + if (((PreferenceScreen)preference).getDialog()!=null) + ((PreferenceScreen)preference).getDialog().getWindow().getDecorView().setBackgroundDrawable(this.getWindow().getDecorView().getBackground().getConstantState().newDrawable()); + return false; + } }