Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0f0054a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Manually set mLastTileBottom when not laying out" into tm-dev am:...

Merge "Manually set mLastTileBottom when not laying out" into tm-dev am: 78fd61c2 am: a9a14cea am: bf90ec86 am: 10b04924

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18091104



Change-Id: I02cf9b1bc567efe8f751177b9a49bdfd01e09f11
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 25a3fa9d 10b04924
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import com.android.systemui.R;
import com.android.systemui.qs.QSPanel.QSTileLayout;
import com.android.systemui.qs.QSPanelControllerBase.TileRecord;
import com.android.systemui.qs.tileimpl.HeightOverrideable;
import com.android.systemui.qs.tileimpl.QSTileViewImplKt;

import java.util.ArrayList;

@@ -242,7 +243,12 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
                record.tileView.setLeftTopRightBottom(left, top, right, bottom);
            }
            record.tileView.setPosition(i);
            mLastTileBottom = bottom;
            if (forLayout) {
                mLastTileBottom = record.tileView.getBottom();
            } else {
                float scale = QSTileViewImplKt.constrainSquishiness(mSquishinessFraction);
                mLastTileBottom = top + (int) (record.tileView.getMeasuredHeight() * scale);
            }
        }
    }

+5 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ open class QSTileViewImpl @JvmOverloads constructor(
        }
        // Limit how much we affect the height, so we don't have rounding artifacts when the tile
        // is too short.
        val constrainedSquishiness = 0.1f + squishinessFraction * 0.9f
        val constrainedSquishiness = constrainSquishiness(squishinessFraction)
        bottom = top + (actualHeight * constrainedSquishiness).toInt()
        scrollY = (actualHeight - height) / 2
    }
@@ -678,6 +678,10 @@ internal object SubtitleArrayMapping {
    }
}

fun constrainSquishiness(squish: Float): Float {
    return 0.1f + squish * 0.9f
}

private fun colorValuesHolder(name: String, vararg values: Int): PropertyValuesHolder {
    return PropertyValuesHolder.ofInt(name, *values).apply {
        setEvaluator(ArgbEvaluator.getInstance())