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

Commit 9d9581f5 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix toolbar height, list divider alpha, action item padding

BUG: 17487305
BUG: 17470290
BUG: 17486967
Change-Id: Ib0cb4308f9d57e730504bdeb125662b648cad0f7
parent 37ccf18b
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.widget;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
@@ -582,6 +583,8 @@ public class ActionMenuPresenter extends BaseMenuPresenter
    }

    private class OverflowMenuButton extends ImageButton implements ActionMenuView.ActionMenuChildView {
        private final float[] mTempPts = new float[2];

        public OverflowMenuButton(Context context) {
            super(context, null, com.android.internal.R.attr.actionOverflowButtonStyle);

@@ -649,20 +652,21 @@ public class ActionMenuPresenter extends BaseMenuPresenter
        }

        @Override
        protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
            super.onLayout(changed, left, top, right, bottom);
        protected boolean setFrame(int l, int t, int r, int b) {
            final boolean changed = super.setFrame(l, t, r, b);

            // Set up the hotspot bounds to be centered on the image.
            final Drawable d = getDrawable();
            final Drawable bg = getBackground();
            if (d != null && bg != null) {
                final Rect bounds = d.getBounds();
                final int height = bottom - top;
                final int offset = (height - bounds.width()) / 2;
                final int hotspotLeft = bounds.left - offset;
                final int hotspotRight = bounds.right + offset;
                bg.setHotspotBounds(hotspotLeft, 0, hotspotRight, height);
                final float[] pts = mTempPts;
                pts[0] = d.getBounds().centerX();
                getImageMatrix().mapPoints(pts);
                final int offset =  (int) pts[0] - getWidth() / 2;
                bg.setHotspotBounds(offset, 0, getWidth() + offset, getHeight());
            }

            return changed;
        }
    }

+58 B (136 B)
Loading image diff...
+58 B (136 B)
Loading image diff...
+58 B (136 B)
Loading image diff...
+58 B (136 B)
Loading image diff...
Loading