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

Commit 968403dd authored by James Cook's avatar James Cook
Browse files

Fix app shelf being visible during setup wizard

* Introduce a LinearLayout to hold the app shelf widgets
* Hide it when the home button is hidden. If you can't go home
(launch the launcher) you shouldn't be able to use the shelf
to launch apps either.

Bug: 22206506
Change-Id: I5118e40786a0d26d6292850fef31f2b57c1880cd
parent d2c9d0d9
Loading
Loading
Loading
Loading
+108 −102
Original line number Diff line number Diff line
@@ -69,6 +69,14 @@
                android:contentDescription="@string/accessibility_home"
                />

            <!-- Container for the app shelf. -->
            <LinearLayout
                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:layout_width="wrap_content"
                    android:layout_height="match_parent"
@@ -119,12 +127,7 @@
                        android:visibility="invisible"
                        />
                </com.android.systemui.statusbar.phone.NavigationBarRecents>

            <Space
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                />
            </LinearLayout>

            <FrameLayout
                android:layout_width="@dimen/navigation_extra_key_width"
@@ -262,6 +265,14 @@
                android:contentDescription="@string/accessibility_home"
                />

            <!-- Container for the app shelf. -->
            <LinearLayout
                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:layout_width="wrap_content"
                    android:layout_height="match_parent"
@@ -312,12 +323,7 @@
                        android:visibility="invisible"
                        />
                </com.android.systemui.statusbar.phone.NavigationBarRecents>

            <Space
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                />
            </LinearLayout>

            <FrameLayout
                android:layout_width="@dimen/navigation_extra_key_width"
+10 −0
Original line number Diff line number Diff line
@@ -243,6 +243,10 @@ public class NavigationBarView extends LinearLayout {
        return mCurrentView.findViewById(R.id.ime_switcher);
    }

    public View getAppShelf() {
        return mCurrentView.findViewById(R.id.app_shelf);
    }

    private void getIcons(Resources res) {
        mBackIcon = res.getDrawable(R.drawable.ic_sysbar_back);
        mBackLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_land);
@@ -341,6 +345,12 @@ 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() {