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

Commit f786805a authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Respect padding when positioning custom view.

Fixes http://b/3164071

Change-Id: I74700fecf7e9f4785e8e944b2660724b3d270b0d
parent 084f3ae9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -815,7 +815,9 @@ public class ActionBarView extends ViewGroup {
            int ypos = 0;
            int ypos = 0;
            switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
            switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
                case Gravity.CENTER_VERTICAL:
                case Gravity.CENTER_VERTICAL:
                    ypos = ((mBottom - mTop) - mCustomNavView.getMeasuredHeight()) / 2;
                    final int paddedTop = mTop + getPaddingTop();
                    final int paddedBottom = mBottom - getPaddingBottom();
                    ypos = ((paddedBottom - paddedTop) - mCustomNavView.getMeasuredHeight()) / 2;
                    break;
                    break;
                case Gravity.TOP:
                case Gravity.TOP:
                    ypos = getPaddingTop() + topMargin;
                    ypos = getPaddingTop() + topMargin;