Add ActionBarAdapter options to show home as up
Also remove show_home_icon value added in ag/121098
since we no longer have different values for it and
we have moved to a hamburger menu.
Bug 28427279
Bug 18641067
Change-Id: I543a93c74c6e77cc09abc3b4cd0cf683f088f6df
diff --git a/res/values/donottranslate_config.xml b/res/values/donottranslate_config.xml
index 1c776ab..3428fa1 100644
--- a/res/values/donottranslate_config.xml
+++ b/res/values/donottranslate_config.xml
@@ -22,9 +22,6 @@
<!-- If true, phonetic name is included in the contact editor by default -->
<bool name="config_editor_include_phonetic_name">false</bool>
- <!-- If true, the "home" icon on the action bar will be shown. -->
- <bool name="show_home_icon">false</bool>
-
<!--
If true, the "view updates from group" button in the action bar will be
shown. Otherwise it will be part of the content on the group detail page.
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index febfa44..2d6740d 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -108,6 +108,7 @@
private final FrameLayout mToolBarFrame;
private boolean mShowHomeIcon;
+ private boolean mShowHomeAsUp;
public interface TabState {
public static int ALL = 0;
@@ -129,12 +130,19 @@
mToolbar = toolbar;
mToolBarFrame = (FrameLayout) mToolbar.getParent();
mMaxToolbarContentInsetStart = mToolbar.getContentInsetStart();
- mShowHomeIcon = mActivity.getResources().getBoolean(R.bool.show_home_icon);
setupSearchAndSelectionViews();
setupTabs(mActivity);
}
+ public void setShowHomeIcon(boolean showHomeIcon) {
+ mShowHomeIcon = showHomeIcon;
+ }
+
+ public void setShowHomeAsUp(boolean showHomeAsUp) {
+ mShowHomeAsUp = showHomeAsUp;
+ }
+
private void setupTabs(Context context) {
final TypedArray attributeArray = context.obtainStyledAttributes(
new int[]{android.R.attr.actionBarSize});
@@ -354,6 +362,9 @@
int newFlags = 0;
if (mShowHomeIcon && !isSearchOrSelectionMode) {
newFlags |= ActionBar.DISPLAY_SHOW_HOME;
+ if (mShowHomeAsUp) {
+ newFlags |= ActionBar.DISPLAY_HOME_AS_UP;
+ }
}
if (mSearchMode && !mSelectionMode) {
// The search container is placed inside the toolbar. So we need to disable the