diff options
author | Adam Powell <adamp@google.com> | 2011-08-11 14:59:52 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-11 14:59:52 -0700 |
commit | 9cc07c3939581909bf7de42df0215a65fab7b472 (patch) | |
tree | 248e174fb5d847c799da94569009ddb671c00d9b | |
parent | a0d386088129e657426f7a5fb9fc3a69401526f5 (diff) | |
parent | f242368f38b21479763d6e07174547c610a51c5c (diff) | |
download | frameworks_base-9cc07c3939581909bf7de42df0215a65fab7b472.zip frameworks_base-9cc07c3939581909bf7de42df0215a65fab7b472.tar.gz frameworks_base-9cc07c3939581909bf7de42df0215a65fab7b472.tar.bz2 |
Merge "More fun with action bars and themes!"
-rw-r--r-- | api/current.txt | 2 | ||||
-rw-r--r-- | core/java/com/android/internal/app/ActionBarImpl.java | 11 | ||||
-rw-r--r-- | core/res/res/layout/action_bar_home.xml | 2 | ||||
-rw-r--r-- | core/res/res/layout/search_bar.xml | 2 | ||||
-rwxr-xr-x | core/res/res/values/attrs.xml | 4 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 3 | ||||
-rw-r--r-- | core/res/res/values/styles.xml | 6 | ||||
-rw-r--r-- | core/res/res/values/themes.xml | 6 |
8 files changed, 25 insertions, 11 deletions
diff --git a/api/current.txt b/api/current.txt index 8151243..8f3b38f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -190,6 +190,8 @@ package android { field public static final int accountPreferences = 16843423; // 0x101029f field public static final int accountType = 16843407; // 0x101028f field public static final int action = 16842797; // 0x101002d + field public static final int actionBarDivider = 16843685; // 0x10103a5 + field public static final int actionBarItemBackground = 16843686; // 0x10103a6 field public static final int actionBarSize = 16843499; // 0x10102eb field public static final int actionBarSplitStyle = 16843666; // 0x1010392 field public static final int actionBarStyle = 16843470; // 0x10102ce diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index 0df7bcc..31360e1 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -253,7 +253,7 @@ public class ActionBarImpl extends ActionBar { @Override public void setCustomView(int resId) { - setCustomView(LayoutInflater.from(mContext).inflate(resId, mActionView, false)); + setCustomView(LayoutInflater.from(getThemedContext()).inflate(resId, mActionView, false)); } @Override @@ -630,14 +630,14 @@ public class ActionBarImpl extends ActionBar { public ActionModeImpl(ActionMode.Callback callback) { mCallback = callback; - mMenu = new MenuBuilder(mActionView.getContext()) + mMenu = new MenuBuilder(getThemedContext()) .setDefaultShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); mMenu.setCallback(this); } @Override public MenuInflater getMenuInflater() { - return new MenuInflater(mContext); + return new MenuInflater(getThemedContext()); } @Override @@ -755,7 +755,7 @@ public class ActionBarImpl extends ActionBar { return true; } - new MenuPopupHelper(mContext, subMenu).show(); + new MenuPopupHelper(getThemedContext(), subMenu).show(); return true; } @@ -819,7 +819,8 @@ public class ActionBarImpl extends ActionBar { @Override public Tab setCustomView(int layoutResId) { - return setCustomView(LayoutInflater.from(mContext).inflate(layoutResId, null)); + return setCustomView(LayoutInflater.from(getThemedContext()) + .inflate(layoutResId, null)); } @Override diff --git a/core/res/res/layout/action_bar_home.xml b/core/res/res/layout/action_bar_home.xml index 9612710..96467d0 100644 --- a/core/res/res/layout/action_bar_home.xml +++ b/core/res/res/layout/action_bar_home.xml @@ -18,7 +18,7 @@ class="com.android.internal.widget.ActionBarView$HomeView" android:layout_width="wrap_content" android:layout_height="match_parent" - android:background="?android:attr/selectableItemBackground" > + android:background="?android:attr/actionBarItemBackground" > <ImageView android:id="@android:id/up" android:src="?android:attr/homeAsUpIndicator" android:layout_gravity="center_vertical|left" diff --git a/core/res/res/layout/search_bar.xml b/core/res/res/layout/search_bar.xml index f6b5b53..673c96c 100644 --- a/core/res/res/layout/search_bar.xml +++ b/core/res/res/layout/search_bar.xml @@ -75,5 +75,5 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="fitXY" - android:src="@drawable/title_bar_shadow"/> + android:src="@drawable/ab_solid_shadow_holo"/> </view> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index f4c0240..140a8c9 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -633,6 +633,10 @@ <attr name="actionBarSize" format="dimension" > <enum name="wrap_content" value="0" /> </attr> + <!-- Custom divider drawable to use for elements in the action bar. --> + <attr name="actionBarDivider" format="reference" /> + <!-- Custom item state list drawable background for action bar items. --> + <attr name="actionBarItemBackground" format="reference" /> <!-- TextAppearance style that will be applied to text that appears within action menu items. --> <attr name="actionMenuTextAppearance" format="reference" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 1ba54cf..44995c8 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1788,6 +1788,9 @@ <public type="attr" name="subtypeLocale" /> <public type="attr" name="subtypeExtraValue" /> + <public type="attr" name="actionBarDivider" /> + <public type="attr" name="actionBarItemBackground" /> + <public type="style" name="TextAppearance.SuggestionHighlight" /> <public type="style" name="Theme.Holo.Light.DarkActionBar" /> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 0c6e20f..1f6b50a 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1113,7 +1113,7 @@ please see styles_device_defaults.xml. </style> <style name="Widget.ActionButton"> - <item name="android:background">?android:attr/selectableItemBackground</item> + <item name="android:background">?android:attr/actionBarItemBackground</item> <item name="android:paddingLeft">12dip</item> <item name="android:paddingRight">12dip</item> <item name="android:minWidth">56dip</item> @@ -1847,9 +1847,9 @@ please see styles_device_defaults.xml. </style> <style name="Widget.Holo.ActionBar.TabBar" parent="Widget.ActionBar.TabBar"> - <item name="android:divider">?android:attr/dividerVertical</item> + <item name="android:divider">?android:attr/actionBarDivider</item> <item name="android:showDividers">middle</item> - <item name="android:dividerPadding">8dip</item> + <item name="android:dividerPadding">12dip</item> </style> <style name="Widget.Holo.ActionBar.TabText" parent="Widget.ActionBar.TabText"> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 82299b8..add7dc8 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -308,6 +308,8 @@ please see themes_device_defaults.xml. <item name="actionMenuTextAppearance">@android:style/TextAppearance.Holo.Widget.ActionBar.Menu</item> <item name="actionMenuTextColor">?android:attr/textColorPrimary</item> <item name="actionBarWidgetTheme">@null</item> + <item name="actionBarDivider">?android:attr/dividerVertical</item> + <item name="actionBarItemBackground">?android:attr/selectableItemBackground</item> <item name="dividerVertical">@drawable/divider_vertical_dark</item> <item name="dividerHorizontal">@drawable/divider_vertical_dark</item> @@ -1429,7 +1431,7 @@ please see themes_device_defaults.xml. with an inverse color profile. The dark action bar sharply stands out against the light content. --> <style name="Theme.Holo.Light.DarkActionBar"> - <item name="android:windowContentOverlay">@android:drawable/title_bar_shadow</item> + <item name="android:windowContentOverlay">@android:drawable/ab_solid_shadow_holo</item> <item name="android:actionBarStyle">@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse</item> <item name="actionBarWidgetTheme">@android:style/Theme.Holo</item> @@ -1442,6 +1444,8 @@ please see themes_device_defaults.xml. <item name="actionBarTabStyle">@style/Widget.Holo.Light.ActionBar.TabView.Inverse</item> <item name="actionBarTabBarStyle">@style/Widget.Holo.Light.ActionBar.TabBar.Inverse</item> <item name="actionBarTabTextStyle">@style/Widget.Holo.Light.ActionBar.TabText.Inverse</item> + <item name="actionBarDivider">@android:drawable/list_divider_holo_dark</item> + <item name="actionBarItemBackground">@android:drawable/item_background_holo_dark</item> <item name="actionMenuTextColor">?android:attr/textColorPrimaryInverse</item> <item name="actionModeStyle">@style/Widget.Holo.Light.ActionMode.Inverse</item> <item name="actionModeCloseButtonStyle">@style/Widget.Holo.ActionButton.CloseMode</item> |