Cherish:Power Menu animations [2/2]

This commit is contained in:
Alex Cruz
2018-11-17 19:48:58 +05:30
committed by Hưng Phan
parent ba1cbe8331
commit 09719c8493
4 changed files with 50 additions and 0 deletions

View File

@@ -61,8 +61,10 @@ public class AnimationsSettings extends SettingsPreferenceFragment implements On
private static final String WALLPAPER_CLOSE = "wallpaper_close";
private static final String WALLPAPER_INTRA_OPEN = "wallpaper_intra_open";
private static final String WALLPAPER_INTRA_CLOSE = "wallpaper_intra_close";
private static final String POWER_MENU_ANIMATIONS = "power_menu_animations";
private CustomSeekBarPreference mAnimDuration;
private ListPreference mPowerMenuAnimations;
ListPreference mActivityOpenPref;
ListPreference mActivityClosePref;
@@ -167,6 +169,12 @@ public class AnimationsSettings extends SettingsPreferenceFragment implements On
mWallpaperIntraClose.setEntries(mAnimationsStrings);
mWallpaperIntraClose.setEntryValues(mAnimationsNum);
mWallpaperIntraClose.setOnPreferenceChangeListener(this);
mPowerMenuAnimations = (ListPreference) findPreference(POWER_MENU_ANIMATIONS);
mPowerMenuAnimations.setValue(String.valueOf(Settings.System.getInt(
getContentResolver(), Settings.System.POWER_MENU_ANIMATIONS, 0)));
mPowerMenuAnimations.setSummary(mPowerMenuAnimations.getEntry());
mPowerMenuAnimations.setOnPreferenceChangeListener(this);
}
@Override
@@ -242,6 +250,12 @@ public class AnimationsSettings extends SettingsPreferenceFragment implements On
Settings.Global.putInt(resolver,
Settings.Global.ACTIVITY_ANIMATION_CONTROLS[10], val);
preference.setSummary(getProperSummary(preference));
return true;
} else if (preference == mPowerMenuAnimations) {
Settings.System.putInt(getContentResolver(), Settings.System.POWER_MENU_ANIMATIONS,
Integer.valueOf((String) newValue));
mPowerMenuAnimations.setValue(String.valueOf(newValue));
mPowerMenuAnimations.setSummary(mPowerMenuAnimations.getEntry());
return true;
}
return false;