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

Commit 80e11c27 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4667902 from bf7ea6c9 to pi-release

Change-Id: I9649e7c687210f4e136d52c7e635760706b49ef9
parents ed2f7ff3 bf7ea6c9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,5 +29,6 @@
        android:background="@color/navigation_drawer_background_color"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:divider="@null" />
</FrameLayout>

res/layout/nav_header_main.xml

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
  Copyright (C) 2016 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.
  -->

<View
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/nav_status_bar_spacer"
    android:layout_width="match_parent"
    android:layout_height="@dimen/nav_header_height"
    android:background="@color/contacts_accent_color"
    android:importantForAccessibility="no"/>
+0 −3
Original line number Diff line number Diff line
@@ -188,9 +188,6 @@

    <dimen name="contact_browser_list_item_height">56dp</dimen>

    <!-- Navigation drawer header height, the same as the status bar in landscape and portrait modes -->
    <dimen name="nav_header_height">24dp</dimen>

    <!-- Default activity margins, per the Android Material Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
+1 −17
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@ public class DrawerAdapter extends BaseAdapter {
    private static final int VIEW_TYPE_ACCOUNT_ENTRY = 4;
    private static final int VIEW_TYPE_CREATE_LABEL = 5;
    private static final int VIEW_TYPE_NAV_SPACER = 6;
    private static final int VIEW_TYPE_STATUS_SPACER = 7;
    private static final int VIEW_TYPE_NAV_DIVIDER = 8;
    private static final int VIEW_TYPE_NAV_DIVIDER = 7;

    // This count must be updated if we add more view types.
    private static final int VIEW_TYPE_COUNT = 9;
@@ -67,7 +66,6 @@ public class DrawerAdapter extends BaseAdapter {
    private ContactListFilter mSelectedAccount;

    // Adapter elements, ordered in this way mItemsList. The ordering is based on:
    //  [Status bar spacer item]
    //  [Navigation spacer item]
    //  [Primary items] (Contacts, Suggestions)
    //  [Group Header]
@@ -77,7 +75,6 @@ public class DrawerAdapter extends BaseAdapter {
    //  [Accounts]
    //  [Misc items] (a divider, Settings, Help & Feedback)
    //  [Navigation spacer item]
    private StatusBarSpacerItem mStatusBarSpacerItem = null;
    private NavSpacerItem mNavSpacerItem = null;
    private List<PrimaryItem> mPrimaryItems = new ArrayList<>();
    private HeaderItem mGroupHeader = null;
@@ -100,7 +97,6 @@ public class DrawerAdapter extends BaseAdapter {
    private void initializeDrawerMenuItems() {
        // Spacer item for dividing sections in drawer
        mNavSpacerItem = new NavSpacerItem(R.id.nav_drawer_spacer);
        mStatusBarSpacerItem = new StatusBarSpacerItem(R.id.nav_status_bar_spacer);
        // Primary items
        mPrimaryItems.add(new PrimaryItem(R.id.nav_all_contacts, R.string.contactsList,
                R.drawable.quantum_ic_account_circle_vd_theme_24, ContactsView.ALL_CONTACTS));
@@ -128,7 +124,6 @@ public class DrawerAdapter extends BaseAdapter {

    private void rebuildItemsList() {
        mItemsList.clear();
        mItemsList.add(mStatusBarSpacerItem);
        mItemsList.add(mNavSpacerItem);
        mItemsList.addAll(mPrimaryItems);
        if (mAreGroupWritableAccountsAvailable || !mGroupEntries.isEmpty()) {
@@ -193,8 +188,6 @@ public class DrawerAdapter extends BaseAdapter {
    public View getView(int position, View view, ViewGroup viewGroup) {
        final BaseDrawerItem drawerItem = getItem(position);
        switch (drawerItem.viewType) {
            case VIEW_TYPE_STATUS_SPACER:
                return getBaseItemView(R.layout.nav_header_main, view, viewGroup);
            case VIEW_TYPE_PRIMARY_ITEM:
                return getPrimaryItemView((PrimaryItem) drawerItem, view, viewGroup);
            case VIEW_TYPE_HEADER_ITEM:
@@ -405,15 +398,6 @@ public class DrawerAdapter extends BaseAdapter {
        }
    }


    // Navigation drawer item for status bar spacer item to take up the height of status bar in the
    // drawer.
    public static class StatusBarSpacerItem extends BaseDrawerItem {
        public StatusBarSpacerItem(int id) {
            super(VIEW_TYPE_STATUS_SPACER, id, /* textResId */ 0, /* iconResId */ 0);
        }
    }

    // Navigation drawer item for spacer item for dividing sections in the drawer.
    public static class NavSpacerItem extends BaseDrawerItem {
        public NavSpacerItem(int id) {
+9 −2
Original line number Diff line number Diff line
@@ -297,6 +297,14 @@ public class DrawerFragment extends Fragment implements AccountsListener {
        }
    }

    private void applyTopInset(int insetTop) {
        // set height of the scrim
        mScrimDrawable.setIntrinsicHeight(insetTop);
        mDrawerListView.setPadding(mDrawerListView.getPaddingLeft(),
                insetTop, mDrawerListView.getPaddingRight(),
                mDrawerListView.getPaddingBottom());
    }

    public interface DrawerFragmentListener {
        void onDrawerItemClicked();
        void onContactsViewSelected(ContactsView mode);
@@ -311,8 +319,7 @@ public class DrawerFragment extends Fragment implements AccountsListener {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            final int insetTop = insets.getSystemWindowInsetTop();
            // set height of the scrim
            mScrimDrawable.setIntrinsicHeight(insetTop);
            applyTopInset(insetTop);
            return insets;
        }
    }