Cherish:Add option to disable scrolling cache [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -65,8 +65,12 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
private static final String KEY_TOAST_ANIMATION = "toast_animation";
|
||||
private static final String KEY_LISTVIEW_ANIMATION = "listview_animation";
|
||||
private static final String KEY_LISTVIEW_INTERPOLATOR = "listview_interpolator";
|
||||
private static final String SCROLLINGCACHE_PREF = "pref_scrollingcache";
|
||||
private static final String SCROLLINGCACHE_PERSIST_PROP = "persist.sys.scrollingcache";
|
||||
private static final String SCROLLINGCACHE_DEFAULT = "2";
|
||||
|
||||
private ListPreference mToastAnimation;
|
||||
private ListPreference mScrollingCachePref;
|
||||
private ListPreference mListViewAnimation;
|
||||
private ListPreference mListViewInterpolator;
|
||||
ListPreference mActivityOpenPref;
|
||||
@@ -121,6 +125,11 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
mListViewInterpolator.setOnPreferenceChangeListener(this);
|
||||
mListViewInterpolator.setEnabled(listviewanimation > 0);
|
||||
|
||||
mScrollingCachePref = (ListPreference) findPreference(SCROLLINGCACHE_PREF);
|
||||
mScrollingCachePref.setValue(SystemProperties.get(SCROLLINGCACHE_PERSIST_PROP,
|
||||
SystemProperties.get(SCROLLINGCACHE_PERSIST_PROP, SCROLLINGCACHE_DEFAULT)));
|
||||
mScrollingCachePref.setOnPreferenceChangeListener(this);
|
||||
|
||||
mAnimations = AwesomeAnimationHelper.getAnimationsList();
|
||||
int animqty = mAnimations.length;
|
||||
mAnimationsStrings = new String[animqty];
|
||||
@@ -228,6 +237,11 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
Settings.Global.LISTVIEW_INTERPOLATOR, value);
|
||||
mListViewInterpolator.setSummary(mListViewInterpolator.getEntries()[index]);
|
||||
return true;
|
||||
} else if (preference == mScrollingCachePref) {
|
||||
if (newValue != null) {
|
||||
SystemProperties.set(SCROLLINGCACHE_PERSIST_PROP, (String) newValue);
|
||||
}
|
||||
return true;
|
||||
} else if (preference == mActivityOpenPref) {
|
||||
int val = Integer.parseInt((String) newValue);
|
||||
result = Settings.Global.putInt(mContext.getContentResolver(),
|
||||
|
||||
Reference in New Issue
Block a user