diff --git a/api/current.xml b/api/current.xml index 3c872c58bb122..819c730df70bf 100644 --- a/api/current.xml +++ b/api/current.xml @@ -2088,6 +2088,28 @@ visibility="public" > + + + + + + + + + + + + - - - - - + diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java index acf75e33d946b..6b7b946811211 100644 --- a/core/java/com/android/internal/widget/ActionBarContextView.java +++ b/core/java/com/android/internal/widget/ActionBarContextView.java @@ -37,7 +37,6 @@ import android.widget.TextView; */ public class ActionBarContextView extends ViewGroup { private int mItemPadding; - private int mItemMargin; private int mActionSpacing; private int mContentHeight; @@ -49,32 +48,36 @@ public class ActionBarContextView extends ViewGroup { private LinearLayout mTitleLayout; private TextView mTitleView; private TextView mSubtitleView; - private Drawable mCloseDrawable; + private int mCloseButtonStyle; + private int mTitleStyleRes; + private int mSubtitleStyleRes; private ActionMenuView mMenuView; public ActionBarContextView(Context context) { - this(context, null, 0); + this(context, null); } public ActionBarContextView(Context context, AttributeSet attrs) { - this(context, attrs, 0); + this(context, attrs, com.android.internal.R.attr.actionModeStyle); } public ActionBarContextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - TypedArray a = context.obtainStyledAttributes(attrs, - com.android.internal.R.styleable.Theme); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ActionMode, defStyle, 0); mItemPadding = a.getDimensionPixelOffset( - com.android.internal.R.styleable.Theme_actionButtonPadding, 0); + com.android.internal.R.styleable.ActionMode_itemPadding, 0); setBackgroundDrawable(a.getDrawable( - com.android.internal.R.styleable.Theme_actionModeBackground)); - mCloseDrawable = a.getDrawable( - com.android.internal.R.styleable.Theme_actionModeCloseDrawable); - mItemMargin = mItemPadding / 2; + com.android.internal.R.styleable.ActionMode_background)); + mCloseButtonStyle = a.getResourceId( + com.android.internal.R.styleable.ActionMode_closeButtonStyle, 0); + mTitleStyleRes = a.getResourceId( + com.android.internal.R.styleable.ActionMode_titleTextStyle, 0); + mSubtitleStyleRes = a.getResourceId( + com.android.internal.R.styleable.ActionMode_subtitleTextStyle, 0); mContentHeight = a.getLayoutDimension( - com.android.internal.R.styleable.Theme_windowActionBarSize, 0); + com.android.internal.R.styleable.ActionMode_height, 0); a.recycle(); } @@ -129,9 +132,15 @@ public class ActionBarContextView extends ViewGroup { mSubtitleView = (TextView) mTitleLayout.findViewById(R.id.action_bar_subtitle); if (mTitle != null) { mTitleView.setText(mTitle); + if (mTitleStyleRes != 0) { + mTitleView.setTextAppearance(mContext, mTitleStyleRes); + } } if (mSubtitle != null) { mSubtitleView.setText(mSubtitle); + if (mSubtitleStyleRes != 0) { + mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes); + } mSubtitleView.setVisibility(VISIBLE); } addView(mTitleLayout); @@ -147,9 +156,7 @@ public class ActionBarContextView extends ViewGroup { public void initForMode(final ActionMode mode) { if (mCloseButton == null) { - mCloseButton = new ImageButton(getContext()); - mCloseButton.setImageDrawable(mCloseDrawable); - mCloseButton.setBackgroundDrawable(null); + mCloseButton = new ImageButton(getContext(), null, mCloseButtonStyle); } mCloseButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { diff --git a/core/res/res/layout-xlarge/screen_action_bar.xml b/core/res/res/layout-xlarge/screen_action_bar.xml index 30a73184b65ce..c4025565a7ebd 100644 --- a/core/res/res/layout-xlarge/screen_action_bar.xml +++ b/core/res/res/layout-xlarge/screen_action_bar.xml @@ -30,11 +30,12 @@ This is an optimized layout for a screen with the Action Bar enabled. android:id="@+id/action_bar" android:layout_width="match_parent" android:layout_height="wrap_content" - style="?android:attr/windowActionBarStyle" /> + style="?android:attr/actionBarStyle" /> + android:layout_height="wrap_content" + style="?android:attr/actionModeStyle" /> + style="?android:attr/actionBarStyle" /> + android:layout_height="wrap_content" + style="?android:attr/actionModeStyle" /> + android:ellipsize="end" /> + android:ellipsize="end" /> diff --git a/core/res/res/layout/action_mode_bar.xml b/core/res/res/layout/action_mode_bar.xml index acf327e808ec1..dc09fdc43a7f9 100644 --- a/core/res/res/layout/action_mode_bar.xml +++ b/core/res/res/layout/action_mode_bar.xml @@ -20,4 +20,5 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:visibility="gone" /> + android:visibility="gone" + style="?android:attr/actionModeStyle" /> diff --git a/core/res/res/layout/screen_action_bar.xml b/core/res/res/layout/screen_action_bar.xml index 3c44b8c465f11..b158414059ff4 100644 --- a/core/res/res/layout/screen_action_bar.xml +++ b/core/res/res/layout/screen_action_bar.xml @@ -30,11 +30,12 @@ This is an optimized layout for a screen with the Action Bar enabled. android:id="@+id/action_bar" android:layout_width="match_parent" android:layout_height="wrap_content" - style="?android:attr/windowActionBarStyle" /> + style="?android:attr/actionBarStyle" /> + android:layout_height="wrap_content" + style="?android:attr/actionModeStyle" /> diff --git a/core/res/res/layout/screen_action_bar_overlay.xml b/core/res/res/layout/screen_action_bar_overlay.xml index c854c6fe3baac..92a1ee0bf841b 100644 --- a/core/res/res/layout/screen_action_bar_overlay.xml +++ b/core/res/res/layout/screen_action_bar_overlay.xml @@ -34,11 +34,12 @@ the Action Bar enabled overlaying application content. android:id="@+id/action_bar" android:layout_width="match_parent" android:layout_height="wrap_content" - style="?android:attr/windowActionBarStyle" /> + style="?android:attr/actionBarStyle" /> + android:layout_height="wrap_content" + style="?android:attr/actionModeStyle" /> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index f466e82a1ea40..7d54ea189686e 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -267,15 +267,6 @@ have an Action Bar. --> - - - - - - - - @@ -478,6 +469,15 @@ + + + + + + + + @@ -1027,10 +1027,8 @@ - - @@ -4081,4 +4079,19 @@ + + + + + + + + + + + + + + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 7f168a19598e5..bff22a63b0b30 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1299,7 +1299,7 @@ - + @@ -1327,7 +1327,7 @@ - + @@ -1339,6 +1339,10 @@ + + + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 5c3870dccdfee..fa5c70b244cd6 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -879,15 +879,42 @@ @android:drawable/bottom_bar - + + + + + + + + + + + +