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

Commit 612b8472 authored by Michael W's avatar Michael W
Browse files

SystemUI: Recents: Improve code for long app titles being overlapped

* Take all buttons into account when calculating the margin for title
* Don't check every combination of buttons but just add a margin for
  each of them

Change-Id: I8e3da14ee00f0d16667866585cceef48ef1348c4
parent 7bcc40e3
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -282,11 +282,9 @@ public class TaskViewHeader extends FrameLayout
        lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL);
        lp.setMarginStart(mHeaderBarHeight);
        lp.setMarginEnd(secondaryButton != null && tertiaryButton != null
                ? 3 * mHeaderBarHeight
                : secondaryButton != null || tertiaryButton != null
                ? 2 * mHeaderBarHeight
                : mHeaderBarHeight);
        lp.setMarginEnd(mHeaderBarHeight +
                ((secondaryButton != null ? mHeaderBarHeight : 0)
                + (tertiaryButton != null ? mHeaderBarHeight : 0)));
        title.setLayoutParams(lp);
        if (secondaryButton != null) {
            lp = new FrameLayout.LayoutParams(mHeaderBarHeight, mHeaderBarHeight, Gravity.END);