Android 12.0 Launcher3 customization modified the added default folder to a 9-square grid style

1 Overview

In the customized development of 12.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 9-square grid layout. Next, analyze the relevant source code to implement the relevant functions

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

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

3.Launcher3 customization modified and added the default folder to analyze and implement the core functions of the 9-square grid style

FolderGridOrganizer.java: Expand the calculation logic class for folder display. The folder icon is presented in a grid shape. This class mainly sets display rules for each application icon in the folder, such as 3*4, 4*4
ClippedFolderIconLayoutRule.java: Computing class for displaying small icon thumbnails inside folder icons, common implementation class for 4-square and 9-square display

3.1 Implementation of adding folder function by default

The default folder added in the customization of Launcher3 is implemented in the core function of 9-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>
in Lau

Guess you like

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