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

Commit 6283a125 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "ButtonBarLayout: Let allowStacking to be set through code" into mnc-dev

parents 6ddc34e5 5658328d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import com.android.internal.R;
 */
public class ButtonBarLayout extends LinearLayout {
    /** Whether the current configuration allows stacking. */
    private final boolean mAllowStacking;
    private boolean mAllowStacking;

    private int mLastWidthSize = -1;

@@ -43,6 +43,16 @@ public class ButtonBarLayout extends LinearLayout {
        ta.recycle();
    }

    public void setAllowStacking(boolean allowStacking) {
        if (mAllowStacking != allowStacking) {
            mAllowStacking = allowStacking;
            if (!mAllowStacking && getOrientation() == LinearLayout.VERTICAL) {
                setStacked(false);
            }
            requestLayout();
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+2 −0
Original line number Diff line number Diff line
@@ -2315,4 +2315,6 @@
  <java-symbol type="plurals" name="selected_count" />
  <java-symbol type="drawable" name="ic_dialog_alert_material" />

  <java-symbol type="bool" name="allow_stacked_button_bar" />

</resources>