Skip to content

Instantly share code, notes, and snippets.

@Yonezpt
Created January 5, 2019 22:30
Show Gist options
  • Save Yonezpt/b335e82c0f42b919b3bc51aacaee1a8c to your computer and use it in GitHub Desktop.
Save Yonezpt/b335e82c0f42b919b3bc51aacaee1a8c to your computer and use it in GitHub Desktop.
Pixel launcher 3.9 changes to remove the Google search from the home screen
Index: res/layout/hotseat.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- res/layout/hotseat.xml (revision 23203324e3e8ef2bc5ab7f2dedacbebc9672da2d)
+++ res/layout/hotseat.xml (date 1546726980687)
@@ -23,5 +23,5 @@
android:layout_height="match_parent"
android:layout_gravity="center"
launcher:containerType="hotseat" />
- <include layout="@layout/search_container_hotseat" />
+ <!--<include layout="@layout/search_container_hotseat" />-->
</com.android.launcher3.Hotseat>
Index: src/com/android/launcher3/DeviceProfile.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/com/android/launcher3/DeviceProfile.java (revision 23203324e3e8ef2bc5ab7f2dedacbebc9672da2d)
+++ src/com/android/launcher3/DeviceProfile.java (date 1546726980726)
@@ -231,7 +231,7 @@
hotseatBarSizePx = isVerticalBarLayout()
? Utilities.pxFromDp(inv.iconSize, dm)
: res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_size)
- + hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx;
+ + hotseatBarTopPaddingPx/* + hotseatBarBottomPaddingPx*/;
mBottomMarginHw = res.getDimensionPixelSize(R.dimen.qsb_hotseat_bottom_margin_hw);
if (!isVerticalBarLayout()) {
@@ -254,19 +254,19 @@
updateAvailableDimensions(dm, res);
// Now that we have all of the variables calculated, we can tune certain sizes.
- float aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx);
- boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
- if (!isVerticalBarLayout() && isPhone && isTallDevice) {
- // We increase the hotseat size when there is extra space.
- // ie. For a display with a large aspect ratio, we can keep the icons on the workspace
- // in portrait mode closer together by adding more height to the hotseat.
- // Note: This calculation was created after noticing a pattern in the design spec.
- int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx;
- hotseatBarSizePx += extraSpace - pageIndicatorSizePx;
-
- // Recalculate the available dimensions using the new hotseat size.
- updateAvailableDimensions(dm, res);
- }
+ // float aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx);
+ // boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
+ // if (!isVerticalBarLayout() && isPhone && isTallDevice) {
+ // // We increase the hotseat size when there is extra space.
+ // // ie. For a display with a large aspect ratio, we can keep the icons on the workspace
+ // // in portrait mode closer together by adding more height to the hotseat.
+ // // Note: This calculation was created after noticing a pattern in the design spec.
+ // int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx;
+ // hotseatBarSizePx += extraSpace - pageIndicatorSizePx;
+ //
+ // // Recalculate the available dimensions using the new hotseat size.
+ // updateAvailableDimensions(dm, res);
+ // }
computeAllAppsButtonSize(context);
@@ -526,7 +526,7 @@
edgeMarginPx);
}
} else {
- int paddingBottom = hotseatBarSizePx + pageIndicatorSizePx;
+ int paddingBottom = hotseatBarSizePx + hotseatBarBottomPaddingPx + pageIndicatorSizePx;
if (isTablet) {
// Pad the left and right of the workspace to ensure consistent spacing
// between all icons
@@ -539,7 +539,7 @@
width * MAX_HORIZONTAL_PADDING_PERCENT);
int availablePaddingY = Math.max(0, height - topWorkspacePadding - paddingBottom
- (2 * inv.numRows * cellHeightPx) - hotseatBarTopPaddingPx
- - hotseatBarBottomPaddingPx);
+ /*- hotseatBarBottomPaddingPx*/);
padding.set(availablePaddingX / 2, topWorkspacePadding + availablePaddingY / 2,
availablePaddingX / 2, paddingBottom + availablePaddingY / 2);
} else {
@@ -639,7 +639,7 @@
PagedView workspace = (PagedView) launcher.findViewById(R.id.workspace);
Rect workspacePadding = getWorkspacePadding(null);
workspace.setPadding(workspacePadding.left, workspacePadding.top, workspacePadding.right,
- workspacePadding.bottom);
+ workspacePadding.bottom - (isVerticalBarLayout() ? 0 : hotseatBarBottomPaddingPx));
workspace.setPageSpacing(getWorkspacePageSpacing());
// Layout the hotseat
@@ -681,7 +681,7 @@
+ cellLayoutPaddingLeftRightPx,
hotseatBarTopPaddingPx,
hotseatAdjustment + workspacePadding.right + cellLayoutPaddingLeftRightPx,
- hotseatBarBottomPaddingPx + mInsets.bottom + cellLayoutBottomPaddingPx);
+ /*hotseatBarBottomPaddingPx +*/ mInsets.bottom + cellLayoutBottomPaddingPx);
} else {
// For phones, layout the hotseat without any bottom margin
// to ensure that we have space for the folders
@@ -692,7 +692,7 @@
+ cellLayoutPaddingLeftRightPx,
hotseatBarTopPaddingPx,
hotseatAdjustment + workspacePadding.right + cellLayoutPaddingLeftRightPx,
- hotseatBarBottomPaddingPx + mInsets.bottom + cellLayoutBottomPaddingPx);
+ /*hotseatBarBottomPaddingPx +*/ mInsets.bottom + cellLayoutBottomPaddingPx);
}
hotseat.setLayoutParams(lp);
Index: src/com/android/launcher3/allapps/AllAppsCaretController.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/com/android/launcher3/allapps/AllAppsCaretController.java (revision 23203324e3e8ef2bc5ab7f2dedacbebc9672da2d)
+++ src/com/android/launcher3/allapps/AllAppsCaretController.java (date 1546726980700)
@@ -81,7 +81,9 @@
} else if (!dragging) {
// Otherwise, if we're not dragging, match the caret to the appropriate state
if (containerProgress <= getThreshold()) { // All Apps is up
- animateCaretToProgress(CaretDrawable.PROGRESS_CARET_POINTING_DOWN);
+ if (mLauncher.useVerticalBarLayout()) {
+ animateCaretToProgress(CaretDrawable.PROGRESS_CARET_POINTING_DOWN);
+ }
} else if (containerProgress >= 1 - getThreshold()) { // All Apps is down
animateCaretToProgress(CaretDrawable.PROGRESS_CARET_POINTING_UP);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment