Loading packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ public class Divider extends SystemUI { private void addDivider(Configuration configuration) { mView = (DividerView) LayoutInflater.from(mContext).inflate(R.layout.docked_stack_divider, null); mView.injectDependencies(mWindowManager, mDividerState); mView.setVisibility(mVisible ? View.VISIBLE : View.INVISIBLE); mView.setMinimizedDockStack(mMinimized, mHomeStackResizable); final int size = mContext.getResources().getDimensionPixelSize( Loading @@ -87,7 +88,6 @@ public class Divider extends SystemUI { final int width = landscape ? size : MATCH_PARENT; final int height = landscape ? MATCH_PARENT : size; mWindowManager.add(mView, width, height); mView.injectDependencies(mWindowManager, mDividerState); } private void removeDivider() { Loading packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ package com.android.systemui.stackdivider; public class DividerState { public boolean animateAfterRecentsDrawn; public boolean growAfterRecentsDrawn; public float mRatioPositionBeforeMinimized; } packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +19 −17 Original line number Diff line number Diff line Loading @@ -364,6 +364,17 @@ public class DividerView extends FrameLayout implements OnTouchListener, public void injectDependencies(DividerWindowManager windowManager, DividerState dividerState) { mWindowManager = windowManager; mState = dividerState; // Set the previous position ratio before minimized state after attaching this divider if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } int position = (int) (mState.mRatioPositionBeforeMinimized * (isHorizontalDivision() ? mDisplayHeight : mDisplayWidth)); mSnapAlgorithm = null; initializeSnapAlgorithm(); mDividerPositionBeforeMinimized = mSnapAlgorithm.calculateNonDismissingSnapTarget(position) .position; } public WindowManagerProxy getWindowManagerProxy() { Loading Loading @@ -719,19 +730,12 @@ public class DividerView extends FrameLayout implements OnTouchListener, mHandle.setAlpha(minimized ? 0f : 1f); mDockedStackMinimized = minimized; } else if (mDockedStackMinimized != minimized) { if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); if (mIsInMinimizeInteraction != minimized) { if (minimized) { mIsInMinimizeInteraction = true; mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, mDividerSize); int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); } else { Loading Loading @@ -776,7 +780,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, mIsInMinimizeInteraction = true; if (minimized && (mCurrentAnimator == null || !mCurrentAnimator.isRunning()) && (mDividerPositionBeforeMinimized <= 0 || !mAdjustedForIme)) { mDividerPositionBeforeMinimized = getCurrentPosition(); savePositionBeforeMinimized(); } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; Loading Loading @@ -836,8 +840,14 @@ public class DividerView extends FrameLayout implements OnTouchListener, // Only get new position if home stack is resizable, ime is open and not minimized // (including the animation) if (mHomeStackResizable && adjustedForIme && !mIsInMinimizeInteraction) { mDividerPositionBeforeMinimized = getCurrentPosition(); savePositionBeforeMinimized(); } } private void savePositionBeforeMinimized() { mDividerPositionBeforeMinimized = getCurrentPosition(); mState.mRatioPositionBeforeMinimized = (float) mDividerPositionBeforeMinimized / (isHorizontalDivision() ? mDisplayHeight : mDisplayWidth); } private void resetBackground() { Loading Loading @@ -1198,14 +1208,6 @@ public class DividerView extends FrameLayout implements OnTouchListener, mDockSide, mDividerSize); mEntranceAnimationRunning = true; // Insets might not have been fetched yet, so fetch manually if needed. if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); mSnapAlgorithm = null; mMinimizedSnapAlgorithm = null; initializeSnapAlgorithm(); } resizeStack(position, mSnapAlgorithm.getMiddleTarget().position, mSnapAlgorithm.getMiddleTarget()); } Loading Loading
packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ public class Divider extends SystemUI { private void addDivider(Configuration configuration) { mView = (DividerView) LayoutInflater.from(mContext).inflate(R.layout.docked_stack_divider, null); mView.injectDependencies(mWindowManager, mDividerState); mView.setVisibility(mVisible ? View.VISIBLE : View.INVISIBLE); mView.setMinimizedDockStack(mMinimized, mHomeStackResizable); final int size = mContext.getResources().getDimensionPixelSize( Loading @@ -87,7 +88,6 @@ public class Divider extends SystemUI { final int width = landscape ? size : MATCH_PARENT; final int height = landscape ? MATCH_PARENT : size; mWindowManager.add(mView, width, height); mView.injectDependencies(mWindowManager, mDividerState); } private void removeDivider() { Loading
packages/SystemUI/src/com/android/systemui/stackdivider/DividerState.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ package com.android.systemui.stackdivider; public class DividerState { public boolean animateAfterRecentsDrawn; public boolean growAfterRecentsDrawn; public float mRatioPositionBeforeMinimized; }
packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +19 −17 Original line number Diff line number Diff line Loading @@ -364,6 +364,17 @@ public class DividerView extends FrameLayout implements OnTouchListener, public void injectDependencies(DividerWindowManager windowManager, DividerState dividerState) { mWindowManager = windowManager; mState = dividerState; // Set the previous position ratio before minimized state after attaching this divider if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } int position = (int) (mState.mRatioPositionBeforeMinimized * (isHorizontalDivision() ? mDisplayHeight : mDisplayWidth)); mSnapAlgorithm = null; initializeSnapAlgorithm(); mDividerPositionBeforeMinimized = mSnapAlgorithm.calculateNonDismissingSnapTarget(position) .position; } public WindowManagerProxy getWindowManagerProxy() { Loading Loading @@ -719,19 +730,12 @@ public class DividerView extends FrameLayout implements OnTouchListener, mHandle.setAlpha(minimized ? 0f : 1f); mDockedStackMinimized = minimized; } else if (mDockedStackMinimized != minimized) { if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; initializeSnapAlgorithm(); if (mIsInMinimizeInteraction != minimized) { if (minimized) { mIsInMinimizeInteraction = true; mDividerPositionBeforeMinimized = DockedDividerUtils.calculateMiddlePosition( isHorizontalDivision(), mStableInsets, mDisplayWidth, mDisplayHeight, mDividerSize); int position = mMinimizedSnapAlgorithm.getMiddleTarget().position; resizeStack(position, position, mMinimizedSnapAlgorithm.getMiddleTarget()); } else { Loading Loading @@ -776,7 +780,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, mIsInMinimizeInteraction = true; if (minimized && (mCurrentAnimator == null || !mCurrentAnimator.isRunning()) && (mDividerPositionBeforeMinimized <= 0 || !mAdjustedForIme)) { mDividerPositionBeforeMinimized = getCurrentPosition(); savePositionBeforeMinimized(); } mMinimizedSnapAlgorithm = null; mDockedStackMinimized = minimized; Loading Loading @@ -836,8 +840,14 @@ public class DividerView extends FrameLayout implements OnTouchListener, // Only get new position if home stack is resizable, ime is open and not minimized // (including the animation) if (mHomeStackResizable && adjustedForIme && !mIsInMinimizeInteraction) { mDividerPositionBeforeMinimized = getCurrentPosition(); savePositionBeforeMinimized(); } } private void savePositionBeforeMinimized() { mDividerPositionBeforeMinimized = getCurrentPosition(); mState.mRatioPositionBeforeMinimized = (float) mDividerPositionBeforeMinimized / (isHorizontalDivision() ? mDisplayHeight : mDisplayWidth); } private void resetBackground() { Loading Loading @@ -1198,14 +1208,6 @@ public class DividerView extends FrameLayout implements OnTouchListener, mDockSide, mDividerSize); mEntranceAnimationRunning = true; // Insets might not have been fetched yet, so fetch manually if needed. if (mStableInsets.isEmpty()) { SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets); mSnapAlgorithm = null; mMinimizedSnapAlgorithm = null; initializeSnapAlgorithm(); } resizeStack(position, mSnapAlgorithm.getMiddleTarget().position, mSnapAlgorithm.getMiddleTarget()); } Loading