summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-10-03 21:45:05 (GMT)
committerJon Miranda <jonmiranda@google.com>2017-10-03 21:45:05 (GMT)
commita328a0d83a1149b884dd49d302414d8080d28e40 (patch)
tree17cc5038139a086ab7126d2b2220f834ff07c26d
parent850a7b1030ae172327d5ded01eb4c477d209e82b (diff)
parent846455e1ffdca9bac72b96ba61d2e42cd45cf4ce (diff)
downloadandroid_packages_apps_Trebuchet-a328a0d83a1149b884dd49d302414d8080d28e40.zip
android_packages_apps_Trebuchet-a328a0d83a1149b884dd49d302414d8080d28e40.tar.gz
android_packages_apps_Trebuchet-a328a0d83a1149b884dd49d302414d8080d28e40.tar.bz2
Merge branch 'ub-launcher3-dorval-polish2' into 1003
Bug: 64937210 Test: flashed img Change-Id: Icec6e9642627fbb406561e64326864d8ca3cd24d
-rw-r--r--go/res/values/dimens.xml20
-rw-r--r--go/res/xml/device_profiles.xml2
-rw-r--r--src/com/android/launcher3/DeviceProfile.java18
-rw-r--r--src/com/android/launcher3/Launcher.java5
4 files changed, 40 insertions, 5 deletions
diff --git a/go/res/values/dimens.xml b/go/res/values/dimens.xml
new file mode 100644
index 0000000..f1b1053
--- /dev/null
+++ b/go/res/values/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<resources>
+ <!-- Dynamic Grid -->
+ <dimen name="dynamic_grid_hotseat_size">60dp</dimen>
+</resources> \ No newline at end of file
diff --git a/go/res/xml/device_profiles.xml b/go/res/xml/device_profiles.xml
index 094fc74..487c026 100644
--- a/go/res/xml/device_profiles.xml
+++ b/go/res/xml/device_profiles.xml
@@ -25,7 +25,7 @@
launcher:numColumns="4"
launcher:numFolderRows="4"
launcher:numFolderColumns="4"
- launcher:iconSize="56"
+ launcher:iconSize="60"
launcher:iconTextSize="14.0"
launcher:defaultLayoutId="@xml/default_workspace_4x4"
/>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index dec0a92..69ee03e 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -350,9 +350,18 @@ public class DeviceProfile {
iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, dm) * scale);
iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale);
- cellWidthPx = iconSizePx + iconDrawablePaddingPx;
cellHeightPx = iconSizePx + iconDrawablePaddingPx
+ Utilities.calculateTextHeight(iconTextSizePx);
+ int cellYPadding = (getCellSize().y - cellHeightPx) / 2;
+ if (iconDrawablePaddingPx > cellYPadding && !isVerticalBarLayout()
+ && !inMultiWindowMode()) {
+ // Ensures that the label is closer to its corresponding icon. This is not an issue
+ // with vertical bar layout or multi-window mode since the issue is handled separately
+ // with their calls to {@link #adjustToHideWorkspaceLabels}.
+ cellHeightPx -= (iconDrawablePaddingPx - cellYPadding);
+ iconDrawablePaddingPx = cellYPadding;
+ }
+ cellWidthPx = iconSizePx + iconDrawablePaddingPx;
// All apps
allAppsIconTextSizePx = iconTextSizePx;
@@ -755,11 +764,14 @@ public class DeviceProfile {
return new int[] { padding.left - mInsets.left, padding.right + mInsets.left};
}
+ public boolean inMultiWindowMode() {
+ return this != inv.landscapeProfile && this != inv.portraitProfile;
+ }
+
public boolean shouldIgnoreLongPressToOverview(float touchX) {
- boolean inMultiWindowMode = this != inv.landscapeProfile && this != inv.portraitProfile;
boolean touchedLhsEdge = mInsets.left == 0 && touchX < edgeMarginPx;
boolean touchedRhsEdge = mInsets.right == 0 && touchX > (widthPx - edgeMarginPx);
- return !inMultiWindowMode && (touchedLhsEdge || touchedRhsEdge);
+ return !inMultiWindowMode() && (touchedLhsEdge || touchedRhsEdge);
}
private static Context getContext(Context c, int orientation) {
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 522e96a..32af059 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -91,6 +91,7 @@ import com.android.launcher3.anim.AnimationLayerSet;
import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.LauncherAppsCompatVO;
+import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
@@ -137,6 +138,7 @@ import com.android.launcher3.widget.WidgetAddFlowHandler;
import com.android.launcher3.widget.WidgetHostViewLoader;
import com.android.launcher3.widget.WidgetsContainerView;
+
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -3893,7 +3895,8 @@ public class Launcher extends BaseActivity
}
private boolean shouldShowDiscoveryBounce() {
- return mState == State.WORKSPACE && !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false);
+ UserManagerCompat um = UserManagerCompat.getInstance(this);
+ return mState == State.WORKSPACE && !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false) && !um.isDemoUser();
}
protected void moveWorkspaceToDefaultScreen() {