diff options
-rw-r--r-- | AndroidManifest.xml | 1 | ||||
-rw-r--r-- | res/drawable/action_bar_tab.xml | 22 | ||||
-rw-r--r-- | res/drawable/tab_selected.xml | 24 | ||||
-rw-r--r-- | res/drawable/tab_selected_focused.xml | 24 | ||||
-rw-r--r-- | res/drawable/tab_selected_pressed.xml | 24 | ||||
-rw-r--r-- | res/drawable/tab_unselected_focused.xml | 24 | ||||
-rw-r--r-- | res/drawable/tab_unselected_pressed.xml | 24 | ||||
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/strings.xml | 10 | ||||
-rw-r--r-- | res/values/styles.xml | 59 | ||||
-rw-r--r-- | src/com/android/contacts/activities/ActionBarAdapter.java | 22 |
11 files changed, 62 insertions, 174 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b9d8a4069..d077dd811 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -64,7 +64,6 @@ <activity android:name=".activities.PeopleActivity" android:label="@string/people" android:theme="@style/PeopleTheme" - android:uiOptions="splitActionBarWhenNarrow" android:clearTaskOnLaunch="true" android:launchMode="singleTop" > diff --git a/res/drawable/action_bar_tab.xml b/res/drawable/action_bar_tab.xml deleted file mode 100644 index 2fc5c2ba7..000000000 --- a/res/drawable/action_bar_tab.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2011 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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/tab_selected_pressed" android:state_pressed="true"/> - <item android:drawable="@drawable/tab_selected_focused" android:state_focused="true"/> - <item android:drawable="@drawable/tab_selected" /> -</selector>
\ No newline at end of file diff --git a/res/drawable/tab_selected.xml b/res/drawable/tab_selected.xml deleted file mode 100644 index 36a417543..000000000 --- a/res/drawable/tab_selected.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. ---> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/action_bar_background" /> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/res/drawable/tab_selected_focused.xml b/res/drawable/tab_selected_focused.xml deleted file mode 100644 index 13aeb4ced..000000000 --- a/res/drawable/tab_selected_focused.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. ---> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/action_bar_background_highlight" /> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/res/drawable/tab_selected_pressed.xml b/res/drawable/tab_selected_pressed.xml deleted file mode 100644 index 13aeb4ced..000000000 --- a/res/drawable/tab_selected_pressed.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. ---> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/action_bar_background_highlight" /> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/res/drawable/tab_unselected_focused.xml b/res/drawable/tab_unselected_focused.xml deleted file mode 100644 index 13aeb4ced..000000000 --- a/res/drawable/tab_unselected_focused.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. ---> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/action_bar_background_highlight" /> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/res/drawable/tab_unselected_pressed.xml b/res/drawable/tab_unselected_pressed.xml deleted file mode 100644 index 13aeb4ced..000000000 --- a/res/drawable/tab_unselected_pressed.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. ---> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - <item> - <shape android:shape="rectangle" > - <solid android:color="@color/action_bar_background_highlight" /> - </shape> - </item> -</layer-list>
\ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index e3fab85c2..fc5674b7c 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -36,4 +36,6 @@ <!-- Color of the text for buttons in the action bar --> <color name="action_bar_button_text_color">#FFFFFF</color> + <!-- Color of the selected tab underline (overriding value in ContactsCommon) --> + <color name="tab_selected_color">#ffeeff41</color> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 971bfc240..4c59480cf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -273,13 +273,11 @@ <item quantity="other"><xliff:g id="count">%d</xliff:g> found</item> </plurals> - <!-- The content description for the "all contacts" tab. + <!-- The title of "all contacts" tab. [CHAR LIMIT=14] --> + <string name="all_contacts_tab_label">All contacts</string> - Note: AccessibilityServices use this attribute to announce what the view represents. - This is especially valuable for views without textual representation like ImageView. - - [CHAR LIMIT=NONE] --> - <string name="contactsAllLabel">All contacts</string> + <!-- The title of "favorites" tab. [CHAR LIMIT=14] --> + <string name="favorites_tab_label">Favorites</string> <!-- Action string for calling back a number in the call log --> <string name="callBack">Call back</string> diff --git a/res/values/styles.xml b/res/values/styles.xml index 3129189ef..771e92f78 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -53,16 +53,19 @@ <item name="android:listViewStyle">@style/ListViewStyle</item> </style> - <style name="PeopleTheme" parent="@android:style/Theme.Holo.Light"> + <style name="PeopleTheme" parent="@android:style/Theme.Quantum.Light"> <item name="android:actionBarStyle">@style/ContactsActionBarStyle</item> - <item name="android:homeAsUpIndicator">@drawable/ic_menu_back</item> - <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflow</item> - <item name="android:actionBarItemBackground">@drawable/action_bar_item_background</item> - <item name="android:actionBarWidgetTheme">@style/ContactsActionBarTheme</item> - <item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</item> - <item name="android:actionDropDownStyle">@style/ContactsActionBarDropDownStyle</item> + <!-- Style for the tabs --> + <item name="android:actionBarTabStyle">@style/ContactsActionBarTabStyle</item> + <!-- Style for the tab bar (for the divider between tabs) --> + <item name="android:actionBarTabBarStyle">@style/ContactsActionBarTabBarStyle</item> + <!-- Style for the tab bar text (for text on tabs) --> + <item name="android:actionBarTabTextStyle">@style/ContactsActionBarTabTextStyle</item> + <!-- Style for the overflow button in the actionbar. --> + <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflowQP</item> <item name="android:textColorPrimary">@color/primary_text_color</item> <item name="android:textColorSecondary">@color/secondary_text_color</item> + <item name="android:icon">@android:color/transparent</item> <item name="android:listViewStyle">@style/ListViewStyle</item> <item name="android:windowBackground">@color/background_primary</item> <item name="list_item_height">?android:attr/listPreferredItemHeight</item> @@ -99,11 +102,45 @@ <item name="android:src">@drawable/ic_overflow_menu</item> </style> - <style name="ContactsActionBarStyle" parent="@android:Widget.Holo.Light.ActionBar"> + <style name="ContactsActionBarStyle" parent="@android:style/Widget.Quantum.Light.ActionBar"> + <item name="android:background">@color/actionbar_background_color</item> + <item name="android:titleTextStyle">@style/ContactsActionBarTitleText</item> + <item name="android:backgroundStacked">@color/actionbar_background_color</item> + <!-- Empty icon --> + <item name="android:icon">@android:color/transparent</item> + </style> + + <!-- Styling for tabs. --> + <style name="ContactsActionBarTabStyle" parent="@android:style/Widget.Quantum.Light.ActionBar.TabView"> <item name="android:background">@drawable/action_bar_tab</item> - <item name="android:backgroundSplit">@drawable/action_bar_tab</item> - <item name="android:backgroundStacked">@drawable/action_bar_tab</item> - <item name="android:displayOptions"></item> + <item name="android:showDividers">none</item> + </style> + + <!-- Text in the action bar at the top of the screen --> + <style name="ContactsActionBarTitleText" + parent="@android:style/TextAppearance.Quantum.Widget.ActionBar.Title"> + <item name="android:textColor">@color/actionbar_text_color</item> + </style> + + <!-- Styling for the tab bar; handles styling of the divider line. --> + <style name="ContactsActionBarTabBarStyle" + parent="@android:style/Widget.Quantum.ActionBar.TabBar"> + <item name="android:showDividers">none</item> + </style> + + <!-- Text style for tabs. --> + <style name="ContactsActionBarTabTextStyle" + parent="android:style/Widget.Quantum.Light.ActionBar.TabText"> + <item name="android:textColor">@color/tab_text_color</item> + <item name="android:textSize">@dimen/tab_text_size</item> + <item name="android:fontFamily">@string/tab_font_family</item> + <item name="android:textStyle">bold</item> + </style> + + <!-- Action bar overflow menu icon. --> + <style name="ContactsActionBarOverflowQP" + parent="@android:style/Widget.Quantum.Light.ActionButton.Overflow"> + <item name="android:src">@drawable/ic_menu_overflow_lt</item> </style> <style name="ContactsActionBarDropDownStyle" parent="@android:style/Widget.Holo.Light.Spinner"> diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java index efad12f8f..b8cd32e1e 100644 --- a/src/com/android/contacts/activities/ActionBarAdapter.java +++ b/src/com/android/contacts/activities/ActionBarAdapter.java @@ -82,7 +82,6 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { private final MyNavigationListener mNavigationListener; private boolean mShowHomeIcon; - private boolean mShowTabsAsText; public interface TabState { public static int FAVORITES = 0; @@ -132,7 +131,6 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { mShowHomeIcon = mContext.getResources().getBoolean(R.bool.show_home_icon); // On wide screens, show the tabs as text (instead of icons) - mShowTabsAsText = isUsingTwoPanes; if (isUsingTwoPanes) { mActionBarNavigationMode = ActionBar.NAVIGATION_MODE_LIST; mTabListener = null; @@ -177,15 +175,15 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { } private void setupTabs() { - addTab(TabState.FAVORITES, R.drawable.ic_tab_starred, R.string.contactsFavoritesLabel); - addTab(TabState.ALL, R.drawable.ic_tab_all, R.string.contactsAllLabel); + addTab(TabState.FAVORITES, R.string.favorites_tab_label); + addTab(TabState.ALL, R.string.all_contacts_tab_label); } private void setupNavigationList() { ArrayAdapter<String> navAdapter = new CustomArrayAdapter(mContext, R.layout.people_navigation_item); - navAdapter.add(mContext.getString(R.string.contactsFavoritesLabel)); - navAdapter.add(mContext.getString(R.string.contactsAllLabel)); + navAdapter.add(mContext.getString(R.string.favorites_tab_label)); + navAdapter.add(mContext.getString(R.string.all_contacts_tab_label)); mActionBar.setListNavigationCallbacks(navAdapter, mNavigationListener); } @@ -250,15 +248,10 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { mListener = listener; } - private void addTab(int expectedTabIndex, int icon, int description) { + private void addTab(int expectedTabIndex, int description) { final Tab tab = mActionBar.newTab(); tab.setTabListener(mTabListener); - if (mShowTabsAsText) { - tab.setText(description); - } else { - tab.setIcon(icon); - tab.setContentDescription(description); - } + tab.setText(description); mActionBar.addTab(tab); if (expectedTabIndex != tab.getPosition()) { throw new IllegalStateException("Tabs must be created in the right order"); @@ -399,6 +392,8 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { } mActionBar.setHomeButtonEnabled(mSearchMode); + + if (current != newFlags) { // Pass the mask here to preserve other flags that we're not interested here. mActionBar.setDisplayOptions(newFlags, MASK); @@ -449,7 +444,6 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener { getNavigationItemPositionFromTabPosition(mCurrentTab)); mNavigationListener.mIgnoreNavigationItemSelected = false; } - mActionBar.setTitle(null); // Since we have the {@link SearchView} in a custom action bar, we must manually handle // collapsing the {@link SearchView} when search mode is exited. if (isIconifiedChanging) { |