1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-25 22:02:08 +01:00

Merge preferences from AppSettings and SettingsActivy/preferences.xml

This commit is contained in:
Gregor Santner 2016-08-02 21:32:42 +02:00
parent 3c6558df9c
commit ad2cb4c615
10 changed files with 226 additions and 190 deletions

View file

@ -39,7 +39,7 @@
android:name=".activity.SettingsActivity" android:name=".activity.SettingsActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:label="@string/pref_title_personal_settings"> android:label="@string/pref_title__personal_settings">
</activity> </activity>
<activity <activity

View file

@ -538,10 +538,10 @@ public class MainActivity extends AppCompatActivity
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
String url = intent.getStringExtra(EXTRA_URL); String url = intent.getStringExtra(EXTRA_URL);
Log.d(App.TAG, "BroadcastReceiver: Received setTitleIntent: "+url); // Log.d(App.TAG, "BroadcastReceiver: Received setTitleIntent: "+url);
if (url != null && url.startsWith("https://" + podDomain)) { if (url != null && url.startsWith("https://" + podDomain)) {
String subUrl = url.substring(("https://" + podDomain).length()); String subUrl = url.substring(("https://" + podDomain).length());
Log.d(App.TAG, "LocalBroadcastReceiver: SubUrl: "+subUrl); //Log.d(App.TAG, "LocalBroadcastReceiver: SubUrl: "+subUrl); // Spams!
if (subUrl.startsWith("/stream")) { if (subUrl.startsWith("/stream")) {
setTitle(R.string.title_stream); setTitle(R.string.title_stream);
} else if (subUrl.startsWith("/posts/")) { } else if (subUrl.startsWith("/posts/")) {

View file

@ -31,7 +31,6 @@ import android.preference.PreferenceScreen;
import com.github.dfa.diaspora_android.App; import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.data.AppSettings;
/** /**
* @author vanitas * @author vanitas
@ -48,12 +47,14 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
sharedPreferences = getPreferenceScreen().getSharedPreferences(); sharedPreferences = getPreferenceScreen().getSharedPreferences();
sharedPreferences.registerOnSharedPreferenceChangeListener(this); sharedPreferences.registerOnSharedPreferenceChangeListener(this);
setPreferenceSummaries(); setPreferenceSummaries();
sharedPreferences.edit().putBoolean(AppSettings.PREF.PROXY_WAS_ENABLED, sharedPreferences.edit().putBoolean(getString(R.string.pref_key__proxy_was_enabled),
sharedPreferences.getBoolean(AppSettings.PREF.PROXY_ENABLED, false)).apply(); sharedPreferences.getBoolean(getString(R.string.pref_key__proxy_enabled), false)).apply();
} }
private void setPreferenceSummaries() { private void setPreferenceSummaries() {
String[] editTextKeys = new String[]{AppSettings.PREF.PROXY_HOST, AppSettings.PREF.PROXY_PORT}; String[] editTextKeys = new String[]{
getString(R.string.pref_key__proxy_host), getString(R.string.pref_key__proxy_port)
};
for (String key : editTextKeys) { for (String key : editTextKeys) {
EditTextPreference p = (EditTextPreference) findPreference(key); EditTextPreference p = (EditTextPreference) findPreference(key);
p.setSummary(p.getText()); p.setSummary(p.getText());
@ -66,7 +67,9 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
} }
private void updatePreference(Preference preference, String key) { private void updatePreference(Preference preference, String key) {
if (preference == null) return; if (preference == null) {
return;
}
if (preference instanceof EditTextPreference) { if (preference instanceof EditTextPreference) {
EditTextPreference textPref = (EditTextPreference) preference; EditTextPreference textPref = (EditTextPreference) preference;
textPref.setSummary(textPref.getText()); textPref.setSummary(textPref.getText());
@ -83,23 +86,27 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) { public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) {
Intent intent = new Intent(this, MainActivity.class); Intent intent = new Intent(this, MainActivity.class);
String podDomain = ((App) getApplication()).getSettings().getPodDomain(); String podDomain = ((App) getApplication()).getSettings().getPodDomain();
switch(preference.getKey()) {
case "pref_key_personal_settings": switch (preference.getTitleRes()) {
case R.string.pref_title__personal_settings: {
intent.setAction(MainActivity.ACTION_OPEN_URL); intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/user/edit"); intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/user/edit");
break; break;
case "pref_key_manage_tags": }
case R.string.pref_title__manage_tags: {
intent.setAction(MainActivity.ACTION_OPEN_URL); intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/tag_followings/manage"); intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/tag_followings/manage");
break; break;
case "pref_key_manage_contacts": }
case R.string.pref_title__manage_contacts: {
intent.setAction(MainActivity.ACTION_OPEN_URL); intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/contacts"); intent.putExtra(MainActivity.URL_MESSAGE, "https://" + podDomain + "/contacts");
break; break;
case "pref_key_change_account": }
case R.string.pref_title__change_account: {
new AlertDialog.Builder(SettingsActivity.this) new AlertDialog.Builder(SettingsActivity.this)
.setTitle(getString(R.string.confirmation)) .setTitle(getString(R.string.confirmation))
.setMessage(getString(R.string.pref_warning_change_account)) .setMessage(getString(R.string.pref_warning__change_account))
.setNegativeButton(android.R.string.no, null) .setNegativeButton(android.R.string.no, null)
.setPositiveButton(android.R.string.yes, .setPositiveButton(android.R.string.yes,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@ -112,13 +119,16 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
}) })
.show(); .show();
return true; return true;
case "pref_key_clear_cache": }
case R.string.pref_title__clear_cache: {
intent.setAction(MainActivity.ACTION_CLEAR_CACHE); intent.setAction(MainActivity.ACTION_CLEAR_CACHE);
break; break;
default: }
default: {
intent = null; intent = null;
break; break;
} }
}
if (intent != null) { if (intent != null) {
startActivity(intent); startActivity(intent);
finish(); finish();

View file

@ -22,6 +22,8 @@ import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import com.github.dfa.diaspora_android.R;
/** /**
* Created by gsantner (https://gsantner.github.io/) on 20.03.16. Part of Diaspora for Android. * Created by gsantner (https://gsantner.github.io/) on 20.03.16. Part of Diaspora for Android.
*/ */
@ -48,53 +50,41 @@ public class AppSettings {
prefApp.edit().clear().apply(); prefApp.edit().clear().apply();
} }
private void setString(SharedPreferences pref, String key, String value) { private void setString(SharedPreferences pref, int keyRessourceId, String value) {
pref.edit().putString(key, value).apply(); pref.edit().putString(context.getString(keyRessourceId), value).apply();
} }
private void setInt(SharedPreferences pref, String key, int value) { private void setInt(SharedPreferences pref, int keyRessourceId, int value) {
pref.edit().putInt(key, value).apply(); pref.edit().putInt(context.getString(keyRessourceId), value).apply();
} }
private void setBool(SharedPreferences pref, String key, boolean value) { private void setBool(SharedPreferences pref, int keyRessourceId, boolean value) {
pref.edit().putBoolean(key, value).apply(); pref.edit().putBoolean(context.getString(keyRessourceId), value).apply();
} }
private void setStringArray(SharedPreferences pref, String key, Object[] values) { private void setStringArray(SharedPreferences pref, int keyRessourceId, Object[] values) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (Object value : values) { for (Object value : values) {
sb.append("%%%"); sb.append("%%%");
sb.append(value.toString()); sb.append(value.toString());
} }
setString(pref, key, sb.toString().replaceFirst("%%%", "")); setString(pref, keyRessourceId, sb.toString().replaceFirst("%%%", ""));
} }
private String[] getStringArray(SharedPreferences pref, String key) { private String[] getStringArray(SharedPreferences pref, int keyRessourceId) {
String value = pref.getString(key, "%%%"); String value = pref.getString(context.getString(keyRessourceId), "%%%");
if (value.equals("%%%")) { if (value.equals("%%%")) {
return new String[0]; return new String[0];
} }
return value.split("%%%"); return value.split("%%%");
} }
/* private String getString(SharedPreferences pref, int ressourceId, String defaultValue) {
// Preferences return pref.getString(context.getString(ressourceId), defaultValue);
*/ }
public static class PREF {
public static final String PREVIOUS_PODLIST = "previousPodlist"; private boolean getBoolean(SharedPreferences pref, int ressourceId, boolean defaultValue) {
public static final String IS_LOAD_IMAGES = "pref_key_load_images"; return pref.getBoolean(context.getString(ressourceId), defaultValue);
public static final String MINIMUM_FONT_SIZE = "pref_key_font_size";
public static final String PODUSERPROFILE_AVATAR_URL = "podUserProfile_avatar";
public static final String PODUSERPROFILE_NAME = "podUserProfile_name";
public static final String PODUSERPROFILE_ID = "podUserProfile_guid";
public static final String PODDOMAIN = "podDomain";
public static final String PODUSERPROFILE_ASPECTS = "podUserProfile_aspects";
public static final String PODUSERPROFILE_FOLLOWED_TAGS = "podUserProfile_followedTags";
public static final String PROXY_ENABLED = "pref_key_proxy_enabled";
public static final String PROXY_WAS_ENABLED = "wasProxyEnabled";
public static final String PROXY_HOST = "pref_key_proxy_host";
public static final String PROXY_PORT = "pref_key_proxy_port";
public static final String UI_INTELLIHIDE_TOOLBARS ="pref_key_intellihide_toolbars";
} }
@ -102,19 +92,19 @@ public class AppSettings {
// Setters & Getters // Setters & Getters
*/ */
public String getProfileId() { public String getProfileId() {
return prefPod.getString(PREF.PODUSERPROFILE_ID, ""); return getString(prefPod, R.string.pref_key__podprofile_id, "");
} }
public void setProfileId(String profileId) { public void setProfileId(String profileId) {
setString(prefPod, PREF.PODUSERPROFILE_ID, profileId); setString(prefPod, R.string.pref_key__podprofile_id, profileId);
} }
public boolean isLoadImages() { public boolean isLoadImages() {
return prefApp.getBoolean(PREF.IS_LOAD_IMAGES, true); return getBoolean(prefApp, R.string.pref_key__load_images, true);
} }
public int getMinimumFontSize() { public int getMinimumFontSize() {
switch (prefApp.getString(PREF.MINIMUM_FONT_SIZE, "")) { switch (getString(prefApp, R.string.pref_key__font_size, "")) {
case "huge": case "huge":
return 20; return 20;
case "large": case "large":
@ -122,53 +112,53 @@ public class AppSettings {
case "normal": case "normal":
return 8; return 8;
default: default:
prefApp.edit().putString(PREF.MINIMUM_FONT_SIZE, "normal").apply(); setString(prefApp, R.string.pref_key__font_size, "normal");
return 8; return 8;
} }
} }
public String getAvatarUrl() { public String getAvatarUrl() {
return prefPod.getString(PREF.PODUSERPROFILE_AVATAR_URL, ""); return getString(prefPod, R.string.pref_key__podprofile_avatar_url, "");
} }
public void setAvatarUrl(String avatarUrl) { public void setAvatarUrl(String avatarUrl) {
setString(prefPod, PREF.PODUSERPROFILE_AVATAR_URL, avatarUrl); setString(prefPod, R.string.pref_key__podprofile_avatar_url, avatarUrl);
} }
public String getName() { public String getName() {
return prefPod.getString(PREF.PODUSERPROFILE_NAME, ""); return getString(prefPod, R.string.pref_key__podprofile_name, "");
} }
public void setName(String name) { public void setName(String name) {
setString(prefPod, PREF.PODUSERPROFILE_NAME, name); setString(prefPod, R.string.pref_key__podprofile_name, name);
} }
public String getPodDomain() { public String getPodDomain() {
return prefPod.getString(PREF.PODDOMAIN, ""); return getString(prefPod, R.string.pref_key__poddomain, "");
} }
public void setPodDomain(String podDomain) { public void setPodDomain(String podDomain) {
setString(prefPod, PREF.PODDOMAIN, podDomain); setString(prefPod, R.string.pref_key__poddomain, podDomain);
} }
public boolean hasPodDomain() { public boolean hasPodDomain() {
return !prefPod.getString(PREF.PODDOMAIN, "").equals(""); return !getString(prefPod, R.string.pref_key__poddomain, "").equals("");
} }
public String[] getPreviousPodlist() { public String[] getPreviousPodlist() {
return getStringArray(prefApp, PREF.PREVIOUS_PODLIST); return getStringArray(prefApp, R.string.pref_key__previous_podlist);
} }
public void setPreviousPodlist(String[] pods) { public void setPreviousPodlist(String[] pods) {
setStringArray(prefApp, PREF.PREVIOUS_PODLIST, pods); setStringArray(prefApp, R.string.pref_key__previous_podlist, pods);
} }
public void setPodAspects(PodAspect[] aspects) { public void setPodAspects(PodAspect[] aspects) {
setStringArray(prefPod, PREF.PODUSERPROFILE_ASPECTS, aspects); setStringArray(prefPod, R.string.pref_key__podprofile_aspects, aspects);
} }
public PodAspect[] getPodAspects() { public PodAspect[] getPodAspects() {
String[] s= getStringArray(prefPod, PREF.PODUSERPROFILE_ASPECTS); String[] s = getStringArray(prefPod, R.string.pref_key__podprofile_aspects);
PodAspect[] aspects = new PodAspect[s.length]; PodAspect[] aspects = new PodAspect[s.length];
for (int i = 0; i < aspects.length; i++) { for (int i = 0; i < aspects.length; i++) {
aspects[i] = new PodAspect(s[i]); aspects[i] = new PodAspect(s[i]);
@ -177,63 +167,67 @@ public class AppSettings {
} }
public String[] getFollowedTags() { public String[] getFollowedTags() {
return getStringArray(prefPod, PREF.PODUSERPROFILE_FOLLOWED_TAGS); return getStringArray(prefPod, R.string.pref_key__podprofile_followed_tags);
} }
public void setFollowedTags(String[] tags) { public void setFollowedTags(String[] tags) {
setStringArray(prefPod, PREF.PODUSERPROFILE_FOLLOWED_TAGS, tags); setStringArray(prefPod, R.string.pref_key__podprofile_followed_tags, tags);
} }
@SuppressLint("CommitPrefEdits") @SuppressLint("CommitPrefEdits")
public void setProxyEnabled(boolean enabled) { public void setProxyEnabled(boolean enabled) {
//commit instead of apply because the app is likely to be killed before apply is called. //commit instead of apply because the app is likely to be killed before apply is called.
prefApp.edit().putBoolean(PREF.PROXY_ENABLED, enabled).commit(); prefApp.edit().putBoolean(context.getString(R.string.pref_key__proxy_enabled), enabled).commit();
} }
/** /**
* Default return value: false * Default return value: false
*
* @return whether proxy is enabled or not * @return whether proxy is enabled or not
*/ */
public boolean isProxyEnabled() { public boolean isProxyEnabled() {
return prefApp.getBoolean(PREF.PROXY_ENABLED, false); return getBoolean(prefApp, R.string.pref_key__proxy_enabled, false);
} }
public boolean wasProxyEnabled() { public boolean wasProxyEnabled() {
return prefApp.getBoolean(PREF.PROXY_WAS_ENABLED, false); return getBoolean(prefApp, R.string.pref_key__proxy_was_enabled, false);
} }
/** /**
* Needed in order to determine, whether the proxy has just been disabled (trigger app restart) * Needed in order to determine, whether the proxy has just been disabled (trigger app restart)
* or if proxy was disabled before (do not restart app) * or if proxy was disabled before (do not restart app)
*
* @param b new value * @param b new value
*/ */
@SuppressLint("CommitPrefEdits") @SuppressLint("CommitPrefEdits")
public void setProxyWasEnabled(boolean b) { public void setProxyWasEnabled(boolean b) {
prefApp.edit().putBoolean(PREF.PROXY_WAS_ENABLED, b).commit(); prefApp.edit().putBoolean(context.getString(R.string.pref_key__proxy_was_enabled), b).commit();
} }
/** /**
* Default value: "" * Default value: ""
*
* @return proxy host * @return proxy host
*/ */
public String getProxyHost() { public String getProxyHost() {
return prefApp.getString(PREF.PROXY_HOST, ""); return getString(prefApp, R.string.pref_key__proxy_host, "");
} }
/** /**
* Default value: 0 * Default value: 0
*
* @return proxy port * @return proxy port
*/ */
public int getProxyPort() { public int getProxyPort() {
try { try {
return Integer.parseInt(prefApp.getString(PREF.PROXY_PORT, "0")); return Integer.parseInt(getString(prefApp, R.string.pref_key__proxy_port, "0"));
} catch (Exception e) { } catch (Exception e) {
prefApp.edit().putString(PREF.PROXY_PORT, "0").apply(); setString(prefApp, R.string.pref_key__proxy_port, "0");
return 0; return 0;
} }
} }
public boolean isIntellihideToolbars() { public boolean isIntellihideToolbars() {
return prefApp.getBoolean(PREF.UI_INTELLIHIDE_TOOLBARS, true); return getBoolean(prefApp, R.string.pref_key__intellihide_toolbars, true);
} }
} }

View file

@ -1,41 +1,47 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Categories --> <!-- Categories -->
<string name="pref_category_visuals">Erscheinungsbild</string> <string name="pref_cat__visuals">Erscheinungsbild</string>
<string name="pref_category_network">Netzwerk</string> <string name="pref_cat__network">Netzwerk</string>
<string name="pref_category_pod_settings">Pod Einstellungen</string> <string name="pref_cat__pod_settings">Pod Einstellungen</string>
<!-- Visuals --> <!-- Visuals -->
<!-- Font size --> <!-- Font size -->
<string name="pref_title_font_size">Schriftgröße</string> <string name="pref_title__font_size">Schriftgröße</string>
<array name="pref_entries_font_size"> <array name="pref_entries__font_size">
<item>Normal</item> <item>Normal</item>
<item>Groß</item> <item>Groß</item>
<item>Riesig</item> <item>Riesig</item>
</array> </array>
<!-- Load images --> <!-- Load images -->
<string name="pref_title_load_images">Lade Bilder</string> <string name="pref_title__load_images">Lade Bilder</string>
<string name="pref_desc_load_images">Deaktiviere das Laden von Bildern, um den Datenverbrauch zu verringern</string> <string name="pref_desc__load_images">Deaktiviere das Laden von Bildern, um den Datenverbrauch zu verringern</string>
<!-- Proxy --> <!-- Proxy -->
<string name="pref_title_proxy_enabled">Aktiviere Proxy</string> <string name="pref_title__proxy_enabled">Aktiviere Proxy</string>
<string name="pref_desc_proxy_enabled">Nutze einen Proxyserver um Firewalls zu umgehen</string> <string name="pref_desc__proxy_enabled">Nutze einen Proxyserver um Firewalls zu umgehen</string>
<string name="pref_title_proxy_host">Host</string> <string name="pref_title__proxy_host">Host</string>
<string name="pref_title_proxy_port">Port</string> <string name="pref_title__proxy_port">Port</string>
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title_personal_settings">Persönliche Einstellungen</string> <string name="pref_title__personal_settings">Persönliche Einstellungen</string>
<string name="pref_desc_personal_settings">Öffne die Einstellungen deines Diaspora Accounts</string> <string name="pref_desc__personal_settings">Öffne die Einstellungen deines Diaspora Accounts</string>
<string name="pref_title_manage_contacts">Kontakte</string> <string name="pref_title__manage_contacts">Kontakte</string>
<string name="pref_desc_manage_contacts">Bearbeite deine Kontaktliste</string> <string name="pref_desc__manage_contacts">Bearbeite deine Kontaktliste</string>
<string name="pref_title_manage_tags">Tags verwalten</string> <string name="pref_title__manage_tags">Tags verwalten</string>
<string name="pref_desc_manage_tags">Verwalte die Liste der Hashtags, denen du folgst</string> <string name="pref_desc__manage_tags">Verwalte die Liste der Hashtags, denen du folgst</string>
<string name="pref_title_change_account">Account wechseln</string> <string name="pref_title__change_account">Account wechseln</string>
<string name="pref_desc_change_account">Lösche lokale Sitzungsdaten und wechsle zu einem anderen Pod/Account</string> <string name="pref_desc__change_account">Lösche lokale Sitzungsdaten und wechsle zu einem anderen Pod/Account</string>
<string name="pref_warning_change_account">Das wird alle Cookies und Session-Daten löschen. Willst du wirklich den Account wechseln?</string> <string name="pref_warning__change_account">Das wird alle Cookies und Session-Daten löschen. Willst du wirklich den Account wechseln?</string>
<string name="pref_desc__clear_cache">WebView Cache leeren</string>
<string name="pref_title__clear_cache">Cache leeren</string>
<string name="pref_title__intellihide_toolbars">Toolbars intelligent verstecken</string>
<string name="pref_desc__intellihide_toolbars">Obere und untere Toolbar verstecken während des Scrollens von Inhalt</string>
</resources> </resources>

View file

@ -158,9 +158,5 @@ along with this program. If not, see http://www.gnu.org/licenses.&lt;br> &lt;br
<string name="toggle_desktop_page">Mobil-/Desktopansicht umschalten</string> <string name="toggle_desktop_page">Mobil-/Desktopansicht umschalten</string>
<string name="all_tags">Alle Tags</string> <string name="all_tags">Alle Tags</string>
<string name="pref_desc_clear_cache">WebView Cache leeren</string>
<string name="pref_title_clear_cache">Cache leeren</string>
<string name="pref_title_intellihide_toolbars">Toolbars intelligent verstecken</string>
<string name="pref_desc_intellihide_toolbars">Obere und untere Toolbar verstecken während des Scrollens von Inhalt</string>
</resources> </resources>

View file

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Categories --> <!-- Categories -->
<string name="pref_category_visuals">Apparance</string> <string name="pref_cat__visuals">Apparance</string>
<string name="pref_category_network">Paramètres du réseau</string> <string name="pref_cat__network">Paramètres du réseau</string>
<string name="pref_category_pod_settings">Paramètres du pod</string> <string name="pref_cat__pod_settings">Paramètres du pod</string>
<!-- Visuals --> <!-- Visuals -->
<!-- Font size --> <!-- Font size -->
<string name="pref_title_font_size">Taille de la police</string> <string name="pref_title__font_size">Taille de la police</string>
<array name="pref_entries_font_size"> <array name="pref_entries__font_size">
<item>Normal</item> <item>Normal</item>
<item>Grand</item> <item>Grand</item>
<item>Énorme</item> <item>Énorme</item>
</array> </array>
<!-- Load images --> <!-- Load images -->
<string name="pref_title_load_images">Charger les images</string> <string name="pref_title__load_images">Charger les images</string>
<string name="pref_desc_load_images">Disable image loading to safe mobile data</string> <string name="pref_desc__load_images">Disable image loading to safe mobile data</string>
<!-- Proxy --> <!-- Proxy -->
<string name="pref_title_proxy_enabled">Activer Proxy</string> <string name="pref_title__proxy_enabled">Activer Proxy</string>
<string name="pref_desc_proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string> <string name="pref_desc__proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string>
<string name="pref_title_proxy_host">Hôte</string> <string name="pref_title__proxy_host">Hôte</string>
<string name="pref_title_proxy_port">Port</string> <string name="pref_title__proxy_port">Port</string>
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title_personal_settings">Paramètres personnels</string> <string name="pref_title__personal_settings">Paramètres personnels</string>
<string name="pref_desc_personal_settings">Open your diaspora account settings</string> <string name="pref_desc__personal_settings">Open your diaspora account settings</string>
<string name="pref_title_manage_contacts">Contacts</string> <string name="pref_title__manage_contacts">Contacts</string>
<string name="pref_desc_manage_contacts">Gérer votre liste des contacts</string> <string name="pref_desc__manage_contacts">Gérer votre liste des contacts</string>
<string name="pref_title_manage_tags">Gérer les Hashtags</string> <string name="pref_title__manage_tags">Gérer les Hashtags</string>
<string name="pref_desc_manage_tags">Add and delete the hashtags you are following</string> <string name="pref_desc__manage_tags">Add and delete the hashtags you are following</string>
<string name="pref_title_change_account">Changer de compte</string> <string name="pref_title__change_account">Changer de compte</string>
<string name="pref_desc_change_account">Erase local session data and switch to another Diaspora pod/account</string> <string name="pref_desc__change_account">Erase local session data and switch to another Diaspora pod/account</string>
<string name="pref_warning_change_account">Cette opération va effacer les cookies et données de session. Voulez-vous vraiment changer de compte/pod?</string> <string name="pref_warning__change_account">Cette opération va effacer les cookies et données de session. Voulez-vous vraiment changer de compte/pod?</string>
</resources> </resources>

View file

@ -1,52 +1,84 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Categories --> <!-- Key Names (Untranslateable) -->
<string name="pref_category_visuals">Appearance</string> <string name="pref_key__poddomain" translatable="false">podDomain</string>
<string name="pref_category_network">Network</string> <string name="pref_key__previous_podlist" translatable="false">previousPodlist</string>
<string name="pref_category_pod_settings">Pod settings</string> <string name="pref_key__font_size" translatable="false">pref_key_font_size</string>
<string name="pref_key__intellihide_toolbars" translatable="false">pref_key_intellihide_toolbars</string>
<string name="pref_catkey__pod_settings" translatable="false">pref_key_category_pod_settings</string>
<string name="pref_catkey__category_visuals" translatable="false">pref_key_category_visuals</string>
<string name="pref_key__personal_settings" translatable="false">pref_key_personal_settings</string>
<string name="pref_key__manage_tags" translatable="false">pref_key_manage_tags</string>
<string name="pref_key__manage_contacts" translatable="false">pref_key_manage_contacts</string>
<string name="pref_key__change_account" translatable="false">pref_key_change_account</string>
<string name="pref_catkey__network" translatable="false">pref_key_category_network</string>
<string name="pref_key__load_images" translatable="false">pref_key_load_images</string>
<string name="pref_key__clear_cache" translatable="false">pref_key_clear_cache</string>
<string name="pref_key__proxy_enabled" translatable="false">pref_key_proxy_enabled</string>
<string name="pref_key__proxy_host" translatable="false">pref_key_proxy_host</string>
<string name="pref_key__proxy_port" translatable="false">pref_key_proxy_port</string>
<string name="pref_key__proxy_was_enabled" translatable="false">wasProxyEnabled</string>
<string name="pref_key__podprofile_avatar_url" translatable="false">podUserProfile_avatar</string>
<string name="pref_key__podprofile_name" translatable="false">podUserProfile_name</string>
<string name="pref_key__podprofile_id" translatable="false">podUserProfile_guid</string>
<string name="pref_key__podprofile_aspects" translatable="false">podUserProfile_aspects</string>
<string name="pref_key__podprofile_followed_tags" translatable="false">podUserProfile_followedTags</string>
<!-- Category Titles -->
<string name="pref_cat__visuals">Appearance</string>
<string name="pref_cat__network">Network</string>
<string name="pref_cat__pod_settings">Pod settings</string>
<!-- Visuals --> <!-- Visuals -->
<!-- Font size --> <!-- Font size -->
<string name="pref_title_font_size">Font size</string> <string name="pref_title__font_size">Font size</string>
<array name="pref_entries_font_size"> <array name="pref_entries__font_size">
<item>Normal</item> <item>Normal</item>
<item>Large</item> <item>Large</item>
<item>Huge</item> <item>Huge</item>
</array> </array>
<!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash --> <!-- prefix 's' is needed to make this a string array. Otherwise ListPreference would crash -->
<array name="pref_entry_values_font_size" translatable="false"> <array name="pref_entries_values__font_size" translatable="false">
<item>normal</item> <item>normal</item>
<item>large</item> <item>large</item>
<item>huge</item> <item>huge</item>
</array> </array>
<!-- Load images --> <!-- Load images -->
<string name="pref_title_load_images">Load images</string> <string name="pref_title__load_images">Load images</string>
<string name="pref_desc_load_images">Disable image loading to safe mobile data</string> <string name="pref_desc__load_images">Disable image loading to safe mobile data</string>
<!-- Proxy --> <!-- Proxy -->
<string name="pref_title_proxy_enabled">Enable Proxy</string> <string name="pref_title__proxy_enabled">Enable Proxy</string>
<string name="pref_desc_proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string> <string name="pref_desc__proxy_enabled">Proxy Diaspora\'s traffic to circumvent firewalls.\nMay require restart</string>
<string name="pref_title_proxy_host">Host</string> <string name="pref_title__proxy_host">Host</string>
<string name="pref_title_proxy_port">Port</string> <string name="pref_title__proxy_port">Port</string>
<!-- Diaspora Settings --> <!-- Diaspora Settings -->
<string name="pref_title_personal_settings">Personal settings</string> <string name="pref_title__personal_settings">Personal settings</string>
<string name="pref_desc_personal_settings">Open your diaspora account settings</string> <string name="pref_desc__personal_settings">Open your diaspora account settings</string>
<string name="pref_title_manage_contacts">Contacts</string> <string name="pref_title__manage_contacts">Contacts</string>
<string name="pref_desc_manage_contacts">Manage your contact list</string> <string name="pref_desc__manage_contacts">Manage your contact list</string>
<string name="pref_title_manage_tags">Manage Hashtags</string> <string name="pref_title__manage_tags">Manage Hashtags</string>
<string name="pref_desc_manage_tags">Add and delete the hashtags you are following</string> <string name="pref_desc__manage_tags">Add and delete the hashtags you are following</string>
<string name="pref_title_change_account">Change Account</string> <string name="pref_title__change_account">Change Account</string>
<string name="pref_desc_change_account">Erase local session data and switch to another Diaspora pod/account</string> <string name="pref_desc__change_account">Erase local session data and switch to another Diaspora pod/account</string>
<string name="pref_warning_change_account">This will erase all cookies and session data. Do you really want to change your account?</string> <string name="pref_warning__change_account">This will erase all cookies and session data. Do you really want to change your account?</string>
<string name="pref_title_clear_cache">Clear cache</string> <string name="pref_title__clear_cache">Clear cache</string>
<string name="pref_desc_clear_cache">Clear WebView cache</string> <string name="pref_desc__clear_cache">Clear WebView cache</string>
<string name="pref_desc__intellihide_toolbars" translatable="false">Hide top and bottom toolbars automatically while scrolling</string>
<string name="pref_title__intellihide_toolbars">Intellihide Toolbars</string>
</resources> </resources>

View file

@ -175,6 +175,4 @@
<string name="toast_set_proxy_failed">Warning: Could not set network proxy…</string> <string name="toast_set_proxy_failed">Warning: Could not set network proxy…</string>
<string name="all_tags">All tags</string> <string name="all_tags">All tags</string>
<string name="pref_desc_intellihide_toolbars">Hide top and bottom toolbars automatically while scrolling</string>
<string name="pref_title_intellihide_toolbars">Intellihide Toolbars</string>
</resources> </resources>

View file

@ -2,83 +2,83 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Appearance --> <!-- Appearance -->
<PreferenceCategory <PreferenceCategory
android:key="pref_key_category_visuals" android:key="@string/pref_catkey__category_visuals"
android:title="@string/pref_category_visuals"> android:title="@string/pref_cat__visuals">
<ListPreference <ListPreference
android:dialogTitle="@string/pref_title_font_size" android:dialogTitle="@string/pref_title__font_size"
android:entries="@array/pref_entries_font_size" android:entries="@array/pref_entries__font_size"
android:entryValues="@array/pref_entry_values_font_size" android:entryValues="@array/pref_entries_values__font_size"
android:key="pref_key_font_size" android:key="@string/pref_key__font_size"
android:summary="%s" android:summary="%s"
android:title="@string/pref_title_font_size"/> android:title="@string/pref_title__font_size"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"
android:key="pref_key_intellihide_toolbars" android:key="@string/pref_key__intellihide_toolbars"
android:summary="@string/pref_desc_intellihide_toolbars" android:summary="@string/pref_desc__intellihide_toolbars"
android:title="@string/pref_title_intellihide_toolbars"/> android:title="@string/pref_title__intellihide_toolbars"/>
</PreferenceCategory> </PreferenceCategory>
<!-- Diaspora Pod Settings --> <!-- Diaspora Pod Settings -->
<PreferenceCategory <PreferenceCategory
android:key="pref_key_category_pod_settings" android:key="@string/pref_catkey__pod_settings"
android:title="@string/pref_category_pod_settings"> android:title="@string/pref_cat__pod_settings">
<Preference <Preference
android:key="pref_key_personal_settings" android:key="@string/pref_key__personal_settings"
android:summary="@string/pref_desc_personal_settings" android:summary="@string/pref_desc__personal_settings"
android:title="@string/pref_title_personal_settings"> android:title="@string/pref_title__personal_settings">
</Preference> </Preference>
<Preference <Preference
android:key="pref_key_manage_tags" android:key="@string/pref_key__manage_tags"
android:summary="@string/pref_desc_manage_tags" android:summary="@string/pref_desc__manage_tags"
android:title="@string/pref_title_manage_tags"> android:title="@string/pref_title__manage_tags">
</Preference> </Preference>
<Preference <Preference
android:key="pref_key_manage_contacts" android:key="@string/pref_key__manage_contacts"
android:summary="@string/pref_desc_manage_contacts" android:summary="@string/pref_desc__manage_contacts"
android:title="@string/pref_title_manage_contacts"> android:title="@string/pref_title__manage_contacts">
</Preference> </Preference>
<Preference <Preference
android:key="pref_key_change_account" android:key="@string/pref_key__change_account"
android:summary="@string/pref_desc_change_account" android:summary="@string/pref_desc__change_account"
android:title="@string/pref_title_change_account"> android:title="@string/pref_title__change_account">
</Preference> </Preference>
</PreferenceCategory> </PreferenceCategory>
<!-- Networking --> <!-- Networking -->
<PreferenceCategory <PreferenceCategory
android:key="pref_key_category_network" android:key="@string/pref_catkey__network"
android:title="@string/pref_category_network"> android:title="@string/pref_cat__network">
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"
android:key="pref_key_load_images" android:key="@string/pref_key__load_images"
android:summary="@string/pref_desc_load_images" android:summary="@string/pref_desc__load_images"
android:title="@string/pref_title_load_images"/> android:title="@string/pref_title__load_images"/>
<Preference <Preference
android:key="pref_key_clear_cache" android:key="@string/pref_key__clear_cache"
android:summary="@string/pref_desc_clear_cache" android:summary="@string/pref_desc__clear_cache"
android:title="@string/pref_title_clear_cache"> android:title="@string/pref_title__clear_cache">
</Preference> </Preference>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="pref_key_proxy_enabled" android:key="@string/pref_key__proxy_enabled"
android:summary="@string/pref_desc_proxy_enabled" android:summary="@string/pref_desc__proxy_enabled"
android:title="@string/pref_title_proxy_enabled"/> android:title="@string/pref_title__proxy_enabled"/>
<EditTextPreference <EditTextPreference
android:dependency="pref_key_proxy_enabled" android:dependency="@string/pref_key__proxy_enabled"
android:inputType="textNoSuggestions" android:inputType="textNoSuggestions"
android:key="pref_key_proxy_host" android:key="@string/pref_key__proxy_host"
android:title="@string/pref_title_proxy_host"/> android:title="@string/pref_title__proxy_host"/>
<EditTextPreference <EditTextPreference
android:dependency="pref_key_proxy_enabled" android:dependency="@string/pref_key__proxy_enabled"
android:inputType="number" android:inputType="number"
android:key="pref_key_proxy_port" android:key="@string/pref_key__proxy_port"
android:title="@string/pref_title_proxy_port"/> android:title="@string/pref_title__proxy_port"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>