Merge "Clean up button bar styles"

This commit is contained in:
Adam Powell
2010-12-06 17:41:47 -08:00
committed by Android (Google) Code Review
12 changed files with 200 additions and 369 deletions

View File

@@ -1949,7 +1949,7 @@
type="int"
transient="false"
volatile="false"
value="16843555"
value="16843553"
static="true"
final="true"
deprecated="not deprecated"
@@ -1960,7 +1960,7 @@
type="int"
transient="false"
volatile="false"
value="16843554"
value="16843552"
static="true"
final="true"
deprecated="not deprecated"
@@ -1971,7 +1971,7 @@
type="int"
transient="false"
volatile="false"
value="16843556"
value="16843554"
static="true"
final="true"
deprecated="not deprecated"
@@ -2088,17 +2088,6 @@
visibility="public"
>
</field>
<field name="alertDialogButtonGroupStyle"
type="int"
transient="false"
volatile="false"
value="16843547"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="alertDialogStyle"
type="int"
transient="false"
@@ -2180,7 +2169,7 @@
type="int"
transient="false"
volatile="false"
value="16843568"
value="16843566"
static="true"
final="true"
deprecated="not deprecated"
@@ -2312,7 +2301,7 @@
type="int"
transient="false"
volatile="false"
value="16843563"
value="16843561"
static="true"
final="true"
deprecated="not deprecated"
@@ -2389,7 +2378,7 @@
type="int"
transient="false"
volatile="false"
value="16843552"
value="16843550"
static="true"
final="true"
deprecated="not deprecated"
@@ -2499,7 +2488,7 @@
type="int"
transient="false"
volatile="false"
value="16843565"
value="16843563"
static="true"
final="true"
deprecated="not deprecated"
@@ -2543,7 +2532,7 @@
type="int"
transient="false"
volatile="false"
value="16843580"
value="16843578"
static="true"
final="true"
deprecated="not deprecated"
@@ -2671,11 +2660,22 @@
visibility="public"
>
</field>
<field name="buttonGroupStyle"
<field name="buttonBarButtonStyle"
type="int"
transient="false"
volatile="false"
value="16843546"
value="16843582"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="buttonBarStyle"
type="int"
transient="false"
volatile="false"
value="16843581"
static="true"
final="true"
deprecated="not deprecated"
@@ -3577,7 +3577,7 @@
type="int"
transient="false"
volatile="false"
value="16843581"
value="16843579"
static="true"
final="true"
deprecated="not deprecated"
@@ -3588,7 +3588,7 @@
type="int"
transient="false"
volatile="false"
value="16843579"
value="16843577"
static="true"
final="true"
deprecated="not deprecated"
@@ -3929,7 +3929,7 @@
type="int"
transient="false"
volatile="false"
value="16843549"
value="16843547"
static="true"
final="true"
deprecated="not deprecated"
@@ -3984,7 +3984,7 @@
type="int"
transient="false"
volatile="false"
value="16843550"
value="16843548"
static="true"
final="true"
deprecated="not deprecated"
@@ -4875,7 +4875,7 @@
type="int"
transient="false"
volatile="false"
value="16843548"
value="16843546"
static="true"
final="true"
deprecated="not deprecated"
@@ -4886,7 +4886,7 @@
type="int"
transient="false"
volatile="false"
value="16843566"
value="16843564"
static="true"
final="true"
deprecated="not deprecated"
@@ -5216,7 +5216,7 @@
type="int"
transient="false"
volatile="false"
value="16843561"
value="16843559"
static="true"
final="true"
deprecated="not deprecated"
@@ -5480,7 +5480,7 @@
type="int"
transient="false"
volatile="false"
value="16843582"
value="16843580"
static="true"
final="true"
deprecated="not deprecated"
@@ -6756,7 +6756,7 @@
type="int"
transient="false"
volatile="false"
value="16843567"
value="16843565"
static="true"
final="true"
deprecated="not deprecated"
@@ -7306,7 +7306,7 @@
type="int"
transient="false"
volatile="false"
value="16843562"
value="16843560"
static="true"
final="true"
deprecated="not deprecated"
@@ -7779,7 +7779,7 @@
type="int"
transient="false"
volatile="false"
value="16843575"
value="16843573"
static="true"
final="true"
deprecated="not deprecated"
@@ -7790,7 +7790,7 @@
type="int"
transient="false"
volatile="false"
value="16843576"
value="16843574"
static="true"
final="true"
deprecated="not deprecated"
@@ -7801,7 +7801,7 @@
type="int"
transient="false"
volatile="false"
value="16843577"
value="16843575"
static="true"
final="true"
deprecated="not deprecated"
@@ -7900,7 +7900,7 @@
type="int"
transient="false"
volatile="false"
value="16843573"
value="16843571"
static="true"
final="true"
deprecated="not deprecated"
@@ -7911,7 +7911,7 @@
type="int"
transient="false"
volatile="false"
value="16843574"
value="16843572"
static="true"
final="true"
deprecated="not deprecated"
@@ -8259,6 +8259,17 @@
visibility="public"
>
</field>
<field name="segmentedButtonStyle"
type="int"
transient="false"
volatile="false"
value="16843583"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="selectAllOnFocus"
type="int"
transient="false"
@@ -8285,7 +8296,7 @@
type="int"
transient="false"
volatile="false"
value="16843551"
value="16843549"
static="true"
final="true"
deprecated="not deprecated"
@@ -8439,7 +8450,7 @@
type="int"
transient="false"
volatile="false"
value="16843578"
value="16843576"
static="true"
final="true"
deprecated="not deprecated"
@@ -8692,7 +8703,7 @@
type="int"
transient="false"
volatile="false"
value="16843564"
value="16843562"
static="true"
final="true"
deprecated="not deprecated"
@@ -9627,7 +9638,7 @@
type="int"
transient="false"
volatile="false"
value="16843558"
value="16843556"
static="true"
final="true"
deprecated="not deprecated"
@@ -9638,7 +9649,7 @@
type="int"
transient="false"
volatile="false"
value="16843557"
value="16843555"
static="true"
final="true"
deprecated="not deprecated"
@@ -9660,7 +9671,7 @@
type="int"
transient="false"
volatile="false"
value="16843559"
value="16843557"
static="true"
final="true"
deprecated="not deprecated"
@@ -10078,7 +10089,7 @@
type="int"
transient="false"
volatile="false"
value="16843569"
value="16843567"
static="true"
final="true"
deprecated="not deprecated"
@@ -10089,7 +10100,7 @@
type="int"
transient="false"
volatile="false"
value="16843570"
value="16843568"
static="true"
final="true"
deprecated="not deprecated"
@@ -10100,7 +10111,7 @@
type="int"
transient="false"
volatile="false"
value="16843571"
value="16843569"
static="true"
final="true"
deprecated="not deprecated"
@@ -10111,7 +10122,7 @@
type="int"
transient="false"
volatile="false"
value="16843572"
value="16843570"
static="true"
final="true"
deprecated="not deprecated"
@@ -10188,7 +10199,7 @@
type="int"
transient="false"
volatile="false"
value="16843553"
value="16843551"
static="true"
final="true"
deprecated="not deprecated"
@@ -10650,7 +10661,7 @@
type="int"
transient="false"
volatile="false"
value="16843560"
value="16843558"
static="true"
final="true"
deprecated="not deprecated"
@@ -14387,6 +14398,72 @@
visibility="public"
>
</field>
<field name="Holo_ButtonBar"
type="int"
transient="false"
volatile="false"
value="16974050"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="Holo_ButtonBar_AlertDialog"
type="int"
transient="false"
volatile="false"
value="16974052"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="Holo_Light_ButtonBar"
type="int"
transient="false"
volatile="false"
value="16974051"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="Holo_Light_ButtonBar_AlertDialog"
type="int"
transient="false"
volatile="false"
value="16974053"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="Holo_Light_SegmentedButton"
type="int"
transient="false"
volatile="false"
value="16974055"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="Holo_SegmentedButton"
type="int"
transient="false"
volatile="false"
value="16974054"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="MediaButton"
type="int"
transient="false"
@@ -250330,7 +250407,7 @@
deprecated="not deprecated"
visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>

View File

@@ -16,7 +16,6 @@
package android.app;
import android.app.ActionBar.Tab;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
@@ -39,7 +38,7 @@ public abstract class ActionBar {
/**
* Standard navigation mode. Consists of either a logo or icon
* and title text with an optional subtitle. Clicking any of these elements
* will dispatch onActionItemSelected to the registered Callback with
* will dispatch onOptionsItemSelected to the host Activity with
* a MenuItem with item ID android.R.id.home.
*/
public static final int NAVIGATION_MODE_STANDARD = 0;

View File

@@ -1,260 +0,0 @@
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
/**
* @hide
*/
public class ButtonGroup extends LinearLayout {
private static final String LOG = "ButtonGroup";
private Drawable mDivider;
private int mDividerWidth;
private int mDividerHeight;
private int mButtonBackgroundRes;
private int mShowDividers;
/**
* Don't show any dividers.
*/
public static final int SHOW_DIVIDER_NONE = 0;
/**
* Show a divider at the beginning of the group.
*/
public static final int SHOW_DIVIDER_BEGINNING = 1;
/**
* Show dividers between each item in the group.
*/
public static final int SHOW_DIVIDER_MIDDLE = 2;
/**
* Show a divider at the end of the group.
*/
public static final int SHOW_DIVIDER_END = 4;
private final Rect mTempRect = new Rect();
public ButtonGroup(Context context) {
this(context, null);
}
public ButtonGroup(Context context, AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.buttonGroupStyle);
}
public ButtonGroup(Context context, AttributeSet attrs, int defStyleRes) {
super(context, attrs, defStyleRes);
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ButtonGroup, defStyleRes, 0);
setDividerDrawable(a.getDrawable(com.android.internal.R.styleable.ButtonGroup_divider));
mButtonBackgroundRes = a.getResourceId(
com.android.internal.R.styleable.ButtonGroup_buttonBackground, 0);
setShowDividers(a.getInt(com.android.internal.R.styleable.ButtonGroup_showDividers,
SHOW_DIVIDER_MIDDLE));
a.recycle();
}
/**
* Set how dividers should be shown between items in this button group.
*
* @param showDividers One or more of {@link #SHOW_DIVIDER_BEGINNING},
* {@link #SHOW_DIVIDER_MIDDLE}, or {@link #SHOW_DIVIDER_END},
* or {@link #SHOW_DIVIDER_NONE} to show no dividers.
*/
public void setShowDividers(int showDividers) {
if (showDividers != mShowDividers) {
requestLayout();
}
mShowDividers = showDividers;
}
/**
* @return A flag set indicating how dividers should be shown around items.
* @see #setShowDividers(int)
*/
public int getShowDividers() {
return mShowDividers;
}
/**
* Set a drawable to be used as a divider between items.
* @param divider Drawable that will divide each item.
*/
public void setDividerDrawable(Drawable divider) {
if (divider == mDivider) {
return;
}
mDivider = divider;
if (divider != null) {
mDividerWidth = divider.getIntrinsicWidth();
mDividerHeight = divider.getIntrinsicHeight();
} else {
mDividerWidth = 0;
mDividerHeight = 0;
}
requestLayout();
}
/**
* Retrieve the drawable used to draw dividers between items.
* @return The divider drawable
*/
public Drawable getDividerDrawable() {
return mDivider;
}
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
if (child instanceof Button && mButtonBackgroundRes != 0) {
// Preserve original padding as we change the background
final int paddingLeft = child.getPaddingLeft();
final int paddingRight = child.getPaddingRight();
final int paddingTop = child.getPaddingTop();
final int paddingBottom = child.getPaddingBottom();
child.setBackgroundResource(mButtonBackgroundRes);
child.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
}
super.addView(child, index, params);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Add the extra size that dividers contribute.
int dividerCount = 0;
if ((mShowDividers & SHOW_DIVIDER_MIDDLE) == SHOW_DIVIDER_MIDDLE) {
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
if (getChildAt(i).getVisibility() != GONE) {
dividerCount++;
}
}
dividerCount = Math.max(0, dividerCount);
}
if ((mShowDividers & SHOW_DIVIDER_BEGINNING) == SHOW_DIVIDER_BEGINNING) {
dividerCount++;
}
if ((mShowDividers & SHOW_DIVIDER_END) == SHOW_DIVIDER_END) {
dividerCount++;
}
if (getOrientation() == VERTICAL) {
final int dividerSize = mDividerHeight * dividerCount;
setMeasuredDimension(getMeasuredWidthAndState(),
resolveSizeAndState(getMeasuredHeight() + dividerSize, heightMeasureSpec,
getMeasuredHeightAndState()));
} else {
final int dividerSize = mDividerWidth * dividerCount;
setMeasuredDimension(resolveSizeAndState(getMeasuredWidth() + dividerSize,
widthMeasureSpec, getMeasuredWidthAndState()),
getMeasuredHeightAndState());
}
}
@Override
public void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
final boolean begin = (mShowDividers & SHOW_DIVIDER_BEGINNING) == SHOW_DIVIDER_BEGINNING;
final boolean middle = (mShowDividers & SHOW_DIVIDER_MIDDLE) == SHOW_DIVIDER_MIDDLE;
// Offset children to leave space for dividers.
if (getOrientation() == VERTICAL) {
int offset = begin ? mDividerHeight : 0;
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
child.offsetTopAndBottom(offset);
if (middle && child.getVisibility() != GONE) {
offset += mDividerHeight;
}
}
} else {
int offset = begin ? mDividerWidth : 0;
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
child.offsetLeftAndRight(offset);
if (middle && child.getVisibility() != GONE) {
offset += mDividerWidth;
}
}
}
}
@Override
public void dispatchDraw(Canvas canvas) {
if (mDivider == null) {
super.dispatchDraw(canvas);
return;
}
final boolean begin = (mShowDividers & SHOW_DIVIDER_BEGINNING) == SHOW_DIVIDER_BEGINNING;
final boolean middle = (mShowDividers & SHOW_DIVIDER_MIDDLE) == SHOW_DIVIDER_MIDDLE;
final boolean end = (mShowDividers & SHOW_DIVIDER_END) == SHOW_DIVIDER_END;
final boolean vertical = getOrientation() == VERTICAL;
final Rect bounds = mTempRect;
bounds.left = mPaddingLeft;
bounds.right = mRight - mLeft - mPaddingRight;
bounds.top = mPaddingTop;
bounds.bottom = mBottom - mTop - mPaddingBottom;
if (begin) {
if (vertical) {
bounds.bottom = bounds.top + mDividerHeight;
} else {
bounds.right = bounds.left + mDividerWidth;
}
mDivider.setBounds(bounds);
mDivider.draw(canvas);
}
final int childCount = getChildCount();
int i = 0;
while (i < childCount) {
final View child = getChildAt(i);
i++;
if ((middle && i < childCount && child.getVisibility() != GONE) || end) {
if (vertical) {
bounds.top = child.getBottom();
bounds.bottom = bounds.top + mDividerHeight;
} else {
bounds.left = child.getRight();
bounds.right = bounds.left + mDividerWidth;
}
mDivider.setBounds(bounds);
mDivider.draw(canvas);
}
}
super.dispatchDraw(canvas);
}
}

View File

@@ -95,8 +95,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
final int buttonStyle = a.getResourceId(
com.android.internal.R.styleable.Theme_actionButtonStyle, 0);
final int groupStyle = a.getResourceId(
com.android.internal.R.styleable.Theme_buttonGroupStyle, 0);
mDivider = a.getDrawable(com.android.internal.R.styleable.Theme_dividerVertical);
a.recycle();
a = context.obtainStyledAttributes(buttonStyle, com.android.internal.R.styleable.View);
@@ -104,11 +103,6 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
mButtonPaddingRight = a.getDimension(com.android.internal.R.styleable.View_paddingRight, 0);
a.recycle();
a = context.obtainStyledAttributes(groupStyle,
com.android.internal.R.styleable.ButtonGroup);
mDivider = a.getDrawable(com.android.internal.R.styleable.ButtonGroup_divider);
a.recycle();
mDividerPadding = DIVIDER_PADDING * res.getDisplayMetrics().density;
setBaselineAligned(false);

View File

@@ -105,8 +105,8 @@
android:layout_height="wrap_content"
android:minHeight="54dip"
android:orientation="vertical" >
<ButtonGroup
style="?android:attr/alertDialogButtonGroupStyle"
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@@ -124,18 +124,21 @@
android:layout_width="0dip"
android:layout_gravity="left"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<Button android:id="@+id/button3"
android:layout_width="0dip"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<Button android:id="@+id/button2"
android:layout_width="0dip"
android:layout_gravity="right"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<LinearLayout android:id="@+id/rightSpacer"
@@ -144,6 +147,6 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone" />
</ButtonGroup>
</LinearLayout>
</LinearLayout>
</com.android.internal.widget.WeightedLinearLayout>

View File

@@ -110,7 +110,7 @@
android:showDividers="beginning"
android:dividerPadding="16dip">
<LinearLayout
style="?android:attr/buttonGroupStyle"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@@ -128,21 +128,21 @@
android:layout_gravity="left"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<Button android:id="@+id/button3"
android:layout_width="0dip"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<Button android:id="@+id/button2"
android:layout_width="0dip"
android:layout_gravity="right"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<LinearLayout android:id="@+id/rightSpacer"
android:layout_width="0dip"

View File

@@ -106,8 +106,8 @@
android:layout_height="wrap_content"
android:minHeight="54dip"
android:orientation="vertical" >
<ButtonGroup
style="?android:attr/alertDialogButtonGroupStyle"
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@@ -125,18 +125,21 @@
android:layout_width="0dip"
android:layout_gravity="left"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<Button android:id="@+id/button3"
android:layout_width="0dip"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<Button android:id="@+id/button2"
android:layout_width="0dip"
android:layout_gravity="right"
android:layout_weight="1"
style="?android:attr/buttonBarButtonStyle"
android:maxLines="2"
android:layout_height="wrap_content" />
<LinearLayout android:id="@+id/rightSpacer"
@@ -145,6 +148,6 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone" />
</ButtonGroup>
</LinearLayout>
</LinearLayout>
</com.android.internal.widget.WeightedLinearLayout>

View File

@@ -110,7 +110,7 @@
android:showDividers="beginning"
android:dividerPadding="16dip">
<LinearLayout
style="?android:attr/buttonGroupStyle"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@@ -128,21 +128,21 @@
android:layout_gravity="left"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<Button android:id="@+id/button3"
android:layout_width="0dip"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<Button android:id="@+id/button2"
android:layout_width="0dip"
android:layout_gravity="right"
android:layout_weight="1"
android:maxLines="2"
style="?android:attr/borderlessButtonStyle"
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" />
<LinearLayout android:id="@+id/rightSpacer"
android:layout_width="0dip"

View File

@@ -611,11 +611,15 @@
<!-- Drawable to use for generic horizontal dividers. -->
<attr name="dividerHorizontal" format="reference" />
<!-- Style for button groups -->
<attr name="buttonGroupStyle" format="reference" />
<!-- Style for button bars -->
<attr name="buttonBarStyle" format="reference" />
<!-- Drawable for group button backgrounds -->
<attr name="groupButtonBackground" format="reference" />
<!-- Style for buttons within button bars -->
<attr name="buttonBarButtonStyle" format="reference" />
<!-- Style for segmented buttons - a container that houses several buttons
with the appearance of a singel button broken into segments. -->
<attr name="segmentedButtonStyle" format="reference" />
<!-- Background drawable for standalone items that need focus/pressed states. -->
<attr name="selectableItemBackground" format="reference" />
@@ -4569,15 +4573,6 @@
<attr name="maxWidth" />
</declare-styleable>
<declare-styleable name="ButtonGroup">
<!-- Drawable to use as a vertical divider between buttons. -->
<attr name="divider" />
<!-- Drawable to use as a background for buttons added to this group. -->
<attr name="buttonBackground" format="reference" />
<!-- Setting for which dividers to show. -->
<attr name="showDividers" />
</declare-styleable>
<declare-styleable name="ActionBar_LayoutParams">
<attr name="layout_gravity" />
</declare-styleable>

View File

@@ -1360,8 +1360,6 @@
<public type="attr" name="alertDialogTheme" />
<public type="attr" name="textLineHeight" />
<public type="attr" name="dividerVertical" />
<public type="attr" name="buttonGroupStyle" />
<public type="attr" name="alertDialogButtonGroupStyle" />
<public type="attr" name="homeAsUpIndicator" />
<public type="attr" name="enterFadeDuration" />
<public type="attr" name="exitFadeDuration" />
@@ -1397,6 +1395,9 @@
<public type="attr" name="borderlessButtonStyle" />
<public type="attr" name="dividerHorizontal" />
<public type="attr" name="itemPadding" />
<public type="attr" name="buttonBarStyle" />
<public type="attr" name="buttonBarButtonStyle" />
<public type="attr" name="segmentedButtonStyle" />
<public type="anim" name="animator_fade_in" />
<public type="anim" name="animator_fade_out" />
@@ -1560,6 +1561,12 @@
<public type="style" name="Widget.Holo.Button.Borderless" />
<public type="style" name="Widget.Holo.Tab" />
<public type="style" name="Widget.Holo.Light.Tab" />
<public type="style" name="Holo.ButtonBar" />
<public type="style" name="Holo.Light.ButtonBar" />
<public type="style" name="Holo.ButtonBar.AlertDialog" />
<public type="style" name="Holo.Light.ButtonBar.AlertDialog" />
<public type="style" name="Holo.SegmentedButton" />
<public type="style" name="Holo.Light.SegmentedButton" />
<public type="string" name="selectTextMode" />
</resources>

View File

@@ -937,6 +937,14 @@
<item name="android:background">@android:drawable/bottom_bar</item>
</style>
<!-- Style you can use with a container (typically a horizontal
LinearLayout) to get a "segmented button" background and spacing. -->
<style name="SegmentedButton">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:divider">?android:attr/dividerVertical</item>
<item name="android:showDividers">middle</item>
</style>
<!-- Style for the small popup windows that contain text selection anchors. -->
<style name="Widget.TextSelectHandle">
<item name="android:popupAnimationStyle">@android:style/Animation.TextSelectHandle</item>
@@ -1044,11 +1052,6 @@
<item name="android:textColor">@android:color/secondary_text_light</item>
</style>
<style name="Widget.ButtonGroup">
<item name="buttonBackground">?android:attr/groupButtonBackground</item>
<item name="showDividers"></item>
</style>
<!-- Begin Holo theme styles -->
<!-- Text Styles -->
@@ -1298,6 +1301,9 @@
<style name="Widget.Holo" parent="Widget">
</style>
<style name="Holo" />
<style name="Holo.Light" />
<style name="Widget.Holo.Button" parent="Widget.Button">
<item name="android:background">@android:drawable/btn_default_holo_dark</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
@@ -1339,13 +1345,18 @@
<item name="android:paddingRight">24dip</item>
</style>
<style name="Widget.Holo.ButtonGroup" parent="Widget.ButtonGroup">
<style name="Holo.ButtonBar" parent="ButtonBar">
<item name="divider">?android:attr/dividerVertical</item>
<item name="showDividers">middle</item>
<item name="dividerPadding">8dip</item>
<item name="background">@android:drawable/btn_default_holo_dark</item>
</style>
<style name="Widget.Holo.ButtonGroup.AlertDialog">
<style name="Holo.SegmentedButton">
<item name="android:background">@android:drawable/btn_default_holo_dark</item>
</style>
<style name="Holo.ButtonBar.AlertDialog">
<item name="android:background">@null</item>
</style>
@@ -1698,14 +1709,18 @@
<item name="android:paddingRight">24dip</item>
</style>
<style name="Widget.Holo.Light.ButtonGroup" parent="Widget.Holo.ButtonGroup">
<style name="Holo.Light.ButtonBar" parent="Holo.ButtonBar">
<item name="android:background">@android:drawable/btn_default_holo_light</item>
</style>
<style name="Widget.Holo.Light.ButtonGroup.AlertDialog">
<style name="Holo.Light.ButtonBar.AlertDialog">
<item name="android:background">@null</item>
</style>
<style name="Holo.Light.SegmentedButton">
<item name="android:background">@android:drawable/btn_default_holo_light</item>
</style>
<style name="Widget.Holo.Light.TextView" parent="Widget.TextView">
</style>

View File

@@ -90,7 +90,6 @@
<item name="buttonStyleToggle">@android:style/Widget.Button.Toggle</item>
<item name="groupButtonBackground">@null</item>
<item name="selectableItemBackground">@android:drawable/item_background</item>
<item name="borderlessButtonStyle">?android:attr/buttonStyle</item>
<item name="homeAsUpIndicator">@android:drawable/ic_ab_back_holo_dark</item>
@@ -145,7 +144,6 @@
<item name="alertDialogStyle">@android:style/AlertDialog</item>
<item name="dialogTheme">@android:style/Theme.Dialog</item>
<item name="alertDialogTheme">@android:style/Theme.Dialog.Alert</item>
<item name="alertDialogButtonGroupStyle">?android:attr/buttonGroupStyle</item>
<item name="alertDialogCenterButtons">true</item>
<!-- Panel attributes -->
@@ -261,7 +259,9 @@
<item name="dividerVertical">@drawable/divider_vertical_dark</item>
<item name="dividerHorizontal">@drawable/divider_vertical_dark</item>
<item name="buttonGroupStyle">@android:style/Widget.ButtonGroup</item>
<item name="buttonBarStyle">@android:style/ButtonBar</item>
<item name="buttonBarButtonStyle">?android:attr/buttonStyle</item>
<item name="segmentedButtonStyle">@android:style/SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">@android:drawable/spinner_dropdown_background</item>
@@ -739,7 +739,6 @@
<item name="buttonStyleToggle">@android:style/Widget.Holo.Button.Toggle</item>
<item name="switchStyle">@android:style/Widget.Holo.CompoundButton.Switch</item>
<item name="groupButtonBackground">@android:drawable/group_button_background_holo_dark</item>
<item name="selectableItemBackground">@android:drawable/item_background_holo_dark</item>
<item name="borderlessButtonStyle">@android:style/Widget.Holo.Button.Borderless</item>
<item name="homeAsUpIndicator">@android:drawable/ic_ab_back_holo_dark</item>
@@ -793,7 +792,6 @@
<item name="alertDialogStyle">@android:style/AlertDialog.Holo</item>
<item name="dialogTheme">@android:style/Theme.Holo.Dialog</item>
<item name="alertDialogTheme">@android:style/Theme.Holo.Dialog.Alert</item>
<item name="alertDialogButtonGroupStyle">@android:style/Widget.Holo.ButtonGroup.AlertDialog</item>
<item name="alertDialogCenterButtons">false</item>
<!-- Panel attributes -->
@@ -904,7 +902,9 @@
<item name="dividerVertical">?android:attr/listDivider</item>
<item name="dividerHorizontal">?android:attr/listDivider</item>
<item name="buttonGroupStyle">@android:style/Widget.Holo.ButtonGroup</item>
<item name="buttonBarStyle">@android:style/Holo.ButtonBar</item>
<item name="buttonBarButtonStyle">?android:attr/borderlessButtonStyle</item>
<item name="segmentedButtonStyle">@android:style/Holo.SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">@android:drawable/search_dropdown_dark</item>
@@ -988,7 +988,6 @@
<item name="buttonStyleToggle">@android:style/Widget.Holo.Light.Button.Toggle</item>
<item name="groupButtonBackground">@android:drawable/group_button_background_holo_light</item>
<item name="selectableItemBackground">@android:drawable/item_background_holo_light</item>
<item name="borderlessButtonStyle">@android:style/Widget.Holo.Light.Button.Borderless</item>
<item name="homeAsUpIndicator">@android:drawable/ic_ab_back_holo_light</item>
@@ -1042,7 +1041,6 @@
<item name="alertDialogStyle">@android:style/AlertDialog.Holo.Light</item>
<item name="dialogTheme">@android:style/Theme.Holo.Light.Dialog</item>
<item name="alertDialogTheme">@android:style/Theme.Holo.Light.Dialog.Alert</item>
<item name="alertDialogButtonGroupStyle">@android:style/Widget.Holo.Light.ButtonGroup.AlertDialog</item>
<!-- Panel attributes -->
<item name="panelBackground">@android:drawable/menu_background</item>
@@ -1152,7 +1150,9 @@
<item name="dividerVertical">?android:attr/listDivider</item>
<item name="dividerHorizontal">?android:attr/listDivider</item>
<item name="buttonGroupStyle">@android:style/Widget.Holo.Light.ButtonGroup</item>
<item name="buttonBarStyle">@android:style/Holo.Light.ButtonBar</item>
<item name="buttonBarButtonStyle">?android:attr/borderlessButtonStyle</item>
<item name="segmentedButtonStyle">@android:style/Holo.Light.SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item>
@@ -1216,8 +1216,7 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:buttonGroupStyle">@android:style/Widget.Holo.ButtonGroup.AlertDialog</item>
<item name="android:groupButtonBackground">?android:attr/selectableItemBackground</item>
<item name="android:buttonBarStyle">@android:style/Holo.ButtonBar.AlertDialog</item>
<item name="textAppearance">@android:style/TextAppearance.Holo</item>
<item name="textAppearanceInverse">@android:style/TextAppearance.Holo.Inverse</item>
@@ -1287,8 +1286,7 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:buttonGroupStyle">@android:style/Widget.Holo.Light.ButtonGroup.AlertDialog</item>
<item name="android:groupButtonBackground">?android:attr/selectableItemBackground</item>
<item name="android:buttonBarStyle">@android:style/Holo.Light.ButtonBar.AlertDialog</item>
<item name="textAppearance">@android:style/TextAppearance.Holo.Light</item>
<item name="textAppearanceInverse">@android:style/TextAppearance.Holo.Light.Inverse</item>