Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings UI Improvements #135

Merged
merged 5 commits into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,26 @@

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;

import org.torproject.android.OrbotApp;
import org.torproject.android.R;
import org.torproject.android.service.util.Prefs;
import org.torproject.android.service.util.TorServiceUtils;

import java.util.Locale;


public class SettingsPreferences
extends PreferenceActivity {
public class SettingsPreferences
extends PreferenceActivity {
private static final String TAG = "SettingsPreferences";

private ListPreference prefLocale = null;
private ListPreference prefLocale = null;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

addPreferencesFromResource(R.xml.preferences);
getPreferenceManager().setSharedPreferencesMode(Context.MODE_MULTI_PROCESS);
SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());

prefLocale = (ListPreference) findPreference("pref_default_locale");
Languages languages = Languages.get(this);
Expand All @@ -46,21 +38,17 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
Prefs.setDefaultLocale(language);
LocaleHelper.setLocale(getApplicationContext(), language);
Intent intentResult = new Intent();
intentResult.putExtra("locale",language);
setResult(RESULT_OK,intentResult);
intentResult.putExtra("locale", language);
setResult(RESULT_OK, intentResult);
finish();
return false;
}
});

}


@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(LocaleHelper.onAttach(base));
}



}
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<string name="pref_proxy_title">Outbound Network Proxy (Optional)</string>

<string name="pref_proxy_type_title">Outbound Proxy Type</string>
<string name="pref_proxy_type_summary">Protocol to use for proxy server: HTTP, HTTPS, Socks4, Socks5</string>
<string name="pref_proxy_type_summary">Protocol to use for proxy server: HTTP, HTTPS, SOCKS4, SOCKS5</string>
<string name="pref_proxy_type_dialog">Enter Proxy Type</string>

<string name="pref_proxy_host_title">Outbound Proxy Host</string>
Expand Down Expand Up @@ -206,7 +206,7 @@
<string name="enter_localhost_ports_for_hidden_services">enter localhost ports for hidden services</string>
<string name="hidden_service_ports">Hidden Service Ports</string>
<string name="the_addressable_name_for_your_hidden_service_generated_automatically_">the addressable name for your hidden service (generated automatically)</string>
<string name="enable_debug_log_to_output_must_use_adb_or_alogcat_to_view_">enable debug log to output (must use adb or aLogCat to view)</string>
<string name="enable_debug_log_to_output_must_use_adb_or_alogcat_to_view_">Enable debug log to output (must use adb or aLogcat to view)</string>
<string name="project_home">Project Home(s): </string>
<string name="project_urls">https://www.torproject.org/docs/android\nhttps://guardianproject.info/apps/orbot/</string>
<string name="the_tor_license">The Tor License</string>
Expand Down