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

Commit 06917034 authored by Xiaohui Chen's avatar Xiaohui Chen
Browse files

sysui: remove shelf

Bug: 26742568
Change-Id: I10bbf55b4b93fb5d360a56dcc59c943d8806a27e
parent e9dab0da
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 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.
-->

<!-- Container for the app shelf. -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/app_shelf"
    android:orientation="horizontal"
    android:layout_height="match_parent"
    android:layout_width="0dp"
    android:layout_weight="1">
    <com.android.systemui.statusbar.phone.NavigationBarApps
        android:id="@+id/navigation_bar_apps"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" />
</LinearLayout>
+7 −23
Original line number Diff line number Diff line
@@ -43,8 +43,6 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi
    private static final String RECENT = "recent";
    private static final String NAVSPACE = "space";

    private static final String APP_SHELF = "app_shelf";

    public static final String GRAVITY_SEPARATOR = ";";
    public static final String BUTTON_SEPARATOR = ",";

@@ -141,19 +139,13 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi
        inflateButtons(start, (ViewGroup) mRot90.findViewById(R.id.ends_group),
                (ViewGroup) mRot90.findViewById(R.id.ends_group_lightsout), true);

        if (center.length == 1 && APP_SHELF.equals(center[0])) {
            inflateShelf((LinearLayout) mRot0.findViewById(R.id.ends_group),
                    (LinearLayout) mRot0.findViewById(R.id.ends_group_lightsout), false);
            inflateShelf((LinearLayout) mRot90.findViewById(R.id.ends_group),
                    (LinearLayout) mRot90.findViewById(R.id.ends_group_lightsout), true);
        } else {
        inflateButtons(center, (ViewGroup) mRot0.findViewById(R.id.center_group),
                (ViewGroup) mRot0.findViewById(R.id.center_group_lightsout), false);
        inflateButtons(center, (ViewGroup) mRot90.findViewById(R.id.center_group),
                (ViewGroup) mRot90.findViewById(R.id.center_group_lightsout), true);

        addGravitySpacer((LinearLayout) mRot0.findViewById(R.id.ends_group));
        addGravitySpacer((LinearLayout) mRot90.findViewById(R.id.ends_group));
        }

        inflateButtons(end, (ViewGroup) mRot0.findViewById(R.id.ends_group),
                (ViewGroup) mRot0.findViewById(R.id.ends_group_lightsout), false);
@@ -161,14 +153,6 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi
                (ViewGroup) mRot90.findViewById(R.id.ends_group_lightsout), true);
    }

    private void inflateShelf(LinearLayout layout, LinearLayout lightsOut, boolean landscape) {
        View v = (landscape ? mLandscapeInflater : mLayoutInflater)
                .inflate(R.layout.apps_bar, layout, false);
        layout.addView(v);
        addToDispatchers(v);
        copyToLightsout(v, lightsOut);
    }

    private void addGravitySpacer(LinearLayout layout) {
        layout.addView(new Space(mContext), new LinearLayout.LayoutParams(0, 0, 1));
    }
+0 −11
Original line number Diff line number Diff line
@@ -263,11 +263,6 @@ public class NavigationBarView extends LinearLayout {
        return mButtonDisatchers.get(R.id.ime_switcher);
    }

    @Nullable
    public View getAppShelf() {
        return getCurrentView().findViewById(R.id.app_shelf);
    }

    private void getCarModeIcons(Context ctx) {
        mBackCarModeIcon = ctx.getDrawable(R.drawable.ic_sysbar_back_carmode);
        mBackLandCarModeIcon = mBackCarModeIcon;
@@ -395,12 +390,6 @@ public class NavigationBarView extends LinearLayout {
        getBackButton().setVisibility(disableBack      ? View.INVISIBLE : View.VISIBLE);
        getHomeButton().setVisibility(disableHome      ? View.INVISIBLE : View.VISIBLE);
        getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);

        // The app shelf, if it exists, follows the visibility of the home button.
        View appShelf = getAppShelf();
        if (appShelf != null) {
            appShelf.setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
        }
    }

    private boolean inLockTask() {