add some preference key dependency tracking
This commit is contained in:
parent
9a1dbdc74f
commit
cf3357d49b
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="71"
|
android:versionCode="72"
|
||||||
android:versionName="0.5.6" >
|
android:versionName="0.5.7" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="7" />
|
<uses-sdk android:minSdkVersion="7" />
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</EditTextPreference>
|
</EditTextPreference>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/look_and_feel" >
|
<PreferenceCategory android:key="category_look_and_feel" android:title="@string/look_and_feel" >
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="THEME_DARK"
|
android:defaultValue="THEME_DARK"
|
||||||
@ -84,6 +84,7 @@
|
|||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="browse_cats_like_feeds"
|
android:key="browse_cats_like_feeds"
|
||||||
|
android:dependency="enable_cats"
|
||||||
android:summary="@string/browse_cats_like_feeds_summary"
|
android:summary="@string/browse_cats_like_feeds_summary"
|
||||||
android:title="@string/browse_cats_like_feeds" />
|
android:title="@string/browse_cats_like_feeds" />
|
||||||
|
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
package org.fox.ttrss;
|
package org.fox.ttrss;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.Preference;
|
||||||
|
import android.preference.Preference.OnPreferenceClickListener;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
|
import android.preference.PreferenceCategory;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
public class PreferencesActivity extends PreferenceActivity {
|
public class PreferencesActivity extends PreferenceActivity {
|
||||||
|
|
||||||
@ -10,11 +15,24 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
SharedPreferences prefs = PreferenceManager
|
||||||
|
.getDefaultSharedPreferences(getApplicationContext());
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
addPreferencesFromResource(R.xml.preferences);
|
||||||
|
|
||||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
||||||
getPreferenceScreen().removePreference(
|
PreferenceCategory category = (PreferenceCategory)findPreference("category_look_and_feel");
|
||||||
findPreference("tablet_article_swipe"));
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user