am 6283a125: Merge "ButtonBarLayout: Let allowStacking to be set through code" into mnc-dev
* commit '6283a12579835c39969e1f550304b899e3659c7d': ButtonBarLayout: Let allowStacking to be set through code
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user