1.显示 Hotseat 应用图标名称。
Launcher3srccomandroidlauncher3CellLayout.java
// Hotseat icons - remove text
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;
- bubbleChild.setTextVisibility(mContainerType != HOTSEAT);
+ bubbleChild.setTextVisibility(true);
}
2.显示 Hotseat 区域文件夹图标名称。
Launcher3srccomandroidlauncher3WorkspaceLayoutManager.java
// Hide folder title in the hotseat
if (child instanceof FolderIcon) {
- ((FolderIcon) child).setTextVisible(false);
+ ((FolderIcon) child).setTextVisible(true);
}
3.设置默认文件夹名称
packages/apps/Launcher3/src/com/android/launcher3/folder/FolderIcon
public static FolderIcon inflateIcon(int resId, ActivityContext activity, ViewGroup group,
FolderInfo folderInfo) {
@SuppressWarnings("all") // suppress dead code warning
final boolean error = INITIAL_ITEM_ANIMATION_DURATION >= DROp_IN_ANIMATION_DURATION;
if (error) {
throw new IllegalStateException("DROP_IN_ANIMATION_DURATION must be greater than " +
"INITIAL_ITEM_ANIMATION_DURATION, as sequencing of adding first two items " +
"is dependent on this");
}
DeviceProfile grid = activity.getDeviceProfile();
FolderIcon icon = (FolderIcon) LayoutInflater.from(group.getContext())
.inflate(resId, group, false);
icon.setClipToPadding(false);
icon.mFolderName = icon.findViewById(R.id.folder_icon_name);
//判断显示为空的时候,默认添加字符串
if(TextUtils.isEmpty(folderInfo.title)&&activity instanceof Launcher){
folderInfo.setTitle("文件夹", ((Launcher)activity).getModelWriter());
}
4.调整 Hotseat 图标大小。
修改完成后,若发现 Hotseat 图标名称显示不全,需要调整 Hotseat 大小,使图标名称显示完全。
Launcher3resvaluesdimens.xml
-34dp +48dp



