Loading core/java/android/view/ViewRootImpl.java +6 −0 Original line number Diff line number Diff line Loading @@ -1649,6 +1649,9 @@ public final class ViewRootImpl implements ViewParent, mLastScrolledFocus.clear(); } mScrollY = mCurScrollY = 0; if (mView instanceof RootViewSurfaceTaker) { ((RootViewSurfaceTaker) mView).onRootViewScrollYChanged(mCurScrollY); } if (mScroller != null) { mScroller.abortAnimation(); } Loading Loading @@ -2419,6 +2422,9 @@ public final class ViewRootImpl implements ViewParent, if (mCurScrollY != curScrollY) { mCurScrollY = curScrollY; fullRedrawNeeded = true; if (mView instanceof RootViewSurfaceTaker) { ((RootViewSurfaceTaker) mView).onRootViewScrollYChanged(mCurScrollY); } } final float appScale = mAttachInfo.mApplicationScale; Loading core/java/com/android/internal/view/RootViewSurfaceTaker.java +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.view; import android.view.InputQueue; Loading @@ -10,4 +25,5 @@ public interface RootViewSurfaceTaker { void setSurfaceFormat(int format); void setSurfaceKeepScreenOn(boolean keepOn); InputQueue.Callback willYouTakeTheInputQueue(); void onRootViewScrollYChanged(int scrollY); } policy/src/com/android/internal/policy/impl/PhoneWindow.java +20 −0 Original line number Diff line number Diff line Loading @@ -2190,6 +2190,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private int mLastBottomInset = 0; private int mLastRightInset = 0; private int mRootScrollY = 0; public DecorView(Context context, int featureId) { super(context); Loading Loading @@ -2891,6 +2892,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { view.setId(id); addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, height, Gravity.START | verticalGravity)); updateColorViewTranslations(); } } else { int vis = show ? VISIBLE : INVISIBLE; Loading @@ -2907,6 +2909,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return view; } private void updateColorViewTranslations() { // Put the color views back in place when they get moved off the screen // due to the the ViewRootImpl panning. int rootScrollY = mRootScrollY; if (mStatusColorView != null) { mStatusColorView.setTranslationY(rootScrollY > 0 ? rootScrollY : 0); } if (mNavigationColorView != null) { mNavigationColorView.setTranslationY(rootScrollY < 0 ? rootScrollY : 0); } } private WindowInsets updateStatusGuard(WindowInsets insets) { boolean showStatusGuard = false; // Show the status guard when the non-overlay contextual action bar is showing Loading Loading @@ -3165,6 +3179,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { else PhoneWindow.this.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } @Override public void onRootViewScrollYChanged(int rootScrollY) { mRootScrollY = rootScrollY; updateColorViewTranslations(); } /** * Clears out internal reference when the action mode is destroyed. */ Loading Loading
core/java/android/view/ViewRootImpl.java +6 −0 Original line number Diff line number Diff line Loading @@ -1649,6 +1649,9 @@ public final class ViewRootImpl implements ViewParent, mLastScrolledFocus.clear(); } mScrollY = mCurScrollY = 0; if (mView instanceof RootViewSurfaceTaker) { ((RootViewSurfaceTaker) mView).onRootViewScrollYChanged(mCurScrollY); } if (mScroller != null) { mScroller.abortAnimation(); } Loading Loading @@ -2419,6 +2422,9 @@ public final class ViewRootImpl implements ViewParent, if (mCurScrollY != curScrollY) { mCurScrollY = curScrollY; fullRedrawNeeded = true; if (mView instanceof RootViewSurfaceTaker) { ((RootViewSurfaceTaker) mView).onRootViewScrollYChanged(mCurScrollY); } } final float appScale = mAttachInfo.mApplicationScale; Loading
core/java/com/android/internal/view/RootViewSurfaceTaker.java +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.view; import android.view.InputQueue; Loading @@ -10,4 +25,5 @@ public interface RootViewSurfaceTaker { void setSurfaceFormat(int format); void setSurfaceKeepScreenOn(boolean keepOn); InputQueue.Callback willYouTakeTheInputQueue(); void onRootViewScrollYChanged(int scrollY); }
policy/src/com/android/internal/policy/impl/PhoneWindow.java +20 −0 Original line number Diff line number Diff line Loading @@ -2190,6 +2190,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private int mLastBottomInset = 0; private int mLastRightInset = 0; private int mRootScrollY = 0; public DecorView(Context context, int featureId) { super(context); Loading Loading @@ -2891,6 +2892,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { view.setId(id); addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, height, Gravity.START | verticalGravity)); updateColorViewTranslations(); } } else { int vis = show ? VISIBLE : INVISIBLE; Loading @@ -2907,6 +2909,18 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { return view; } private void updateColorViewTranslations() { // Put the color views back in place when they get moved off the screen // due to the the ViewRootImpl panning. int rootScrollY = mRootScrollY; if (mStatusColorView != null) { mStatusColorView.setTranslationY(rootScrollY > 0 ? rootScrollY : 0); } if (mNavigationColorView != null) { mNavigationColorView.setTranslationY(rootScrollY < 0 ? rootScrollY : 0); } } private WindowInsets updateStatusGuard(WindowInsets insets) { boolean showStatusGuard = false; // Show the status guard when the non-overlay contextual action bar is showing Loading Loading @@ -3165,6 +3179,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { else PhoneWindow.this.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } @Override public void onRootViewScrollYChanged(int rootScrollY) { mRootScrollY = rootScrollY; updateColorViewTranslations(); } /** * Clears out internal reference when the action mode is destroyed. */ Loading