diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-23 07:23:07 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-23 07:23:07 +0000 |
commit | 4ac63b28ced5d5b09eaae39adca68377a2a7ef5b (patch) | |
tree | 190b1a5377bf6dfc836e4be57767d0cd512c6bf2 /quickstep/src/com/android/quickstep/fallback/RecentsRootView.java | |
parent | 8102503413976f42f825aacda49af53a5483933b (diff) | |
parent | d00202ed3306950264be533cb2e8a171f58f7930 (diff) | |
download | android_packages_apps_Trebuchet-4ac63b28ced5d5b09eaae39adca68377a2a7ef5b.tar.gz android_packages_apps_Trebuchet-4ac63b28ced5d5b09eaae39adca68377a2a7ef5b.tar.bz2 android_packages_apps_Trebuchet-4ac63b28ced5d5b09eaae39adca68377a2a7ef5b.zip |
Snap for 4799153 from d00202ed3306950264be533cb2e8a171f58f7930 to pi-release
Change-Id: I72cfd121a4f78f4f1c44a5989a07bc9926593a2c
Diffstat (limited to 'quickstep/src/com/android/quickstep/fallback/RecentsRootView.java')
-rw-r--r-- | quickstep/src/com/android/quickstep/fallback/RecentsRootView.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsRootView.java b/quickstep/src/com/android/quickstep/fallback/RecentsRootView.java index 7aaa88c38..ca8c2520c 100644 --- a/quickstep/src/com/android/quickstep/fallback/RecentsRootView.java +++ b/quickstep/src/com/android/quickstep/fallback/RecentsRootView.java @@ -17,6 +17,7 @@ package com.android.quickstep.fallback; import android.annotation.TargetApi; import android.content.Context; +import android.graphics.Point; import android.graphics.Rect; import android.util.AttributeSet; @@ -31,18 +32,37 @@ public class RecentsRootView extends BaseDragLayer<RecentsActivity> { private final RecentsActivity mActivity; + private final Point mLastKnownSize = new Point(10, 10); + public RecentsRootView(Context context, AttributeSet attrs) { - super(context, attrs); + super(context, attrs, 1 /* alphaChannelCount */); mActivity = (RecentsActivity) BaseActivity.fromContext(context); setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | SYSTEM_UI_FLAG_LAYOUT_STABLE); } + public Point getLastKnownSize() { + return mLastKnownSize; + } + public void setup() { mControllers = new TouchController[] { new RecentsTaskController(mActivity) }; } + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + // Check size changes before the actual measure, to avoid multiple measure calls. + int width = MeasureSpec.getSize(widthMeasureSpec); + int height = MeasureSpec.getSize(heightMeasureSpec); + if (mLastKnownSize.x != width || mLastKnownSize.y != height) { + mLastKnownSize.set(width, height); + mActivity.onRootViewSizeChanged(); + } + + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + @TargetApi(23) @Override protected boolean fitSystemWindows(Rect insets) { @@ -62,4 +82,9 @@ public class RecentsRootView extends BaseDragLayer<RecentsActivity> { setBackground(insets.top == 0 ? null : Themes.getAttrDrawable(getContext(), R.attr.workspaceStatusBarScrim)); } + + public void dispatchInsets() { + mActivity.getDeviceProfile().updateInsets(mInsets); + super.setInsets(mInsets); + } }
\ No newline at end of file |