2525import android .os .Bundle ;
2626import android .preference .EditTextPreference ;
2727import android .preference .Preference ;
28- import android .preference .PreferenceScreen ;
2928import android .preference .PreferenceManager ;
29+ import android .preference .PreferenceScreen ;
3030import android .provider .ContactsContract ;
3131import android .util .Log ;
3232import android .widget .Toast ;
3333
34+ import com .actionbarsherlock .view .MenuItem ;
3435import org .thoughtcrime .securesms .contacts .ContactAccessor ;
3536import org .thoughtcrime .securesms .contacts .ContactIdentityManager ;
36- import org .thoughtcrime .securesms .crypto .IdentityKey ;
3737import org .thoughtcrime .securesms .crypto .IdentityKeyUtil ;
3838import org .thoughtcrime .securesms .crypto .MasterSecret ;
3939import org .thoughtcrime .securesms .crypto .MasterSecretUtil ;
40- import org .thoughtcrime .securesms .util .Dialogs ;
40+ import org .thoughtcrime .securesms .util .DynamicLanguage ;
4141import org .thoughtcrime .securesms .util .DynamicTheme ;
4242import org .thoughtcrime .securesms .util .MemoryCleaner ;
4343import org .thoughtcrime .securesms .util .Trimmer ;
44- import org .thoughtcrime .securesms .util .Util ;
45-
46- import com .actionbarsherlock .view .MenuItem ;
47-
48- import java .util .List ;
4944
5045/**
5146 * The Activity for application preference display and management.
@@ -72,6 +67,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
7267 public static final String PASSPHRASE_TIMEOUT_PREF = "pref_timeout_passphrase" ;
7368 public static final String AUTO_KEY_EXCHANGE_PREF = "pref_auto_complete_key_exchange" ;
7469 public static final String THEME_PREF = "pref_theme" ;
70+ public static final String LANGUAGE_PREF = "pref_language" ;
7571 public static final String ENTER_SENDS_PREF = "pref_enter_sends" ;
7672 public static final String ENTER_PRESENT_PREF = "pref_enter_key" ;
7773
@@ -98,11 +94,13 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
9894 public static final String REGISTERED_GCM_PREF = "pref_gcm_registered" ;
9995 public static final String GCM_PASSWORD_PREF = "pref_gcm_password" ;
10096
101- private final DynamicTheme dynamicTheme = new DynamicTheme ();
97+ private final DynamicTheme dynamicTheme = new DynamicTheme ();
98+ private final DynamicLanguage dynamicLanguage = new DynamicLanguage ();
10299
103100 @ Override
104101 protected void onCreate (Bundle icicle ) {
105102 dynamicTheme .onCreate (this );
103+ dynamicLanguage .onCreate (this );
106104 super .onCreate (icicle );
107105
108106 this .getSupportActionBar ().setDisplayHomeAsUpEnabled (true );
@@ -134,6 +132,7 @@ public void onStart() {
134132 public void onResume () {
135133 super .onResume ();
136134 dynamicTheme .onResume (this );
135+ dynamicLanguage .onResume (this );
137136 }
138137
139138 @ Override
@@ -233,6 +232,8 @@ private void handleIdentitySelection(Intent data) {
233232 public void onSharedPreferenceChanged (SharedPreferences sharedPreferences , String key ) {
234233 if (key .equals (THEME_PREF )) {
235234 dynamicTheme .onResume (this );
235+ } else if (key .equals (LANGUAGE_PREF )) {
236+ dynamicLanguage .onResume (this );
236237 }
237238 }
238239
0 commit comments