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

Commit b24dbfef authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Show ripples for QS tiles and footer buttons." into pi-dev

parents 4045fdc0 3033099f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    android:layout_width="match_parent"
    android:layout_height="@dimen/qs_footer_height"
    android:elevation="4dp"
    android:background="@android:color/transparent"
    android:baselineAligned="false"
    android:clickable="false"
    android:clipChildren="false"
+1 −1
Original line number Diff line number Diff line
@@ -56,9 +56,9 @@
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/qs_footer_height"
        android:elevation="4dp"
        android:background="@android:color/transparent"
    />


    <include layout="@layout/quick_status_bar_expanded_header" />

    <include layout="@layout/qs_footer_impl" />
+5 −9
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@ package com.android.systemui.qs.tileimpl;

import static com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -122,14 +121,14 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
    private void setRipple(RippleDrawable tileBackground) {
        mRipple = tileBackground;
        if (getWidth() != 0) {
            updateRippleSize(getWidth(), getHeight());
            updateRippleSize();
        }
    }

    private void updateRippleSize(int width, int height) {
    private void updateRippleSize() {
        // center the touch feedback on the center of the icon, and dial it down a bit
        final int cx = width / 2;
        final int cy = mIconFrame.getMeasuredHeight() / 2;
        final int cx = mIconFrame.getMeasuredWidth() / 2 + mIconFrame.getLeft();
        final int cy = mIconFrame.getMeasuredHeight() / 2 + mIconFrame.getTop();
        final int rad = (int) (mIcon.getHeight() * .85f);
        mRipple.setHotspotBounds(cx - rad, cy - rad, cx + rad, cy + rad);
    }
@@ -151,11 +150,8 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        final int w = getMeasuredWidth();
        final int h = getMeasuredHeight();

        if (mRipple != null) {
            updateRippleSize(w, h);
            updateRippleSize();
        }
    }