Implementation of the function of centering display of folder folder files in Android 10.0 Launcher3 customization

1 Overview

In the 10.0 system product development, in the custom development of Launcher3, in recent product projects, there is a demand for the default folder function, so the UI of the folder needs to be modified with customized functions in the folder. After full screen, the sub-file part needs to be centered. It is more beautiful to display it in the center. Next, we will deal with the centered display part.

As shown in the picture:

2. Customized core class for the central display of Launcher3 folder folder files

    packages\apps\Launcher3\res\layout\user_folder_icon_normalized.xml
    packages\apps\Launcher3\src\com\android\launcher3\folder\FolderPagedView.java

3. Analysis and implementation of customized core functions of Launcher3 folder folder files displayed in the center

In the customization function of Launcher3, when customizing the UI of the folder folder, you need to first find the layout of the relevant Items in the folder added by the system. After consulting the source code in Launcher3, it was found that the layout layout referenced by the Folder folder class is
user_folder_icon_normalized.xml, let’s take a look at its related layout analysis

FolderIcon : The icon that appears in the workspace represents a folder

FolderInfo: ItemInfo subclass HandleView: launcher drawer switch

ItemInfo: represents an Item (such as folder) pair in Launcher

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/133469082