summaryrefslogtreecommitdiffstats
path: root/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
diff options
context:
space:
mode:
authorVadim Tryshev <vadimt@google.com>2018-04-26 10:47:05 -0700
committerVadim Tryshev <vadimt@google.com>2018-04-27 13:32:28 -0700
commitcc0c98ad945a911499e92bcf3a5bc364acdf6e3b (patch)
treec8837ea7edf09cac7b9e8afddbdde8db13ecee09 /quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
parentdcb74be7a6c72458fbba81c76a588a34663d82ec (diff)
downloadandroid_packages_apps_Trebuchet-cc0c98ad945a911499e92bcf3a5bc364acdf6e3b.tar.gz
android_packages_apps_Trebuchet-cc0c98ad945a911499e92bcf3a5bc364acdf6e3b.tar.bz2
android_packages_apps_Trebuchet-cc0c98ad945a911499e92bcf3a5bc364acdf6e3b.zip
Enable Clear-all button by default
Making it work with all 4 combinations of RTL and flip-recents. Bug: 72222505 Test: Manual Change-Id: Ifb2428e006674abfe9a2609fd3d8f3f648eff0b8
Diffstat (limited to 'quickstep/src/com/android/quickstep/views/RecentsViewContainer.java')
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsViewContainer.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
index 988b3ad1f..6b89b66f4 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java
@@ -4,6 +4,7 @@ import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.FloatProperty;
+import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
@@ -43,6 +44,10 @@ public class RecentsViewContainer extends InsettableFrameLayout {
});
mRecentsView = (RecentsView) findViewById(R.id.overview_panel);
+ final InsettableFrameLayout.LayoutParams params =
+ (InsettableFrameLayout.LayoutParams) mClearAllButton.getLayoutParams();
+ params.gravity = Gravity.TOP | (RecentsView.FLIP_RECENTS ? Gravity.START : Gravity.END);
+ mClearAllButton.setLayoutParams(params);
mRecentsView.setClearAllButton(mClearAllButton);
}
@@ -53,8 +58,9 @@ public class RecentsViewContainer extends InsettableFrameLayout {
mRecentsView.getTaskSize(mTempRect);
mClearAllButton.setTranslationX(
- (mClearAllButton.getMeasuredWidth() - getResources().getDimension(
- R.dimen.clear_all_container_width)) / 2);
+ (mRecentsView.isRtl() ? 1 : -1) *
+ (getResources().getDimension(R.dimen.clear_all_container_width)
+ - mClearAllButton.getMeasuredWidth()) / 2);
mClearAllButton.setTranslationY(
mTempRect.top + (mTempRect.height() - mClearAllButton.getMeasuredHeight()) / 2
- mClearAllButton.getTop());