Android 13.0 Launcher3 customized folder folder 16 square grid implementation

1 Overview

In the customized development of 13.0 system product rom, there are many customization functions for Launcher3, such as adding a default folder in Launcher3, adding the default app to the folder, and other apps
and then sort in order. The folder layout is the default 16-square grid layout. Next, analyze the relevant source code to implement the function

2.Launcher3 customization modification: the default folder added is the core class of the 16-square grid style

        packages\apps\Launcher3\src\com\android\launcher3\folder\ClippedFolderIconLayoutRule.java
        packages\apps\Launcher3\res\xml\default_workspace_5x5.xml

3.Launcher3 customization modified and added the default folder to be the core function analysis and implementation of the 16-square grid style
3.1 Implementation of the default added folder function

The default folder added in the customization of Launcher3 is implemented in the core function of 16-square grid style. Through the above source code analysis,
Long pressing the desktop icon in Launcher3 will form a file folder. The opened folder is called Folder
, and the folder with the same icon on the desktop is called FolderIcon. The main logic code of the folder is under the Launcher\src\com\android\launcher3\folder package a>
To add a default folder in Launcher3, add the folder and then add it to database.db during parsing. There are several different default_workspace.xml in xml
Layout, corresponding to different xml files according to the screen resolution

Next add the default folder as follows:


        <favorites xmlns:launcher="http://schemas.android.co

Guess you like

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