From c6b977a42e2a05d7b0ad28e7d300a87d696611ad Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 23 Apr 2018 11:38:32 -0700 Subject: [PATCH] Remove preference to flip recents Now we always flip recents, and don't have a setting. Bug: 78231551 Change-Id: Icc991dbe4674e9238e1d7e39938009b51bde7bd5 --- .../android/quickstep/views/RecentsView.java | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index a7b018afb0..a2a93d71fb 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -30,8 +30,6 @@ import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.graphics.Canvas; import android.graphics.Point; import android.graphics.Rect; @@ -85,8 +83,7 @@ import java.util.function.Consumer; * A list of recent tasks. */ @TargetApi(Build.VERSION_CODES.P) -public abstract class RecentsView - extends PagedView implements OnSharedPreferenceChangeListener, Insettable { +public abstract class RecentsView extends PagedView implements Insettable { public static final boolean DEBUG_SHOW_CLEAR_ALL_BUTTON = false; @@ -104,7 +101,7 @@ public abstract class RecentsView return recentsView.mAdjacentScale; } }; - private static final String PREF_FLIP_RECENTS = "pref_flip_recents"; + private static final boolean FLIP_RECENTS = true; private static final int DISMISS_TASK_DURATION = 300; protected final T mActivity; @@ -201,7 +198,11 @@ public abstract class RecentsView mQuickScrubController = new QuickScrubController(mActivity, this); mModel = RecentsModel.getInstance(context); - onSharedPreferenceChanged(Utilities.getPrefs(context), PREF_FLIP_RECENTS); + mIsRtl = Utilities.isRtl(getResources()); + if (FLIP_RECENTS) { + mIsRtl = !mIsRtl; + } + setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR); mEmptyIcon = context.getDrawable(R.drawable.ic_empty_recents); mEmptyIcon.setCallback(this); @@ -215,17 +216,6 @@ public abstract class RecentsView setWillNotDraw(false); } - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { - if (s.equals(PREF_FLIP_RECENTS)) { - mIsRtl = Utilities.isRtl(getResources()); - if (sharedPreferences.getBoolean(PREF_FLIP_RECENTS, false)) { - mIsRtl = !mIsRtl; - } - setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR); - } - } - public boolean isRtl() { return mIsRtl; } @@ -248,7 +238,6 @@ public abstract class RecentsView protected void onAttachedToWindow() { super.onAttachedToWindow(); updateTaskStackListenerState(); - Utilities.getPrefs(getContext()).registerOnSharedPreferenceChangeListener(this); mActivity.addMultiWindowModeChangedListener(mMultiWindowModeChangedListener); } @@ -256,7 +245,6 @@ public abstract class RecentsView protected void onDetachedFromWindow() { super.onDetachedFromWindow(); updateTaskStackListenerState(); - Utilities.getPrefs(getContext()).unregisterOnSharedPreferenceChangeListener(this); mActivity.removeMultiWindowModeChangedListener(mMultiWindowModeChangedListener); }