Cherish:Added ANIMATION_DURATION options [2/2]
Correct few things in AnimationSettings Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
committed by
Hưng Phan
parent
9c0e1c565a
commit
76037acfce
@@ -560,8 +560,6 @@
|
||||
<string name="wallpaper_intra_open_title">Wallpaper intra open animation</string>
|
||||
<string name="wallpaper_intra_close_title">Wallpaper intra close animation</string>
|
||||
<string name="animation_duration_title">Animation duration</string>
|
||||
<string name="title_animation_no_override">Prevent app overrides</string>
|
||||
<string name="summary_animation_no_override">Prevent apps from overriding transitions</string>
|
||||
<string name="animation_duration_default">Default</string>
|
||||
|
||||
<!-- Toast Animation -->
|
||||
|
||||
@@ -23,6 +23,15 @@
|
||||
<PreferenceCategory
|
||||
android:title="@string/system_animation_title">
|
||||
|
||||
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||
android:key="animation_duration"
|
||||
android:max="1500"
|
||||
android:persistent="false"
|
||||
android:title="@string/animation_duration_title"
|
||||
settings:min="0"
|
||||
settings:units="ms"
|
||||
settings:interval="50"/>
|
||||
|
||||
<ListPreference
|
||||
android:key="activity_open"
|
||||
android:title="@string/activity_open_title" />
|
||||
|
||||
@@ -42,6 +42,8 @@ import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.util.cherish.AwesomeAnimationHelper;
|
||||
|
||||
import com.cherish.settings.preferences.CustomSeekBarPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -57,7 +59,6 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
private static final String TASK_CLOSE = "task_close";
|
||||
private static final String TASK_MOVE_TO_FRONT = "task_move_to_front";
|
||||
private static final String TASK_MOVE_TO_BACK = "task_move_to_back";
|
||||
private static final String ANIMATION_NO_OVERRIDE = "animation_no_override";
|
||||
private static final String WALLPAPER_OPEN = "wallpaper_open";
|
||||
private static final String WALLPAPER_CLOSE = "wallpaper_close";
|
||||
private static final String WALLPAPER_INTRA_OPEN = "wallpaper_intra_open";
|
||||
@@ -68,22 +69,24 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
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 static final String ANIMATION_DURATION = "animation_duration";
|
||||
|
||||
private ListPreference mToastAnimation;
|
||||
private ListPreference mScrollingCachePref;
|
||||
private ListPreference mListViewAnimation;
|
||||
private ListPreference mListViewInterpolator;
|
||||
ListPreference mActivityOpenPref;
|
||||
ListPreference mActivityClosePref;
|
||||
ListPreference mTaskOpenPref;
|
||||
ListPreference mTaskOpenBehind;
|
||||
ListPreference mTaskClosePref;
|
||||
ListPreference mTaskMoveToFrontPref;
|
||||
ListPreference mTaskMoveToBackPref;
|
||||
ListPreference mWallpaperOpen;
|
||||
ListPreference mWallpaperClose;
|
||||
ListPreference mWallpaperIntraOpen;
|
||||
ListPreference mWallpaperIntraClose;
|
||||
private ListPreference mActivityOpenPref;
|
||||
private ListPreference mActivityClosePref;
|
||||
private ListPreference mTaskOpenPref;
|
||||
private ListPreference mTaskOpenBehind;
|
||||
private ListPreference mTaskClosePref;
|
||||
private ListPreference mTaskMoveToFrontPref;
|
||||
private ListPreference mTaskMoveToBackPref;
|
||||
private ListPreference mWallpaperOpen;
|
||||
private ListPreference mWallpaperClose;
|
||||
private ListPreference mWallpaperIntraOpen;
|
||||
private ListPreference mWallpaperIntraClose;
|
||||
private CustomSeekBarPreference mAnimationDuration;
|
||||
|
||||
private int[] mAnimations;
|
||||
private String[] mAnimationsStrings;
|
||||
@@ -139,6 +142,10 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
mAnimationsNum[i] = String.valueOf(mAnimations[i]);
|
||||
}
|
||||
|
||||
mAnimationDuration = (CustomSeekBarPreference) findPreference(ANIMATION_DURATION);
|
||||
mAnimationDuration.setValue(Settings.Global.getInt(resolver, Settings.Global.ANIMATION_CONTROLS_DURATION, 0));
|
||||
mAnimationDuration.setOnPreferenceChangeListener(this);
|
||||
|
||||
mActivityOpenPref = (ListPreference) findPreference(ACTIVITY_OPEN);
|
||||
mActivityOpenPref.setOnPreferenceChangeListener(this);
|
||||
mActivityOpenPref.setSummary(getProperSummary(mActivityOpenPref));
|
||||
@@ -286,6 +293,10 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
int val = Integer.parseInt((String) newValue);
|
||||
result = Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.ACTIVITY_ANIMATION_CONTROLS[10], val);
|
||||
} else if (preference == mAnimationDuration) {
|
||||
int val = (Integer) newValue;
|
||||
Settings.Global.putInt(getContentResolver(), Settings.Global.ANIMATION_CONTROLS_DURATION, val);
|
||||
return true;
|
||||
}
|
||||
preference.setSummary(getProperSummary(preference));
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user