Merge "Distinguish mDragHandleProgress from mMidProgress" into ub-launcher3-qt-r1-dev
This commit is contained in:
commit
cfbdb91a7f
1 file changed
+11
-5
@@ -74,6 +74,9 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
|
|||||||
private int mMidAlpha;
|
private int mMidAlpha;
|
||||||
private float mMidProgress;
|
private float mMidProgress;
|
||||||
|
|
||||||
|
// The progress at which the drag handle starts moving up with the shelf.
|
||||||
|
private float mDragHandleProgress;
|
||||||
|
|
||||||
private Interpolator mBeforeMidProgressColorInterpolator = ACCEL;
|
private Interpolator mBeforeMidProgressColorInterpolator = ACCEL;
|
||||||
private Interpolator mAfterMidProgressColorInterpolator = ACCEL;
|
private Interpolator mAfterMidProgressColorInterpolator = ACCEL;
|
||||||
|
|
||||||
@@ -150,15 +153,16 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
|
|||||||
|
|
||||||
if ((OVERVIEW.getVisibleElements(mLauncher) & ALL_APPS_HEADER_EXTRA) == 0) {
|
if ((OVERVIEW.getVisibleElements(mLauncher) & ALL_APPS_HEADER_EXTRA) == 0) {
|
||||||
mMidProgress = 1;
|
mMidProgress = 1;
|
||||||
|
mDragHandleProgress = 1;
|
||||||
mMidAlpha = 0;
|
mMidAlpha = 0;
|
||||||
} else {
|
} else {
|
||||||
mMidAlpha = Themes.getAttrInteger(getContext(), R.attr.allAppsInterimScrimAlpha);
|
mMidAlpha = Themes.getAttrInteger(getContext(), R.attr.allAppsInterimScrimAlpha);
|
||||||
|
mMidProgress = OVERVIEW.getVerticalProgress(mLauncher);
|
||||||
Rect hotseatPadding = dp.getHotseatLayoutPadding();
|
Rect hotseatPadding = dp.getHotseatLayoutPadding();
|
||||||
int hotseatSize = dp.hotseatBarSizePx + dp.getInsets().bottom
|
int hotseatSize = dp.hotseatBarSizePx + dp.getInsets().bottom
|
||||||
- hotseatPadding.bottom - hotseatPadding.top;
|
- hotseatPadding.bottom - hotseatPadding.top;
|
||||||
float arrowTop = Math.min(hotseatSize, OverviewState.getDefaultSwipeHeight(dp));
|
float dragHandleTop = Math.min(hotseatSize, OverviewState.getDefaultSwipeHeight(dp));
|
||||||
mMidProgress = 1 - (arrowTop / mShiftRange);
|
mDragHandleProgress = 1 - (dragHandleTop / mShiftRange);
|
||||||
|
|
||||||
}
|
}
|
||||||
mTopOffset = dp.getInsets().top - mShelfOffset;
|
mTopOffset = dp.getInsets().top - mShelfOffset;
|
||||||
mShelfTopAtThreshold = mShiftRange * SCRIM_CATCHUP_THRESHOLD + mTopOffset;
|
mShelfTopAtThreshold = mShiftRange * SCRIM_CATCHUP_THRESHOLD + mTopOffset;
|
||||||
@@ -199,8 +203,6 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
|
|||||||
mProgress, mMidProgress, 1, mMidAlpha, 0, mBeforeMidProgressColorInterpolator));
|
mProgress, mMidProgress, 1, mMidAlpha, 0, mBeforeMidProgressColorInterpolator));
|
||||||
mShelfColor = setColorAlphaBound(mEndScrim, alpha);
|
mShelfColor = setColorAlphaBound(mEndScrim, alpha);
|
||||||
} else {
|
} else {
|
||||||
mDragHandleOffset += mShiftRange * (mMidProgress - mProgress);
|
|
||||||
|
|
||||||
// Note that these ranges and interpolators are inverted because progress goes 1 to 0.
|
// Note that these ranges and interpolators are inverted because progress goes 1 to 0.
|
||||||
int alpha = Math.round(
|
int alpha = Math.round(
|
||||||
Utilities.mapToRange(mProgress, (float) 0, mMidProgress, (float) mEndAlpha,
|
Utilities.mapToRange(mProgress, (float) 0, mMidProgress, (float) mEndAlpha,
|
||||||
@@ -212,6 +214,10 @@ public class ShelfScrimView extends ScrimView implements NavigationModeChangeLis
|
|||||||
(float) 0, LINEAR));
|
(float) 0, LINEAR));
|
||||||
mRemainingScreenColor = setColorAlphaBound(mScrimColor, remainingScrimAlpha);
|
mRemainingScreenColor = setColorAlphaBound(mScrimColor, remainingScrimAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mProgress < mDragHandleProgress) {
|
||||||
|
mDragHandleOffset += mShiftRange * (mDragHandleProgress - mProgress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user