Merge "Appear notifications at min height instead of 0 height" into sc-dev
This commit is contained in:
@@ -1143,16 +1143,18 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
||||
*/
|
||||
private void updateStackPosition() {
|
||||
// Consider interpolating from an mExpansionStartY for use on lockscreen and AOD
|
||||
final float stackY = MathUtils.lerp(0, mTopPadding, mAmbientState.getExpansionFraction());
|
||||
final float fraction = mAmbientState.getExpansionFraction();
|
||||
final float stackY = MathUtils.lerp(0, mTopPadding, fraction);
|
||||
mAmbientState.setStackY(stackY);
|
||||
if (mOnStackYChanged != null) {
|
||||
mOnStackYChanged.run();
|
||||
}
|
||||
|
||||
final float shadeBottom = getHeight() - getEmptyBottomMargin();
|
||||
mAmbientState.setStackEndHeight(shadeBottom - mTopPadding);
|
||||
final float stackEndHeight = getHeight() - getEmptyBottomMargin() - mTopPadding;
|
||||
mAmbientState.setStackEndHeight(stackEndHeight);
|
||||
mAmbientState.setStackHeight(
|
||||
MathUtils.lerp(0, shadeBottom - mTopPadding, mAmbientState.getExpansionFraction()));
|
||||
MathUtils.lerp(stackEndHeight * StackScrollAlgorithm.START_FRACTION,
|
||||
stackEndHeight, fraction));
|
||||
}
|
||||
|
||||
void setOnStackYChanged(Runnable onStackYChanged) {
|
||||
|
||||
@@ -42,6 +42,8 @@ import java.util.List;
|
||||
*/
|
||||
public class StackScrollAlgorithm {
|
||||
|
||||
public static final float START_FRACTION = 0.3f;
|
||||
|
||||
private static final String LOG_TAG = "StackScrollAlgorithm";
|
||||
private final ViewGroup mHostView;
|
||||
|
||||
@@ -442,7 +444,8 @@ public class StackScrollAlgorithm {
|
||||
maxViewHeight = algorithmState.viewHeightBeforeShelf;
|
||||
}
|
||||
}
|
||||
viewState.height = (int) MathUtils.lerp(0, maxViewHeight, expansionFraction);
|
||||
viewState.height = (int) MathUtils.lerp(maxViewHeight * START_FRACTION, maxViewHeight,
|
||||
expansionFraction);
|
||||
}
|
||||
|
||||
currentYPosition += viewState.height + expansionFraction * mPaddingBetweenElements;
|
||||
|
||||
Reference in New Issue
Block a user