From b56864fef92d83c80d9f17ebd7f70142f3952af8 Mon Sep 17 00:00:00 2001 From: cristianomatos Date: Thu, 13 Sep 2018 21:03:29 +0530 Subject: [PATCH] AOKP animations: Add and entry for TRANSIT_TASK_OPEN_BEHIND Already in frameworks/base. Option was just missing from Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hưng Phan --- res/values/cherish_strings.xml | 1 + res/xml/cherish_settings_animations.xml | 4 ++++ .../settings/fragments/AnimationsSettings.java | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 24bcbf2..0a4e85e 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -551,6 +551,7 @@ Activity open animation Activity close animation Task open animation + Task open behind animation Task close animation Move to front animation Move to back animation diff --git a/res/xml/cherish_settings_animations.xml b/res/xml/cherish_settings_animations.xml index bb969c2..3c33021 100644 --- a/res/xml/cherish_settings_animations.xml +++ b/res/xml/cherish_settings_animations.xml @@ -35,6 +35,10 @@ android:key="task_open" android:title="@string/task_open_title" /> + + diff --git a/src/com/cherish/settings/fragments/AnimationsSettings.java b/src/com/cherish/settings/fragments/AnimationsSettings.java index eee8e4a..406941c 100644 --- a/src/com/cherish/settings/fragments/AnimationsSettings.java +++ b/src/com/cherish/settings/fragments/AnimationsSettings.java @@ -53,6 +53,7 @@ public class AnimationsSettings extends SettingsPreferenceFragment private static final String ACTIVITY_OPEN = "activity_open"; private static final String ACTIVITY_CLOSE = "activity_close"; private static final String TASK_OPEN = "task_open"; + private static final String TASK_OPEN_BEHIND = "task_open_behind"; 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"; @@ -71,6 +72,7 @@ public class AnimationsSettings extends SettingsPreferenceFragment ListPreference mActivityOpenPref; ListPreference mActivityClosePref; ListPreference mTaskOpenPref; + ListPreference mTaskOpenBehind; ListPreference mTaskClosePref; ListPreference mTaskMoveToFrontPref; ListPreference mTaskMoveToBackPref; @@ -146,6 +148,12 @@ public class AnimationsSettings extends SettingsPreferenceFragment mTaskOpenPref.setEntries(mAnimationsStrings); mTaskOpenPref.setEntryValues(mAnimationsNum); + mTaskOpenBehind = (ListPreference) findPreference(TASK_OPEN_BEHIND); + mTaskOpenBehind.setOnPreferenceChangeListener(this); + mTaskOpenBehind.setSummary(getProperSummary(mTaskOpenBehind)); + mTaskOpenBehind.setEntries(mAnimationsStrings); + mTaskOpenBehind.setEntryValues(mAnimationsNum); + mTaskClosePref = (ListPreference) findPreference(TASK_CLOSE); mTaskClosePref.setOnPreferenceChangeListener(this); mTaskClosePref.setSummary(getProperSummary(mTaskClosePref)); @@ -260,6 +268,10 @@ public class AnimationsSettings extends SettingsPreferenceFragment int val = Integer.parseInt((String) newValue); result = Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ACTIVITY_ANIMATION_CONTROLS[9], val); + } else if (preference == mTaskOpenBehind) { + int val = Integer.parseInt((String) newValue); + result = Settings.Global.putInt(mContext.getContentResolver(), + Settings.Global.ACTIVITY_ANIMATION_CONTROLS[10], val); } preference.setSummary(getProperSummary(preference)); return result; @@ -287,6 +299,8 @@ public class AnimationsSettings extends SettingsPreferenceFragment mString = Settings.Global.ACTIVITY_ANIMATION_CONTROLS[8]; } else if (preference == mWallpaperIntraClose) { mString = Settings.Global.ACTIVITY_ANIMATION_CONTROLS[9]; + } else if (preference == mTaskOpenBehind) { + mString = Settings.Global.ACTIVITY_ANIMATION_CONTROLS[10]; } int mNum = Settings.Global.getInt(mContext.getContentResolver(), mString, 0); return mAnimationsStrings[mNum];