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

Commit ac1db81c authored by James Cook's avatar James Cook
Browse files

Tune UX for navbar app icons

* Push drag shadows up slightly while dragging to make them more visible
  at the bottom of the screen.
* Shrink drag shadows slightly to better match launcher shadows.
* Extend click target for icons all the way to the bottom of the screen.

Bug: 20024603
Change-Id: I217bd702771aa7450dc1e515e59d063aac4de719
parent a0eb2022
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -14,13 +14,16 @@
     limitations under the License.
-->

<!-- ImageView for an app icon in the navigation bar. Used to launch the app. -->
<!--
    ImageView for an app icon in the navigation bar. Used to launch the app. The ImageView size is
    used to compute the size of the drag shadow.
-->
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="40dp"
    android:layout_height="40dp"
    android:layout_marginLeft="12dp"
    android:layout_marginRight="12dp"
    android:padding="2dp"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:padding="6dp"
    android:layout_gravity="center"
    android:scaleType="centerInside"
    />
+32 −24
Original line number Diff line number Diff line
@@ -83,33 +83,37 @@
                android:src="@drawable/nav_app_divider"
                />

            <!-- TODO: Build the list of icons dynamically. -->
            <com.android.systemui.statusbar.phone.NavigationBarRecents
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                >
                <ImageView android:id="@+id/recent0"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
                    />
                <ImageView android:id="@+id/recent1"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
                    />
                <ImageView android:id="@+id/recent2"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
@@ -272,33 +276,37 @@
                android:src="@drawable/nav_app_divider"
                />

            <!-- TODO: Build the list of icons dynamically. -->
            <com.android.systemui.statusbar.phone.NavigationBarRecents
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                >
                <ImageView android:id="@+id/recent0"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
                    />
                <ImageView android:id="@+id/recent1"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
                    />
                <ImageView android:id="@+id/recent2"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="12dp"
                    android:layout_marginRight="12dp"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:padding="6dp"
                    android:layout_gravity="center"
                    android:scaleType="centerInside"
                    android:visibility="invisible"
+4 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ class NavigationBarApps extends LinearLayout {

    /** Creates a scaled-up version of an ImageView's Drawable for dragging. */
    private static class IconDragShadowBuilder extends View.DragShadowBuilder {
        private final static int ICON_SCALE = 3;
        private final static int ICON_SCALE = 2;
        final Drawable mDrawable;
        final int mWidth;
        final int mHeight;
@@ -142,7 +142,9 @@ class NavigationBarApps extends LinearLayout {
        @Override
        public void onProvideShadowMetrics(Point size, Point touch) {
            size.set(mWidth, mHeight);
            touch.set(mWidth / 2, mHeight / 2);
            // Shift the drag shadow up slightly because the apps are at the bottom edge of the
            // screen.
            touch.set(mWidth / 2, mHeight * 2 / 3);
        }

        @Override
+0 −3
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;