Android launcher3后台任务中心竖屏默认显示横屏,热座椅显示竖屏默认横屏
/packages/apps/Launcher3/src/com/android/launcher3/DeviceProfile.java
**
* When {@code true}, the device is in landscape mode and the hotseat is on the right column.
* When {@code false}, either device is in portrait mode or the device is in landscape mode and
* the hotseat is on the bottom row.
*/
public boolean isVerticalBarLayout() {
//*/show HotSeat in Bottom in Landscape & quickstep app show landscape
return false;
/*/
return isLandscape && transposeLayoutWithOrientation;
//*/
}
如何调整桌面的图标和字体的间距大小和整个行宽高大小?
private void updateIconSize(float scale, Resources res, DisplayMetrics dm) {
// Workspace
final boolean isVerticalLayout = isVerticalBarLayout();
float invIconSizePx = isVerticalLayout ? inv.landscapeIconSize : inv.iconSize;
iconSizePx = Math.max(1, (int) (ResourceUtils.pxFromDp(invIconSizePx, dm) * scale));
iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, dm) * scale);
iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale);cellHeightPx = iconSizePx + iconDrawablePaddingPx
+ Utilities.calculateTextHeight(iconTextSizePx) + 20;//*/add increase cellHeightPx inner Workspace 1
int cellYPadding = (getCellSize().y - cellHeightPx) / 2 + 10;//*/set padding about icon and text outer Workspace 2
if (iconDrawablePaddingPx > cellYPadding && !isVerticalLayout
&& !isMultiWindowMode) {
// 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 + 5;//*/add
allAppsIconSizePx = iconSizePx + 3;//*/add
allAppsIconDrawablePaddingPx = iconDrawablePaddingPx + 5;//*/add inner Workspace 1
allAppsCellHeightPx = getCellSize().y + 20;//*/add outer Workspace 2if (isVerticalLayout) {
// Always hide the Workspace text with vertical bar layout.
adjustToHideWorkspaceLabels();
}// Hotseat
if (isVerticalLayout) {
hotseatBarSizePx = iconSizePx + hotseatBarSidePaddingStartPx
+ hotseatBarSidePaddingEndPx;
}
hotseatCellHeightPx = iconSizePx;if (!isVerticalLayout) {
int expectedWorkspaceHeight = availableHeightPx - hotseatBarSizePx
- verticalDragHandleSizePx - edgeMarginPx;
float minRequiredHeight = dropTargetBarSizePx + workspaceSpringLoadedBottomSpace;
workspaceSpringLoadShrinkFactor = Math.min(
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f,
1 - (minRequiredHeight / expectedWorkspaceHeight));
} else {
workspaceSpringLoadShrinkFactor =
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f;
}// Folder icon
folderIconSizePx = IconNormalizer.getNormalizedCircleSize(iconSizePx);
folderIconOffsetYPx = (iconSizePx - folderIconSizePx) / 2;
}
原文地址:https://blog.csdn.net/qq_46687516/article/details/143751507
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!