CN117555639A - Desktop assembly processing method, device and electronic equipment - Google Patents
Desktop assembly processing method, device and electronic equipment Download PDFInfo
- Publication number
- CN117555639A CN117555639A CN202311555434.3A CN202311555434A CN117555639A CN 117555639 A CN117555639 A CN 117555639A CN 202311555434 A CN202311555434 A CN 202311555434A CN 117555639 A CN117555639 A CN 117555639A
- Authority
- CN
- China
- Prior art keywords
- sub
- component
- components
- desktop
- positions
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/0486—Drag-and-drop
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请公开了一种桌面组件的处理方法、装置及电子设备,属于计算机技术领域。该方法包括:确定桌面上的第一位置;在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置;根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。
This application discloses a desktop component processing method, device and electronic equipment, belonging to the field of computer technology. The method includes: determining a first position on the desktop; when the first number of sub-components in the component is greater than 1, determining the first position and the second number of second positions on the desktop, the second position represents an idle position adjacent to the first position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions; according to the first number and the The second quantity is used to fill at least part of the sub-assemblies of the assembly to the first position and the second position.
Description
技术领域Technical field
本申请属于计算机技术领域,具体涉及一种桌面组件的处理方法、装置及电子设备。The present application belongs to the field of computer technology, and specifically relates to a desktop component processing method, device and electronic equipment.
背景技术Background technique
目前,电子设备上的应用越来越多,大部分应用会提供应用组件,该应用组件可以直接添加在桌面上,用于显示特定的信息,以便用户能够更快捷地获取到所需要的信息,提高用户体验。Currently, there are more and more applications on electronic devices. Most applications provide application components, which can be added directly to the desktop to display specific information so that users can obtain the information they need more quickly. Improve user experience.
但是,在桌面上添加应用组件的过程中,由于每一个应用提供的应用组件的大小和形状不一致,桌面上剩余的空闲位置不一定与应用组件所需的空间匹配,从而导致无法成功在桌面上添加应用组件,无法为用户提供快捷的组件信息获取途径,降低用户体验。However, in the process of adding application components to the desktop, due to the inconsistent size and shape of the application components provided by each application, the remaining free space on the desktop does not necessarily match the space required by the application components, resulting in the inability to successfully add application components to the desktop. Adding application components cannot provide users with a quick way to obtain component information, which reduces the user experience.
发明内容Contents of the invention
本申请实施例的目的是提供一种桌面组件的处理方法、装置及电子设备,能够解决现有的组件和桌面空闲位置不匹配导致无法成功添加组件的问题。The purpose of the embodiments of the present application is to provide a desktop component processing method, device and electronic device, which can solve the problem of failure to successfully add components due to mismatch between existing components and free desktop locations.
第一方面,本申请实施例提供了一种桌面组件的处理方法,包括:In the first aspect, embodiments of the present application provide a method for processing desktop components, including:
确定桌面上的第一位置;Determine the first position on the desktop;
在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置;In the case where the first number of sub-components in the component is greater than 1, determining the first position and the second number of second positions on the desktop, the second position representing an idle position adjacent to the first position , or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions;
根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。According to the first quantity and the second quantity, at least part of the sub-assemblies of the assembly are filled to the first position and the second position.
第二方面,本申请实施例提供了一种桌面组件的处理装置,包括:In a second aspect, embodiments of the present application provide a processing device for desktop components, including:
第一确定模块,用于确定桌面上的第一位置;The first determination module is used to determine the first position on the desktop;
第二确定模块,用于在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置;The second determination module is configured to determine the first position and the second number of second positions on the desktop when the first number of sub-components in the assembly is greater than 1, and the second position represents the same as the first position. An idle position adjacent to a position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions;
第一填充模块,用于根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。A first filling module is used to fill at least some sub-assemblies in the assembly to the first position and the second position according to the first quantity and the second quantity.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The programs or instructions are processed by the processor. When the processor is executed, the steps of the method described in the first aspect are implemented.
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the method described in the first aspect are implemented. .
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a fifth aspect, embodiments of the present application provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the first aspect. the method described.
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a sixth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
在本申请实施例中,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则确定桌面上第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置,即需要确定包括第一位置在内的、连续的空闲位置的数量,以便得知能够填充多少个子组件。并且,根据第一数量以及第二数量,将组件中的至少部分子组件填充至第一位置以及第二位置,即通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充的子组件数量,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与空闲位置不匹配,也能将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。In the embodiment of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, then determine the second number of the first position and the second position on the desktop, and the second The position represents an idle position adjacent to the first position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions, that is, it needs to be determined to include the first position The number of contiguous free slots included so that we know how many subcomponents can be filled. Furthermore, according to the first quantity and the second quantity, at least some of the sub-components in the component are filled into the first position and the second position, that is, based on the number of free positions and the number of sub-components, it is judged whether the free positions can fill all the sub-components. The component and the number of sub-components that can be filled, thereby filling at least a portion of the sub-components in the component according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the free location, at least some of the sub-components in the component can be added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
附图说明Description of the drawings
图1是本申请实施例提供的桌面组件的处理方法的流程示意图之一;Figure 1 is one of the schematic flow diagrams of a desktop component processing method provided by an embodiment of the present application;
图2是本申请实施例提供的桌面组件的处理示意图之一;Figure 2 is one of the processing schematic diagrams of the desktop component provided by the embodiment of the present application;
图3是本申请实施例提供的组件的示意图;Figure 3 is a schematic diagram of components provided by an embodiment of the present application;
图4是本申请实施例提供的桌面组件的处理示意图之二;Figure 4 is the second schematic diagram of processing the desktop component provided by the embodiment of the present application;
图5是本申请实施例提供的桌面组件的处理示意图之三;Figure 5 is the third schematic diagram of processing the desktop component provided by the embodiment of the present application;
图6是本申请实施例提供的桌面组件的处理示意图之四;Figure 6 is the fourth schematic diagram of processing the desktop component provided by the embodiment of the present application;
图7是本申请实施例提供的桌面组件的处理示意图之五;Figure 7 is the fifth schematic diagram of processing the desktop component provided by the embodiment of the present application;
图8是本申请实施例提供的桌面组件的处理示意图之六;Figure 8 is the sixth schematic diagram of processing the desktop component provided by the embodiment of the present application;
图9是本申请实施例提供的桌面组件的处理方法的流程示意图之二;Figure 9 is the second schematic flowchart of the desktop component processing method provided by the embodiment of the present application;
图10是本申请实施例提供的桌面组件的处理示意图之七;Figure 10 is the seventh schematic diagram of processing the desktop component provided by the embodiment of the present application;
图11是本申请实施例提供的桌面组件的处理示意图之八;Figure 11 is the eighth schematic diagram of processing the desktop component provided by the embodiment of the present application;
图12是本申请实施例提供的桌面组件的处理示意图之九;Figure 12 is a ninth schematic diagram of the processing of the desktop component provided by the embodiment of the present application;
图13是本申请实施例提供的桌面组件的处理示意图之十;Figure 13 is a schematic diagram 10 of the processing of the desktop component provided by the embodiment of the present application;
图14是本申请实施例提供的桌面组件的处理示意图之十一;Figure 14 is an eleventh schematic diagram of the processing of the desktop component provided by the embodiment of the present application;
图15是本申请实施例提供的桌面组件的处理方法的流程示意图之三;Figure 15 is the third schematic flowchart of the desktop component processing method provided by the embodiment of the present application;
图16是本申请实施例提供的一种桌面组件的处理装置的结构示意图;Figure 16 is a schematic structural diagram of a desktop component processing device provided by an embodiment of the present application;
图17是本申请实施例提供的一种电子设备的结构框图;Figure 17 is a structural block diagram of an electronic device provided by an embodiment of the present application;
图18是本申请实施例提供的另一种电子设备的结构框图。Figure 18 is a structural block diagram of another electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances so that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的桌面组件的处理方法进行说明。The processing method of desktop components provided by the embodiments of the present application will be described below with reference to the accompanying drawings through specific embodiments and application scenarios.
如图1所示,本申请实施例提供了一种桌面组件的处理方法,具体可以包括如下步骤:As shown in Figure 1, this embodiment of the present application provides a method for processing desktop components, which may specifically include the following steps:
步骤101,确定桌面上的第一位置。Step 101: Determine the first position on the desktop.
在用户需要在桌面上添加组件的情况下,可以通过长按桌面、双击桌面、滑动手势等操作进入添加组件模式,由此进入组件库,该组件库中包括多个应用的组件,用户根据需要选择所需的组件,并将该组件拖动至桌面上的第一位置,由此确定第一位置是用于填充组件的空闲位置。When the user needs to add components to the desktop, he can enter the add component mode by long pressing the desktop, double-clicking the desktop, sliding gestures, etc., and then enters the component library. The component library includes components of multiple applications. The user can add components as needed. Select the desired component and drag it to the first position on the desktop, thereby determining that the first position is the free position for filling the component.
需要说明的是,上述进入添加组件模式的方式仅为示例,也可以根据需要设定其他方式进入添加组件模式。并且,上述确定的第一位置的方式也仅为示例,可以根据需要设定其他方式确定第一位置。It should be noted that the above-mentioned method of entering the component-adding mode is only an example, and other methods of entering the component-adding mode can also be set as needed. Moreover, the above-described method of determining the first position is only an example, and other methods of determining the first position may be set as needed.
在一具体示例中,如图2所示,用户在组件库用手指选中组件,并将组件拖动至桌面上的第一位置21,即手指所指的位置。其中,桌面上的空闲位置和非空闲位置的分布如图2所示,每一个方框代表桌面上的一个位置,该位置可以为空闲位置,也可以为非空闲位置。In a specific example, as shown in Figure 2, the user selects a component in the component library with his finger and drags the component to the first position 21 on the desktop, which is the position pointed by the finger. The distribution of idle locations and non-idle locations on the desktop is shown in Figure 2. Each box represents a location on the desktop, which can be an idle location or a non-idle location.
步骤102,在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置。Step 102: If the first number of sub-components in the component is greater than 1, determine the second number of the first position and the second position on the desktop, and the second position represents adjacent to the first position. an idle position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions.
在步骤102之前,需要说明的是,在进行组件的填充之前,将桌面进行网格化,即将整个桌面平均划分为多个网格,每一个网格代表一个位置。每一个应用在提供组件时,会基于桌面上每一个位置的大小尺寸设计组件的尺寸,组件中的一个子组件的尺寸小于或等于桌面上一个位置的尺寸,即组件库中任意一个组件的其中一个子组件的尺寸均小于或等于桌面上的第一位置的尺寸,以便一个位置能够填充一个子组件。并且,每一个组件都可以进行拆分,即如果组件中包括多个子组件,则可以将组件拆分成多个子组件。Before step 102, it should be noted that before filling in components, the desktop is gridded, that is, the entire desktop is evenly divided into multiple grids, each grid representing a position. When each application provides a component, it will design the size of the component based on the size of each position on the desktop. The size of a sub-component in the component is less than or equal to the size of a position on the desktop, that is, the size of any component in the component library. The dimensions of a subcomponent are all smaller than or equal to the size of the first position on the desktop, so that a position can fill a subcomponent. Moreover, each component can be split, that is, if the component includes multiple sub-components, the component can be split into multiple sub-components.
在一具体示例中,如图3所示,如果组件31为天气组件,包括三个子组件,可以将组件拆分成三个子组件,三个子组件分别显示三个不同地区的天气情况。In a specific example, as shown in Figure 3, if the component 31 is a weather component and includes three sub-components, the component can be split into three sub-components, and the three sub-components respectively display the weather conditions in three different regions.
在确定组件之后,判断组件中的子组件的第一数量,如果第一数量为1,则表示组件中只有一个子组件,可以直接将组件填充至第一位置。如果组件中的子组件的第一数量大于1,表示第一位置无法容纳组件中的所有子组件,因此需要检测桌面上第一位置以及与第一位置相邻的空闲位置的总数量,即第二数量;或者需要检测桌面上第一位置、与第一位置相邻的空闲位置、与第一位置不相邻、且与第一位置之间的位置均为空闲位置的空闲位置的总数量,即第二数量,通过第二数量可以确定能够填充的子组件的数量。After determining the component, determine the first number of sub-components in the component. If the first number is 1, it means that there is only one sub-component in the component, and the component can be directly filled to the first position. If the first number of sub-components in the component is greater than 1, it means that the first position cannot accommodate all the sub-components in the component, so it is necessary to detect the first position on the desktop and the total number of free positions adjacent to the first position, that is, the first position Two quantities; or it is necessary to detect the first position on the desktop, the free positions adjacent to the first position, the total number of free positions that are not adjacent to the first position, and the positions between the first position and the first position are all free positions, That is, the second quantity by which the number of subassemblies that can be filled can be determined.
步骤103,根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。Step 103: Fill at least some sub-assemblies in the assembly to the first position and the second position according to the first quantity and the second quantity.
通过第一位置和第二位置的总数量(即第二数量)以及组件中的子组件的第一数量,可以得知第二数量与第一数量的大小关系,如果第一数量小于第二数量,则表示子组件可以全部填充至第一位置和第二位置,可以将子组件填充至第一位置和第二位置中的第一数量的空闲位置中;如果第一数量等于第二数量,则将子组件全部填充至第一位置和第二位置;如果第一数量大于第二数量,则表示第一位置和第二位置无法填充所有的子组件,因此只能将第二数量的子组件填充至第一位置和第二位置。Through the total quantity of the first position and the second position (i.e. the second quantity) and the first number of sub-components in the component, the size relationship between the second quantity and the first quantity can be known. If the first quantity is less than the second quantity , it means that the subcomponents can all be filled into the first position and the second position, and the subcomponents can be filled into the first number of free positions in the first position and the second position; if the first number is equal to the second number, then Fill all sub-components to the first and second positions; if the first quantity is greater than the second quantity, it means that the first and second positions cannot fill all the sub-components, so only the second number of sub-components can be filled to the first and second positions.
在本申请上述实施例中,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则确定桌面上第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者,所述第二位置表征与所述第一位置相邻的空闲位置,以及与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置,即需要确定包括第一位置在内的、连续的空闲位置的数量,以便得知能够填充多少个子组件。并且,根据第一数量以及第二数量,将组件中的至少部分子组件填充至第一位置以及第二位置,即通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充的子组件数量,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与空闲位置不匹配,也能将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。In the above embodiment of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, then determine the second number of the first position and the second position on the desktop, and the The second position represents an idle position adjacent to the first position, or the second position represents an idle position adjacent to the first position, and is not adjacent to the first position and is adjacent to the third position. The positions between a position are all free positions. That is, the number of consecutive free positions including the first position needs to be determined in order to know how many sub-components can be filled. Furthermore, according to the first quantity and the second quantity, at least some of the sub-components in the component are filled into the first position and the second position, that is, based on the number of free positions and the number of sub-components, it is judged whether the free positions can fill all the sub-components. The component and the number of sub-components that can be filled, thereby filling at least a portion of the sub-components in the component according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the free location, at least some of the sub-components in the component can be added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
可选地,在将组件拆分成多个子组件后,可以根据空闲位置的形状调整多个子组件的形状。Optionally, after the component is split into multiple sub-components, the shape of the multiple sub-components can be adjusted according to the shape of the idle position.
作为步骤102一可选的实施例,所述在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,具体可以包括:As an optional embodiment of step 102, when the first number of sub-components in the component is greater than 1, determining the second number of the first position and the second position on the desktop may specifically include:
在所述组件中的子组件的第一数量大于1的情况下,检测桌面上的第一区域中是否有所述第二位置;In the case where the first number of sub-components in the component is greater than 1, detect whether there is the second position in the first area on the desktop;
在所述第一区域有所述第二位置的情况下,获取所述第二位置的数量;If the first area has the second position, obtain the number of the second position;
将所述第二位置的数量和所述第一位置的数量之和确定为所述第二数量;Determine the sum of the number of the second positions and the number of the first positions as the second number;
其中,所述第一区域表征桌面上以所述第一位置为中心、以第一数值为半径所形成的区域,所述第一数值为所述组件的长度方向的子组件数量和宽度方向的子组件数量中最大值的数值。Wherein, the first area represents an area on the desktop formed with the first position as the center and a first numerical value as the radius. The first numerical value is the number of sub-components in the length direction and the width direction of the component. The numerical value of the maximum number of subcomponents.
具体的,在确定组件之后,判断组件中的子组件的第一数量,如果组件中的子组件的第一数量大于1,表示第一位置无法容纳组件中的所有子组件,因此需要检测桌面上是否有处于空闲状态的第二位置,如果有,则获取第二位置的数量,第二位置的数量与第一位置的数量之和即为第二数量。Specifically, after determining the component, determine the first number of sub-components in the component. If the first number of sub-components in the component is greater than 1, it means that the first position cannot accommodate all the sub-components in the component, so it is necessary to detect the number of sub-components on the desktop. Whether there is an idle second position, and if so, obtain the number of second positions. The sum of the number of second positions and the number of first positions is the second number.
在检测桌面上是否有第二位置之前,可以设定检测的第一区域,即将组件在长度方向上的子组件数量和组件在宽度方向上的子组件数量进行大小比较,将较大值作为第一数值,以第一位置为中心、以第一数值为半径形成的区域即为第一区域,由此在第一区域中检测是否有第二位置,不需要对整个桌面进行检测,能够提高效率并节省资源。Before detecting whether there is a second position on the desktop, you can set the first area for detection, that is, compare the number of sub-components of the component in the length direction with the number of sub-components of the component in the width direction, and use the larger value as the first area. A value, the area formed with the first position as the center and the first value as the radius is the first area. Therefore, it is detected whether there is a second position in the first area. There is no need to detect the entire desktop, which can improve efficiency. and save resources.
需要说明的是,如果以第一位置为中心、以第一数值为半径所形成的区域超出桌面范围,则忽略超出桌面范围的区域,剩下的区域即为需要检测的第一区域。It should be noted that if the area formed with the first position as the center and the first numerical value as the radius exceeds the desktop range, the area beyond the desktop range is ignored, and the remaining area is the first area that needs to be detected.
在一具体示例中,如图2所示,如果组件31为3*1的组件,即组件31包括三个子组件,则组件31在长度方向上的子组件数量为3,组件31在宽度方向上的子组件数量为1。如图2所示,由于3大于1,则3作为第一数值,以第一位置21为中心、以3为半径形成的区域即为第一区域22。In a specific example, as shown in Figure 2, if the component 31 is a 3*1 component, that is, the component 31 includes three sub-components, the number of sub-components of the component 31 in the length direction is 3, and the number of sub-components of the component 31 in the width direction is 3. The number of subcomponents is 1. As shown in FIG. 2 , since 3 is greater than 1, 3 is used as the first value, and the area formed with the first position 21 as the center and 3 as the radius is the first area 22 .
下面通过实施例一和实施例二对上述步骤103进行说明:The above step 103 will be described below through Embodiment 1 and Embodiment 2:
实施例一:Example 1:
所述根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置,具体可以包括步骤1031和步骤1032:Filling at least part of the sub-assemblies in the assembly to the first position and the second position according to the first quantity and the second quantity may specifically include step 1031 and step 1032:
步骤1031:在所述第一数量大于所述第二数量的情况下,将所述组件中的第一子组件填充至所述第一位置以及所述第二位置,其中,所述第一子组件的数量为所述第二数量,所述第一子组件用于表征所述组件中的第一优先级的子组件。Step 1031: If the first quantity is greater than the second quantity, fill the first sub-assembly in the assembly to the first position and the second position, wherein the first sub-assembly The number of components is the second number, and the first sub-component is used to characterize a first-priority sub-component among the components.
在步骤1031之前,需要说明的是,组件库中的每一个组件中的子组件可以预先进行优先级的排序,并显示优先级的顺序,例如:如图4所示,组件31中包括三个子组件,该三个子组件按照优先级进行排序,优先级越高,优先级的数字越小,即优先级0高于优先级1,优先级1高于优先级2。子组件在所属组件中的优先级可以根据用户需要进行定义,也可以根据用户的行为习惯或者用户点击页面的次数进行优先级排序,在此不做具体限定。Before step 1031, it should be noted that the sub-components in each component in the component library can be prioritized in advance and the order of priorities can be displayed. For example: as shown in Figure 4, component 31 includes three sub-components. Components, the three sub-components are sorted according to priority. The higher the priority, the smaller the priority number, that is, priority 0 is higher than priority 1, and priority 1 is higher than priority 2. The priority of the sub-component in the component to which it belongs can be defined according to the user's needs, or the priority can be sorted according to the user's behavioral habits or the number of times the user clicks on the page. There is no specific limit here.
具体的,在步骤1031中,在得到第一数量和第二数量之后,将第一数量与第二数量进行大小比较,如果第一数量小于或等于第二数量,则表示组件的子组件全部填充至第一位置和第二位置,即一个子组件对应一个第一位置或者一个第二位置。如果第一数量大于第二数量,则表示按照一个位置填充一个子组件的方式无法将所有的子组件全部填充至第一位置和第二位置,因此可以按照子组件的优先级顺序,由高至低选择第二数量的子组件(即第一子组件)填充至第一位置和第二位置,即第一子组件的数量即为第二数量,由此避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。Specifically, in step 1031, after obtaining the first quantity and the second quantity, compare the first quantity with the second quantity. If the first quantity is less than or equal to the second quantity, it means that all sub-components of the component are filled. To the first position and the second position, that is, a subcomponent corresponds to a first position or a second position. If the first quantity is greater than the second quantity, it means that filling one subcomponent at one position cannot fill all the subcomponents to the first and second positions. Therefore, the priority of the subcomponents can be ordered from high to low. Select the second number of sub-assemblies (i.e. the first sub-assembly) to be filled into the first position and the second position, that is, the number of the first sub-assembly is the second number, thus avoiding the problem that the shape and size of the component differs from the second number. Improve user experience when one position mismatch leads to failure to successfully add components.
步骤1032:将所述组件中的第二子组件进行隐藏处理,所述第二子组件表征所述组件中的第二优先级的子组件,所述第一优先级高于所述第二优先级。Step 1032: Hide the second sub-component in the component. The second sub-component represents a sub-component with a second priority in the component. The first priority is higher than the second priority. class.
具体的,由于按照一个位置填充一个子组件的方式无法将所有的子组件全部填充至第一位置和第二位置,因此可以将组件中除第一子组件之外的第二子组件(即第二优先级的子组件)进行隐藏处理,在需要的时候再进行显示处理,避免由于位置不足无法成功添加组件的情况,提高用户体验。Specifically, since it is impossible to fill all the subcomponents to the first position and the second position by filling one subcomponent according to one position, the second subcomponent (i.e., the second subcomponent in the component except the first subcomponent) can be filled. Second-priority subcomponents) are hidden and displayed when needed to avoid the failure to successfully add components due to insufficient position and improve user experience.
需要说明的是。步骤1031中将第一子组件填充至第一位置和第二位置的步骤与步骤1032中将第二子组件进行隐藏处理的步骤不限定先后关系。It should be noted. The order of filling the first sub-component into the first position and the second position in step 1031 and the step of hiding the second sub-component in step 1032 is not limited.
在一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图5所示,第二数量为1,则桌面上只有第一位置51,没有第二位置。由此3大于1,则将组件31中优先级最高(即优先级0)的第一子组件填充至第一位置51中,得到填充后的第一位置52。将优先级1和优先级2的第二子组件进行隐藏处理,由此避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。In a specific example, as shown in FIG. 4 , the first number of sub-components of the component 31 is three. As shown in Figure 5, if the second number is 1, then there is only the first position 51 on the desktop and no second position. Therefore, if 3 is greater than 1, the first sub-component with the highest priority (that is, priority 0) in the component 31 is filled into the first position 51 to obtain the filled first position 52. The second sub-components of priority 1 and priority 2 are hidden, thereby avoiding the situation where the component cannot be successfully added due to the mismatch in shape and size with the first position, and improving the user experience.
在另一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图6所示,第二数量为3,则桌面上有一个第一位置61以及两个第二位置62。因为3等于3,则将组件31中的三个子组件全部填充至一个第一位置61和两个第二位置62中,得到填充后的第一位置63、两个填充后的第二位置64,由此避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。In another specific example, as shown in FIG. 4 , the first number of sub-components of component 31 is three. As shown in Figure 6, if the second number is 3, then there is one first position 61 and two second positions 62 on the desktop. Because 3 is equal to 3, all three sub-components in component 31 are filled into one first position 61 and two second positions 62, resulting in a filled first position 63 and two filled second positions 64. This avoids the situation where the component cannot be added successfully due to the mismatch between the shape and size of the component and the first position, thereby improving the user experience.
在另一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图7所示,第二数量为3,则桌面上有一个第一位置71以及两个第二位置72。由于第一位置71以及两个第二位置72不在一条直线上,则可以按照从左到右、从上到下的顺序依次填充三个子组件,或者可以不按照顺序随机填充三个子组件。由于3等于3,将目标组件31中的三个子组件全部填充至一个第一位置71和两个第二位置72中,得到填充后的第一位置73、两个填充后的第二位置74,由此避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。In another specific example, as shown in FIG. 4 , the first number of sub-components of component 31 is three. As shown in Figure 7, if the second number is 3, then there is one first position 71 and two second positions 72 on the desktop. Since the first position 71 and the two second positions 72 are not on a straight line, the three sub-components can be filled in order from left to right and from top to bottom, or the three sub-components can be filled randomly out of order. Since 3 is equal to 3, all three sub-components in the target component 31 are filled into one first position 71 and two second positions 72 to obtain the filled first position 73 and two filled second positions 74. This avoids the situation where the component cannot be added successfully due to the mismatch between the shape and size of the component and the first position, thereby improving the user experience.
作为一可选的实施例,在上述步骤1032将所述组件中的第二子组件进行隐藏处理之后,所述方法还可以包括:As an optional embodiment, after the second sub-component in the component is hidden in step 1032, the method may further include:
每间隔第一时长,检测所述第一位置以及所述第二位置相邻的第三位置是否为空闲位置;Every first time interval, detect whether the first position and the third position adjacent to the second position are free positions;
在所述第三位置为空闲位置的情况下,根据所述第三位置的第三数量以及所述第二子组件的第四数量,将所述第二子组件中的至少部分填充至所述第三位置。When the third position is an idle position, at least part of the second sub-assembly is filled into the second sub-assembly according to a third number of the third position and a fourth number of the second sub-assembly. third position.
具体的,在将第二子组件进行隐藏处理之后,每间隔第一时长,检测一次第一位置以及第二位置相邻的第三位置是否为空闲位置,如果第三位置为非空闲位置,则表示没有空闲位置可以填充隐藏处理的第二子组件。如果有至少一个第三位置是空闲位置,则表示有空闲位置可以填充隐藏处理的第二子组件中的至少一个,即可以根据第三位置的第三数量以及第二子组件的第四数量,确定需要将隐藏处理的第二子组件中的几个填充至第三位置,并将第二子组件中的第四数量的子组件填充至第三位置。Specifically, after the second sub-component is hidden, it is detected every first time interval whether the first position and the third position adjacent to the second position are idle positions. If the third position is a non-idle position, then Indicates that there is no free space to fill the second subcomponent of the hidden handle. If at least one third position is a free position, it means that there is a free position that can fill at least one of the second sub-components of the hidden processing, that is, according to the third number of third positions and the fourth number of second sub-components, It is determined that several of the second sub-components of the hidden processing need to be filled to the third position, and a fourth number of the second sub-components need to be filled to the third position.
需要说明的是,第一时长为预设的相邻两次检测第三位置的时间间隔,可以根据需要进行设定。It should be noted that the first duration is a preset time interval between two consecutive detections of the third position, which can be set as needed.
进一步的,上述根据所述第三位置的第三数量以及所述第二子组件的第四数量,将所述第二子组件中的至少部分填充至所述第三位置的步骤,具体可以包括:Further, the step of filling at least part of the second subassembly into the third position according to the third number of the third position and the fourth number of the second subassembly may specifically include :
将所述第三位置的第三数量与所述第二子组件的第四数量进行大小比较;Comparing the size of the third number of the third positions with the fourth number of the second subassembly;
在所述第三数量大于或等于所述第四数量的情况下,将所述第二子组件全部填充至所述第三位置中;If the third quantity is greater than or equal to the fourth quantity, all of the second subassemblies are filled into the third position;
在所述第三数量小于所述第四数量的情况下,根据所述第二子组件的优先级,将所述第二子组件中优先级高的第三数量的子组件填充至所述第三位置。When the third number is less than the fourth number, according to the priority of the second sub-component, a third number of sub-components with a higher priority among the second sub-components are filled into the third number. Three positions.
具体的,如果有至少一个第三位置为空闲位置,则表示有空闲位置可以填充隐藏处理的第二子组件中的至少一个,可以将第三位置的第三数量和第二子组件的第四数量进行大小比较,如果第三数量大于或等于第四数量,则可以将隐藏处理的第二子组件全部填充至第三位置。如果第三数量小于第四数量,则表示按照一个位置填充一个子组件的方式无法将隐藏处理的第二子组件全部填充至第三位置,Specifically, if at least one third position is an idle position, it means that there is an idle position that can be filled with at least one of the second sub-components of the hidden processing, and the third number of the third position and the fourth number of the second sub-component can be The quantities are compared in size, and if the third quantity is greater than or equal to the fourth quantity, all the second sub-components of the hidden processing can be filled to the third position. If the third quantity is less than the fourth quantity, it means that the method of filling one sub-component in one position cannot fill all the hidden second sub-components to the third position.
确定需要将隐藏处理的第二子组件中的几个填充至第三位置,并将第二子组件中的第四数量的子组件填充至第三位置,此时,将已经填充子组件的第三位置作为第二位置。以此类推,按照上述方式直至将所有隐藏处理的第二子组件全部填充至桌面上的空闲位置为止。It is determined that several of the hidden processed second sub-components need to be filled to the third position, and a fourth number of sub-components in the second sub-component need to be filled to the third position. At this time, the third number of sub-components will have been filled. The third position serves as the second position. And so on, in the above manner until all the second sub-components of hidden processing are filled to the free positions on the desktop.
作为另一可选的实施例,在上述步骤1032将所述组件中的第二子组件进行隐藏处理之后,所述方法还可以包括:As another optional embodiment, after the second sub-component in the component is hidden in step 1032, the method may further include:
在满足但不限于以下至少一者的情况下,将隐藏处理的所述第二子组件进行显示;When at least one of the following conditions is met but is not limited to, display the second sub-component of the hidden process;
接收到对所述第二子组件的第一输入;receiving a first input to the second subcomponent;
检测到所述第二子组件的数据更新。A data update for the second sub-component is detected.
具体的,如果接收到对第二子组件的第一输入,则将隐藏处理的第二子组件进行显示,以便用户在需要的情况下,能够及时获取隐藏处理的第二子组件的数据信息。或者,如果检测到第二子组件中所包括的数据有变化(如:第二子组件为天气组件,天气数据由晴天变成雨天),则自动显示隐藏处理的第二子组件,以便用户及时得知第二子组件更新后的信息。Specifically, if the first input to the second sub-component is received, the hidden-processed second sub-component is displayed, so that the user can timely obtain the data information of the hidden-processed second sub-component if needed. Or, if it is detected that the data included in the second sub-component changes (for example: the second sub-component is a weather component and the weather data changes from sunny to rainy), the second sub-component will be automatically displayed and hidden to allow the user to timely Get the updated information of the second subcomponent.
另外,可以设置显示时间,如果将第二子组件进行显示之后,在显示时间内没有进行处理,则将第二子组件继续隐藏处理。In addition, the display time can be set. If the second sub-component is not processed within the display time after the second sub-component is displayed, the second sub-component will continue to be hidden.
需要说明的是,第一输入可以是双击输入、长按输入、滑动输入等,可以根据需要进行设定。It should be noted that the first input can be double-click input, long-press input, sliding input, etc., and can be set as needed.
进一步的,所述步骤1032中的隐藏处理包括但不限于以下至少一项:Further, the hiding process in step 1032 includes but is not limited to at least one of the following:
隐藏在所述第一位置上的第一子组件的下方;hidden beneath the first subassembly at the first position;
隐藏在所述第二位置上的第一子组件的下方;hidden beneath the first subassembly in said second position;
隐藏在与所述第一位置的相邻位置上的图标的下方;Hidden below the icon at a position adjacent to the first position;
隐藏在与所述第二位置的相邻位置上的图标的下方。Hidden below the icon in a position adjacent to the second position.
具体的,可以将第二子组件隐藏在第一位置上的第一子组件的下方,也可以将第二子组件隐藏在第二位置上的第一子组件的下方;如果第二子组件的数量较多,可以将第二子组件隐藏在第一位置上的第一子组件下方以及第二位置上的第一子组件下方。或者,可以将第二子组件隐藏在第一位置的相邻位置上的图标的下方,也可以将第二子组件隐藏在第二位置的相邻位置上的图标的下方;如果第二子组件的数量较多,可以将第二子组件隐藏在第一位置的相邻位置上的图标的下方以及第二位置的相邻位置上的图标的下方。Specifically, the second subcomponent can be hidden below the first subcomponent at the first position, or the second subcomponent can be hidden below the first subcomponent at the second position; if the second subcomponent In larger quantities, the second subassembly can be hidden below the first subassembly in the first position and below the first subassembly in the second position. Alternatively, the second sub-component can be hidden below the icon at an adjacent position to the first position, or the second sub-component can be hidden below the icon at an adjacent position to the second position; if the second sub-component If the number is larger, the second sub-component can be hidden below the icon in the adjacent position of the first position and below the icon in the adjacent position of the second position.
在一具体示例中,设置隐藏方式为将第二子组件隐藏在第一位置的相邻位置的图标的下方。如图4所示,组件31的子组件的第一数量为3。如图8所示,第二数量为1,则桌面上只有第一位置81,没有第二位置。由此3大于1,则将组件31中优先级最高(即优先级0)的第一子组件填充至第一位置81中,得到填充后的第一位置82。将优先级1和优先级2的第二子组件隐藏在填充后的第一位置82左边和右边的相邻位置上的图标的下方,得到两个隐藏后的第二子组件83。In a specific example, the hiding mode is set to hide the second sub-component below the icon at an adjacent position to the first position. As shown in Figure 4, the first number of sub-components of component 31 is three. As shown in Figure 8, if the second number is 1, then there is only the first position 81 on the desktop and no second position. Therefore, if 3 is greater than 1, the first sub-component with the highest priority (that is, priority 0) in the component 31 is filled into the first position 81 to obtain the filled first position 82. The second sub-components of priority 1 and priority 2 are hidden below the icons at adjacent positions to the left and right of the filled first position 82 to obtain two hidden second sub-components 83 .
如图9所示,下面通过一具体实施例对上述实施例一的方案进行说明:As shown in Figure 9, the solution of the above-mentioned Embodiment 1 is explained below through a specific embodiment:
步骤901:长按桌面,进入组件库。Step 901: Long press the desktop to enter the component library.
步骤902:确定组件库中的组件以及第一位置。Step 902: Determine the component and first position in the component library.
步骤903:获取第二位置和第一位置的第二数量以及组件中的子组件的第一数量。Step 903: Obtain the second position and the second number of the first position and the first number of sub-components in the component.
步骤904:判断第一数量是否大于第二数量;若为否,则进入步骤905;若为是,则进入步骤906。Step 904: Determine whether the first quantity is greater than the second quantity; if not, proceed to step 905; if yes, proceed to step 906.
步骤905:将所述组件中的子组件全部填充至第一位置和第二位置。Step 905: Fill all sub-components in the component to the first position and the second position.
步骤906:根据优先级,将第一优先级的第二数量的第一子组件填充至第一位置和第二位置,并将第二优先级的第二子组件隐藏处理。Step 906: According to the priority, fill the first position and the second position with the second number of first sub-components of the first priority, and hide the second sub-components of the second priority.
步骤907:每间隔第一时长,检测第一位置以及第二位置相邻的第三位置是否为空闲位置;若为是,则进入步骤908;若为否,则循环步骤907。Step 907: Every first interval, detect whether the first position and the third position adjacent to the second position are free positions; if yes, proceed to step 908; if not, loop to step 907.
步骤908:按照优先级将第二子组件填充至第三位置。如果第二子组件没有全部填充,则返回步骤907,循环步骤907和步骤908,直至将第二子组件全部填充至第三位置,结束流程。Step 908: Fill the second sub-component to the third position according to priority. If the second subassembly is not fully filled, return to step 907 and loop step 907 and step 908 until all the second subassembly is filled to the third position, ending the process.
实施例二:Example 2:
所述根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置,包括但不限于以下四项中的任意一项:According to the first quantity and the second quantity, filling at least part of the sub-assemblies in the assembly to the first position and the second position, including but not limited to any one of the following four items item:
第一项:在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件缩小处理后填充至第一目标位置,所述第一目标位置为所述第一位置和所述第二位置组合形成的位置。The first item: when the first quantity is greater than the second quantity, the sub-components in the component are reduced and filled to the first target position, and the first target position is the first position. The position formed by combining with the second position.
具体的,在得到第一数量和第二数量之后,将第一数量与第二数量进行大小比较,如果第一数量小于或等于第二数量,则表示组件的子组件全部填充至第一位置和第二位置,即一个子组件对应一个第一位置或者一个第二位置。如果第一数量大于第二数量,则表示按照一个位置填充一个子组件的方式无法将所有的子组件全部填充至第一位置和第二位置,因此可以将组件进行缩小处理,并将缩小后的组件填充至第一位置和第二位置组成形成的位置处,由此可以将组件中的所有子组件全部显示出来,避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。Specifically, after obtaining the first quantity and the second quantity, compare the first quantity and the second quantity. If the first quantity is less than or equal to the second quantity, it means that all sub-components of the component are filled to the first position and The second position means that a subcomponent corresponds to a first position or a second position. If the first quantity is greater than the second quantity, it means that filling one subcomponent in one position cannot fill all the subcomponents to the first position and the second position, so the component can be reduced and the reduced The component is filled to the position formed by the first position and the second position, so that all sub-components in the component can be displayed, avoiding the failure to successfully add the component due to the shape and size of the component not matching the first position. situation and improve user experience.
在一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图10所示,第二数量为2,则桌面上有一个第一位置91和一个第二位置92。由于2大于1,则将组件31中的三个子组件缩小处理,得到缩小后的三个子组件93,将缩小后的三个子组件93填充至第一位置和第二位置组合形成的第一目标位置。In a specific example, as shown in FIG. 4 , the first number of sub-components of the component 31 is three. As shown in Figure 10, if the second number is 2, then there is a first position 91 and a second position 92 on the desktop. Since 2 is greater than 1, the three sub-components in the component 31 are reduced to obtain the three reduced sub-components 93, and the three reduced sub-components 93 are filled to the first target position formed by the combination of the first position and the second position. .
第二项:在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件保存在第一文件夹中,并将所述第一文件夹缩小处理后填充至所述第一目标位置。The second item: when the first quantity is greater than the second quantity, save the sub-components in the component in the first folder, shrink the first folder and fill it into the Describe the first target position.
具体的,如果第一数量大于第二数量,则表示按照一个位置填充一个子组件的方式无法将所有的子组件全部填充至第一位置和第二位置,因此可以建立一个第一文件夹,将组件的全部子组件保存在第一文件夹中,再加第一文件夹缩小处理,并将缩小后的第一文件夹填充至第一位置和第二位置组成形成的位置处,由此可以将组件中的所有子组件全部显示出来,避免了由于组件的形状和大小与第一位置不匹配导致无法成功添加组件的情况,提高用户体验。Specifically, if the first quantity is greater than the second quantity, it means that filling one sub-component in one position cannot fill all the sub-components into the first position and the second position, so a first folder can be created to All subcomponents of the component are saved in the first folder, and the first folder is reduced, and the reduced first folder is filled to the position formed by the first position and the second position, so that the first folder can be All sub-components in the component are all displayed, which avoids the failure to successfully add the component due to the mismatch of the shape and size of the component with the first position, and improves the user experience.
在一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图11所示,第二数量为2,则桌面上有一个第一位置91和一个第二位置92。由于2大于1,则将组件31中的三个子组件保存在第一文件夹中,并将第一文件夹缩小处理,得到缩小后的第一文件夹94,将缩小后的第一文件夹94填充至第一位置和第二位置组合形成的第一目标位置。In a specific example, as shown in FIG. 4 , the first number of sub-components of the component 31 is three. As shown in Figure 11, if the second number is 2, then there is a first position 91 and a second position 92 on the desktop. Since 2 is greater than 1, the three sub-components in component 31 are saved in the first folder, and the first folder is reduced to obtain the reduced first folder 94. The reduced first folder 94 is Fill to the first target position formed by the combination of the first position and the second position.
第三项:在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在第四位置的图标进行缩小处理后填充至第二目标位置;其中,所述第四位置与所述第一位置或者所述第二位置相邻,所述第二目标位置为所述第一位置、所述第二位置以及所述第四位置组合形成的位置。The third item: when the first quantity is greater than the second quantity, the sub-components in the component and the icons filled in the fourth position are reduced and then filled to the second target position; wherein, the The fourth position is adjacent to the first position or the second position, and the second target position is a position formed by a combination of the first position, the second position and the fourth position.
在一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图12所示,第二数量为2,则桌面上有一个第一位置91和一个第二位置92。由于2大于1,则将组件31中的三个子组件以及填充在与第一位置91左边相邻的第四位置上的图标进行缩小处理,得到缩小后的三个子组件93以及缩小后的图标95,并将缩小后的三个子组件93以及缩小后的图标95填充至第一位置、第二位置以及第四位置组合形成的第二目标位置。In a specific example, as shown in FIG. 4 , the first number of sub-components of the component 31 is three. As shown in Figure 12, if the second number is 2, then there is a first position 91 and a second position 92 on the desktop. Since 2 is greater than 1, the three sub-components in the component 31 and the icon filled in the fourth position adjacent to the left of the first position 91 are reduced, and the three reduced sub-components 93 and the reduced icon 95 are obtained. , and fill the three reduced sub-components 93 and the reduced icon 95 to the second target position formed by the combination of the first position, the second position and the fourth position.
第四项:在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在所述第四位置的图标保存在第二文件夹中,并将所述第二文件夹进行缩小处理后填充至所述第二目标位置。Item 4: In the case where the first quantity is greater than the second quantity, save the sub-components in the component and the icons filled in the fourth position in the second folder, and save the The second folder is reduced and then filled to the second target location.
在一具体示例中,如图4所示,组件31的子组件的第一数量为3。如图13所示,第二数量为2,则桌面上有一个第一位置91和一个第二位置92。由于2大于1,创建第二文件夹,并将组件31中的三个子组件以及填充在与第一位置91左边相邻的第四位置上的图标保存在第二文件夹中,并将第二文件夹进行缩小处理,得到缩小后的第二文件夹96,并将缩小后的第二文件夹96填充至第一位置、第二位置以及第四位置组合形成的第二目标位置。In a specific example, as shown in FIG. 4 , the first number of sub-components of the component 31 is three. As shown in Figure 13, if the second number is 2, then there is a first position 91 and a second position 92 on the desktop. Since 2 is greater than 1, a second folder is created, and the three subcomponents in component 31 and the icon filled in the fourth position adjacent to the left of the first position 91 are saved in the second folder, and the second The folder is reduced to obtain a reduced second folder 96, and the reduced second folder 96 is filled into the second target position formed by a combination of the first position, the second position and the fourth position.
另外,对于上述四项,如果用户需要放大观看组件中的子组件,则可以通过对缩小处理的子组件、图标、第一文件夹或者第二文件夹进行放大操作,由此可以放大对应的子组件、图标、第一文件夹或者第二文件夹。In addition, for the above four items, if the user needs to zoom in to view a sub-component in the component, he or she can enlarge the corresponding sub-component by zooming in on the reduced sub-component, icon, first folder or second folder. Component, icon, first folder or second folder.
在一具体示例中,如图13所示,如果接收到用户对缩小后的第二文件夹96的放大操作,则响应放大操作,将缩小后的第二文件夹96进行放大,得到放大后的第二文件夹97,如图14所示,放大后的第二文件夹97中的内容也被放大,以便于用于观看第二文件夹中的内容。In a specific example, as shown in Figure 13, if a user's enlargement operation on the reduced second folder 96 is received, the reduced second folder 96 is enlarged in response to the enlargement operation, and the enlarged second folder 96 is obtained. Second folder 97, as shown in Figure 14, the enlarged content in the second folder 97 is also enlarged to facilitate viewing of the content in the second folder.
如图15所示,下面通过一具体实施例对上述实施例二的方案进行说明:As shown in Figure 15, the solution of the above-mentioned Embodiment 2 is explained below through a specific embodiment:
步骤1501:长按桌面,进入组件库。Step 1501: Long press the desktop to enter the component library.
步骤1502:确定组件库中的组件以及第一位置。Step 1502: Determine the component and first position in the component library.
步骤1503:获取第二位置和第一位置的第二数量以及组件中的子组件的第一数量。Step 1503: Obtain the second position and the second number of the first position and the first number of sub-components in the component.
步骤1504:判断第一数量是否大于第二数量;若为否,则进入步骤1505;若为是,则进入步骤1506。Step 1504: Determine whether the first quantity is greater than the second quantity; if not, proceed to step 1505; if yes, proceed to step 1506.
步骤1505:将所述组件中的子组件全部填充至第一位置和第二位置。Step 1505: Fill all sub-components in the component to the first position and the second position.
步骤1506:将组件中的子组件缩小处理后填充至第一位置和第二位置组合形成的第一目标位置。Step 1506: Reduce the sub-component in the component and fill it to the first target position formed by the combination of the first position and the second position.
综上所述,本申请上述实施例,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则需要确定包括第一位置在内的、连续空闲的位置的第二数量,以便得知能够填充多少个子组件。并且,通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充多少个子组件,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与待填充的位置不匹配,也能自适应的将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。To sum up, in the above embodiments of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, it is necessary to determine the consecutive free positions including the first position. The second quantity to know how many subcomponents can be filled. Furthermore, based on the number of free positions and the number of sub-components, it is determined whether the free positions can fill all the sub-components and how many sub-components can be filled, thereby filling at least a part of the sub-components in the assembly according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the position to be filled, at least some sub-components of the component can be adaptively added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
本申请实施例提供的桌面组件的处理方法,执行主体可以为桌面组件的处理装置。本申请实施例中以桌面组件的处理装置执行桌面组件的处理方法为例,说明本申请实施例提供的桌面组件的处理装置。For the desktop component processing method provided by the embodiment of the present application, the execution subject may be a desktop component processing device. In the embodiment of the present application, the desktop component processing device executed by the desktop component processing method is taken as an example to illustrate the desktop component processing device provided by the embodiment of the present application.
如图16所示,本申请实施例还提供了一种桌面组件的处理装置1600,包括:As shown in Figure 16, this embodiment of the present application also provides a desktop component processing device 1600, which includes:
第一确定模块1601,用于确定桌面上的第一位置;The first determination module 1601 is used to determine the first position on the desktop;
第二确定模块1602,用于在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置;The second determination module 1602 is configured to determine the first position and the second number of second positions on the desktop when the first number of sub-components in the component is greater than 1, and the second position represents the same as the An idle position adjacent to the first position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions;
第一填充模块1603,用于根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。The first filling module 1603 is configured to fill at least some sub-assemblies in the assembly to the first position and the second position according to the first quantity and the second quantity.
在本申请上述实施例中,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则确定桌面上第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置,即需要确定包括第一位置在内的、连续的空闲位置的数量,以便得知能够填充多少个子组件。并且,根据第一数量以及第二数量,将组件中的至少部分子组件填充至第一位置以及第二位置,即通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充的子组件数量,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与空闲位置不匹配,也能将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。In the above embodiment of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, then determine the second number of the first position and the second position on the desktop, and the The second position represents an idle position adjacent to the first position, or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions, that is, it needs to be determined to include the first position. The number of consecutive free slots within a slot so you know how many subcomponents can be filled. Furthermore, according to the first quantity and the second quantity, at least some of the sub-components in the component are filled into the first position and the second position, that is, based on the number of free positions and the number of sub-components, it is judged whether the free positions can fill all the sub-components. The component and the number of sub-components that can be filled, thereby filling at least a portion of the sub-components in the component according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the free location, at least some of the sub-components in the component can be added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
可选的,所述第一填充模块1603,具体用于:Optionally, the first filling module 1603 is specifically used for:
在所述第一数量大于所述第二数量的情况下,将所述组件中的第一子组件填充至所述第一位置以及所述第二位置;If the first quantity is greater than the second quantity, filling the first sub-assembly of the assembly to the first position and the second position;
将所述组件中的第二子组件进行隐藏处理;hide the second sub-component in the component;
其中,所述第一子组件的数量为所述第二数量,所述第一子组件用于表征所述组件中的第一优先级的子组件,所述第二子组件表征所述组件中的第二优先级的子组件,所述第一优先级高于所述第二优先级。Wherein, the number of the first sub-components is the second number, the first sub-components are used to represent the first priority sub-components in the components, and the second sub-components represent the sub-components in the components. A sub-component of a second priority, the first priority being higher than the second priority.
可选的,所述装置还包括:Optionally, the device also includes:
检测模块,用于每间隔第一时长,检测所述第一位置以及所述第二位置相邻的第三位置是否为空闲位置;A detection module, configured to detect whether the first position and the third position adjacent to the second position are free positions every first interval;
第二填充模块,用于在所述第三位置为空闲位置的情况下,根据所述第三位置的第三数量以及所述第二子组件的第四数量,将所述第二子组件中的至少部分填充至所述第三位置。A second filling module, configured to fill the second subassembly according to the third number of the third position and the fourth number of the second subassembly when the third position is an idle position. is at least partially filled to the third position.
可选的,所述装置还包括:Optionally, the device also includes:
显示模块,用于在满足以下至少一者的情况下,将隐藏处理的所述第二子组件进行显示;A display module, configured to display the second sub-component of the hidden process when at least one of the following conditions is met;
接收到对所述第二子组件的第一输入;receiving a first input to the second subcomponent;
检测到所述第二子组件的数据更新。A data update for the second sub-component is detected.
可选的,所述隐藏处理包括以下任意一项:Optionally, the hiding process includes any of the following:
隐藏在所述第一位置上的第一子组件的下方;hidden beneath the first subassembly at the first position;
隐藏在所述第二位置上的第一子组件的下方;hidden beneath the first subassembly in said second position;
隐藏在与所述第一位置的相邻位置上的图标的下方;Hidden below the icon at a position adjacent to the first position;
隐藏在与所述第二位置的相邻位置上的图标的下方。Hidden below the icon in a position adjacent to the second position.
可选的,所述第一填充模块1603,还用于以下任意一项:Optionally, the first filling module 1603 is also used for any of the following:
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件缩小处理后填充至第一目标位置,所述第一目标位置为所述第一位置和所述第二位置组合形成的位置;When the first quantity is greater than the second quantity, the sub-components in the component are reduced and filled to a first target position, where the first target position is the first position and the third The position formed by the combination of two positions;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件保存在第一文件夹中,并将所述第一文件夹缩小处理后填充至所述第一目标位置;If the first number is greater than the second number, the sub-components in the component are saved in a first folder, and the first folder is reduced and filled to the first target. Location;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在第四位置的图标进行缩小处理后填充至第二目标位置;其中,所述第四位置与所述第一位置或者所述第二位置相邻,所述第二目标位置为所述第一位置、所述第二位置以及所述第四位置组合形成的位置;When the first quantity is greater than the second quantity, the sub-components in the component and the icons filled in the fourth position are reduced and then filled to the second target position; wherein, the fourth position Adjacent to the first position or the second position, the second target position is a position formed by a combination of the first position, the second position and the fourth position;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在所述第四位置的图标保存在第二文件夹中,并将所述第二文件夹进行缩小处理后填充至所述第二目标位置。In the case where the first quantity is greater than the second quantity, the sub-components in the component and the icons filled in the fourth position are saved in a second folder, and the second folder After performing reduction processing, fill to the second target position.
可选的,所述第二确定模块1602,具体用于:Optionally, the second determination module 1602 is specifically used for:
在所述组件中的子组件的第一数量大于1的情况下,检测桌面上的第一区域中是否有所述第二位置;In the case where the first number of sub-components in the component is greater than 1, detect whether there is the second position in the first area on the desktop;
在所述第一区域有所述第二位置的情况下,获取所述第二位置的数量;If the first area has the second position, obtain the number of the second position;
将所述第二位置的数量和所述第一位置的数量之和确定为所述第二数量;Determine the sum of the number of the second positions and the number of the first positions as the second number;
其中,所述第一区域表征桌面上以所述第一位置为中心、以第一数值为半径所形成的区域,所述第一数值为所述组件的长度方向的子组件数量和宽度方向的子组件数量中最大值的数值。Wherein, the first area represents an area on the desktop formed with the first position as the center and a first numerical value as the radius. The first numerical value is the number of sub-components in the length direction and the width direction of the component. The numerical value of the maximum number of subcomponents.
综上所述,本申请上述实施例,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则需要确定包括第一位置在内的、连续空闲的位置的第二数量,以便得知能够填充多少个子组件。并且,通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充多少个子组件,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与待填充的位置不匹配,也能自适应的将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。To sum up, in the above embodiments of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, it is necessary to determine the consecutive free positions including the first position. The second quantity to know how many subcomponents can be filled. Furthermore, based on the number of free positions and the number of sub-components, it is determined whether the free positions can fill all the sub-components and how many sub-components can be filled, thereby filling at least a part of the sub-components in the assembly according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the position to be filled, at least some sub-components of the component can be adaptively added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
本申请实施例中的桌面组件的处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The processing device of the desktop component in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR). ) equipment, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA), etc., and can also be servers, network attached storage (Network Attached Storage, NAS), etc. ), personal computer (PC), television (TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的桌面组件的处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The processing device of the desktop component in the embodiment of the present application may be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的桌面组件的处理装置能够实现图1至图15的方法实施例实现的各个过程,为避免重复,这里不再赘述。The desktop component processing device provided by the embodiment of the present application can implement various processes implemented by the method embodiments of Figures 1 to 15. To avoid duplication, they will not be described again here.
可选地,如图17所示,本申请实施例还提供一种电子设备1700,包括处理器1701和存储器1702,存储器1702上存储有可在所述处理器1701上运行的程序或指令,该程序或指令被处理器1701执行时实现上述桌面组件的处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 17, this embodiment of the present application also provides an electronic device 1700, including a processor 1701 and a memory 1702. The memory 1702 stores programs or instructions that can be run on the processor 1701. When the program or instruction is executed by the processor 1701, each step of the above desktop component processing method embodiment is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图18为实现本申请实施例的一种电子设备的硬件结构示意图。Figure 18 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。The electronic device 1000 includes but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, processor 1010, etc. part.
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图18中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1000 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 18 does not constitute a limitation of the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
其中,所述处理器1010,用于确定桌面上的第一位置;Wherein, the processor 1010 is used to determine the first position on the desktop;
在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置;In the case where the first number of sub-components in the component is greater than 1, determining the first position and the second number of second positions on the desktop, the second position representing an idle position adjacent to the first position , or an idle position that is not adjacent to the first position and the positions between the first position and the first position are all idle positions;
根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置。According to the first quantity and the second quantity, at least part of the sub-assemblies of the assembly are filled to the first position and the second position.
在本申请上述实施例中,在确定桌面上的第一位置之后,如果组件中的子组件的第一数量大于1,则确定桌面上第一位置以及第二位置的第二数量,所述第二位置表征与所述第一位置相邻的空闲位置,或者所述第二位置表征与所述第一位置相邻的空闲位置,以及与所述第一位置不相邻且与所述第一位置之间的位置均为空闲位置的空闲位置,即需要确定包括第一位置在内的、连续的空闲位置的数量,以便得知能够填充多少个子组件。并且,根据第一数量以及第二数量,将组件中的至少部分子组件填充至第一位置以及第二位置,即通过空闲位置的数量以及子组件的数量,判断空闲位置是否能够填充所有的子组件以及能够填充的子组件数量,由此根据空闲位置的数量填充组件中的至少一部分子组件。通过上述方案,即使组件的形状和大小与空闲位置不匹配,也能将组件中的至少一部分子组件添加在桌面上,避免了无法成功添加组件的情况,提高用户体验。In the above embodiment of the present application, after determining the first position on the desktop, if the first number of sub-components in the component is greater than 1, then determine the second number of the first position and the second position on the desktop, and the The second position represents an idle position adjacent to the first position, or the second position represents an idle position adjacent to the first position, and is not adjacent to the first position and is not adjacent to the first position. The positions between the positions are all free positions of the free positions, that is, the number of consecutive free positions including the first position needs to be determined in order to know how many sub-components can be filled. Furthermore, according to the first quantity and the second quantity, at least some of the sub-components in the component are filled into the first position and the second position, that is, based on the number of free positions and the number of sub-components, it is judged whether the free positions can fill all the sub-components. The component and the number of sub-components that can be filled, thereby filling at least a portion of the sub-components in the component according to the number of free positions. Through the above solution, even if the shape and size of the component do not match the free location, at least some of the sub-components in the component can be added to the desktop, avoiding the situation where the component cannot be added successfully and improving the user experience.
可选的,所述处理器1010在根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置时,具体用于:Optionally, the processor 1010 specifically uses At:
在所述第一数量大于所述第二数量的情况下,将所述组件中的第一子组件填充至所述第一位置以及所述第二位置;If the first quantity is greater than the second quantity, filling the first sub-assembly of the assembly to the first position and the second position;
将所述组件中的第二子组件进行隐藏处理;hide the second sub-component in the component;
其中,所述第一子组件的数量为所述第二数量,所述第一子组件用于表征所述组件中的第一优先级的子组件,所述第二子组件表征所述组件中的第二优先级的子组件,所述第一优先级高于所述第二优先级。Wherein, the number of the first sub-components is the second number, the first sub-components are used to represent the first priority sub-components in the components, and the second sub-components represent the sub-components in the components. A sub-component of a second priority, the first priority being higher than the second priority.
可选的,所述处理器1010在将所述组件中的第二子组件进行隐藏处理之后,还用于:Optionally, after hiding the second sub-component in the component, the processor 1010 is also configured to:
每间隔第一时长,检测所述第一位置以及所述第二位置相邻的第三位置是否为空闲位置;Every first time interval, detect whether the first position and the third position adjacent to the second position are free positions;
在所述第三位置为空闲位置的情况下,根据所述第三位置的第三数量以及所述第二子组件的第四数量,将所述第二子组件中的至少部分填充至所述第三位置。When the third position is an idle position, at least part of the second sub-assembly is filled into the second sub-assembly according to a third number of the third position and a fourth number of the second sub-assembly. third position.
可选的,所述处理器1010在将所述组件中的第二子组件进行隐藏处理之后,还用于:Optionally, after hiding the second sub-component in the component, the processor 1010 is also configured to:
在满足以下至少一者的情况下,将隐藏处理的所述第二子组件进行显示;When at least one of the following is satisfied, the second sub-component of the hidden process is displayed;
接收到对所述第二子组件的第一输入;receiving a first input to the second subcomponent;
检测到所述第二子组件的数据更新。A data update for the second sub-component is detected.
可选的,所述隐藏处理包括以下至少一项:Optionally, the hiding process includes at least one of the following:
隐藏在所述第一位置上的第一子组件的下方;hidden beneath the first subassembly at the first position;
隐藏在所述第二位置上的第一子组件的下方;hidden beneath the first subassembly in said second position;
隐藏在与所述第一位置的相邻位置上的图标的下方;Hidden below the icon at a position adjacent to the first position;
隐藏在与所述第二位置的相邻位置上的图标的下方。Hidden below the icon in a position adjacent to the second position.
可选的,所述处理器1010在根据所述第一数量以及所述第二数量,将所述组件中的至少部分子组件填充至所述第一位置以及所述第二位置时,具体用于以下任意一项:Optionally, the processor 1010 specifically uses in any of the following:
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件缩小处理后填充至第一目标位置,所述第一目标位置为所述第一位置和所述第二位置组合形成的位置;When the first quantity is greater than the second quantity, the sub-components in the component are reduced and filled to a first target position, where the first target position is the first position and the third The position formed by the combination of two positions;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件保存在第一文件夹中,并将所述第一文件夹缩小处理后填充至所述第一目标位置;If the first number is greater than the second number, the sub-components in the component are saved in a first folder, and the first folder is reduced and filled to the first target. Location;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在第四位置的图标进行缩小处理后填充至第二目标位置;其中,所述第四位置与所述第一位置或者所述第二位置相邻,所述第二目标位置为所述第一位置、所述第二位置以及所述第四位置组合形成的位置;When the first quantity is greater than the second quantity, the sub-components in the component and the icons filled in the fourth position are reduced and then filled to the second target position; wherein, the fourth position Adjacent to the first position or the second position, the second target position is a position formed by a combination of the first position, the second position and the fourth position;
在所述第一数量大于所述第二数量的情况下,将所述组件中的子组件以及填充在所述第四位置的图标保存在第二文件夹中,并将所述第二文件夹进行缩小处理后填充至所述第二目标位置。In the case where the first quantity is greater than the second quantity, the sub-components in the component and the icons filled in the fourth position are saved in a second folder, and the second folder After performing reduction processing, fill to the second target position.
可选的,所述处理器1010在组件中的子组件的第一数量大于1的情况下,确定桌面上所述第一位置以及第二位置的第二数量时,具体用于:Optionally, when the first number of sub-components in the component is greater than 1, the processor 1010 determines the second number of the first position and the second position on the desktop, specifically for:
在所述组件中的子组件的第一数量大于1的情况下,检测桌面上的第一区域中是否有所述第二位置;In the case where the first number of sub-components in the component is greater than 1, detect whether there is the second position in the first area on the desktop;
在所述第一区域有所述第二位置的情况下,获取所述第二位置的数量;If the first area has the second position, obtain the number of the second position;
将所述第二位置的数量和所述第一位置的数量之和确定为所述第二数量;Determine the sum of the number of the second positions and the number of the first positions as the second number;
其中,所述第一区域表征桌面上以所述第一位置为中心、以第一数值为半径所形成的区域,所述第一数值为所述组件的长度方向的子组件数量和宽度方向的子组件数量中最大值的数值。Wherein, the first area represents an area on the desktop formed with the first position as the center and a first numerical value as the radius. The first numerical value is the number of sub-components in the length direction and the width direction of the component. The numerical value of the maximum number of subcomponents.
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(GraphicsProcessing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042. The graphics processor 10041 is used for recording data generated by an image capture device (such as Process the image data of still pictures or videos obtained by the camera). The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 . Touch panel 10071, also known as touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器1009可用于存储软件程序以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器,或者,存储器1009可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。Memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc. Additionally, memory 1009 may include volatile memory or nonvolatile memory, or memory 1009 may include both volatile and nonvolatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 1009 in the embodiment of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器1010可包括一个或多个处理单元;可选的,处理器1010集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1010.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述桌面组件的处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above desktop component processing method embodiment is implemented, and can To achieve the same technical effect, to avoid repetition, we will not repeat them here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述桌面组件的处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the processing method of the above desktop component. Each process in the example can achieve the same technical effect. To avoid repetition, we will not repeat it here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述桌面组件的处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above desktop component processing method embodiment, and can achieve the same To avoid repetition, the technical effects will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311555434.3A CN117555639A (en) | 2023-11-20 | 2023-11-20 | Desktop assembly processing method, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311555434.3A CN117555639A (en) | 2023-11-20 | 2023-11-20 | Desktop assembly processing method, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117555639A true CN117555639A (en) | 2024-02-13 |
Family
ID=89822889
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311555434.3A Pending CN117555639A (en) | 2023-11-20 | 2023-11-20 | Desktop assembly processing method, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117555639A (en) |
-
2023
- 2023-11-20 CN CN202311555434.3A patent/CN117555639A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112988006A (en) | Display method, display device, electronic equipment and storage medium | |
CN113268182B (en) | Application icon management method and electronic device | |
CN113849092A (en) | Content sharing method and device and electronic equipment | |
CN115373555A (en) | Folder icon display method, device, electronic device and medium | |
CN113805996A (en) | Information display method and device | |
WO2023198064A1 (en) | Application program starting method and apparatus, and electronic device and storage medium | |
CN112765500A (en) | Information searching method and device | |
CN115729412A (en) | Interface display method and device | |
CN114089885A (en) | Application icon management method, device, electronic device and readable storage medium | |
CN113190159A (en) | Background application management method and device | |
CN109492249B (en) | Rapid generation method and device of design drawing and terminal equipment | |
CN117170792A (en) | Control display method and device, electronic equipment and readable storage medium | |
CN117311885A (en) | Picture viewing method and device | |
CN116756099A (en) | Display method and device | |
CN116893770A (en) | Screenshot method, device, electronic device and readable storage medium | |
CN117111811A (en) | Screenshot method and device, electronic equipment and readable storage medium | |
WO2022247787A1 (en) | Application classification method and apparatus, and electronic device | |
CN117270719A (en) | Interface display method, device, electronic equipment and readable storage medium | |
WO2023155874A1 (en) | Application icon management method and apparatus, and electronic device | |
WO2022143337A1 (en) | Display control method and apparatus, and electronic device and storage medium | |
CN116245615A (en) | Searching method and device and electronic equipment | |
CN117555639A (en) | Desktop assembly processing method, device and electronic equipment | |
CN114090896A (en) | Information display method and device and electronic equipment | |
CN113253904A (en) | Display method, display device and electronic equipment | |
CN117215444A (en) | Page display method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |