Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59087d33 authored by Walter Jang's avatar Walter Jang
Browse files

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
parent 93317e3f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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.
+12 −1
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ public class ActionBarAdapter implements OnCloseListener {
    private final FrameLayout mToolBarFrame;

    private boolean mShowHomeIcon;
    private boolean mShowHomeAsUp;

    public interface TabState {
        public static int ALL = 0;
@@ -129,12 +130,19 @@ public class ActionBarAdapter implements OnCloseListener {
        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 @@ public class ActionBarAdapter implements OnCloseListener {
        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