mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Hide workspace text in multi-window mode.
* Vertically centers workspace icons. * New iconDisplay value so shortcut text is not overriden. Bug: 32176631 Change-Id: I86753bab5b24aafc417e0f77d8c471fc4c0dc7f0
This commit is contained in:
@@ -18,13 +18,25 @@ package com.android.launcher3;
|
||||
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.support.annotation.IntDef;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
public class ShortcutAndWidgetContainer extends ViewGroup {
|
||||
static final String TAG = "CellLayoutChildren";
|
||||
static final String TAG = "ShortcutAndWidgetContainer";
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({DEFAULT, HOTSEAT, FOLDER})
|
||||
public @interface ContainerType{}
|
||||
public static final int DEFAULT = 0;
|
||||
public static final int HOTSEAT = 1;
|
||||
public static final int FOLDER = 2;
|
||||
|
||||
private int mContainerType = DEFAULT;
|
||||
|
||||
// These are temporary variables to prevent having to allocate a new object just to
|
||||
// return an (x, y) value from helper functions. Do NOT use them to maintain other state.
|
||||
@@ -32,8 +44,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
|
||||
|
||||
private final WallpaperManager mWallpaperManager;
|
||||
|
||||
private boolean mIsHotseatLayout;
|
||||
|
||||
private int mCellWidth;
|
||||
private int mCellHeight;
|
||||
|
||||
@@ -101,20 +111,19 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
|
||||
mInvertIfRtl = invert;
|
||||
}
|
||||
|
||||
public void setIsHotseat(boolean isHotseat) {
|
||||
mIsHotseatLayout = isHotseat;
|
||||
}
|
||||
|
||||
int getCellContentWidth() {
|
||||
final DeviceProfile grid = mLauncher.getDeviceProfile();
|
||||
return Math.min(getMeasuredHeight(), mIsHotseatLayout ?
|
||||
grid.hotseatCellWidthPx: grid.cellWidthPx);
|
||||
public void setContainerType(@ContainerType int containerType) {
|
||||
mContainerType = containerType;
|
||||
}
|
||||
|
||||
int getCellContentHeight() {
|
||||
final DeviceProfile grid = mLauncher.getDeviceProfile();
|
||||
return Math.min(getMeasuredHeight(), mIsHotseatLayout ?
|
||||
grid.hotseatCellHeightPx : grid.cellHeightPx);
|
||||
int cellContentHeight = grid.cellHeightPx;
|
||||
if (mContainerType == HOTSEAT) {
|
||||
cellContentHeight = grid.hotseatCellHeightPx;
|
||||
} else if (mContainerType == FOLDER) {
|
||||
cellContentHeight = grid.folderCellHeightPx;
|
||||
}
|
||||
return Math.min(getMeasuredHeight(), cellContentHeight);
|
||||
}
|
||||
|
||||
public void measureChild(View child) {
|
||||
|
||||
Reference in New Issue
Block a user