diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 18f6f664..8d7b08db 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="72" + android:versionName="0.5.7" > diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 91efa29b..291a5ce5 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -49,7 +49,7 @@ - + diff --git a/src/org/fox/ttrss/PreferencesActivity.java b/src/org/fox/ttrss/PreferencesActivity.java index 742320f7..41fb00f2 100644 --- a/src/org/fox/ttrss/PreferencesActivity.java +++ b/src/org/fox/ttrss/PreferencesActivity.java @@ -1,8 +1,13 @@ package org.fox.ttrss; +import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; +import android.preference.PreferenceManager; public class PreferencesActivity extends PreferenceActivity { @@ -10,11 +15,24 @@ public class PreferencesActivity extends PreferenceActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + SharedPreferences prefs = PreferenceManager + .getDefaultSharedPreferences(getApplicationContext()); + addPreferencesFromResource(R.xml.preferences); if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE) { - getPreferenceScreen().removePreference( - findPreference("tablet_article_swipe")); + PreferenceCategory category = (PreferenceCategory)findPreference("category_look_and_feel"); + category.removePreference(findPreference("tablet_article_swipe")); } + + findPreference("justify_article_text").setEnabled(!prefs.getBoolean("combined_mode", false)); + + findPreference("combined_mode").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + findPreference("justify_article_text").setEnabled(!newValue.toString().equals("true")); + return true; + } + }); } }