Desktop object processing method and device, equipment storage medium and program product
By responding to user trigger instructions, adjusting the shape of the desktop object and determining the target shape, the problem of incoherence of animations in traditional technology is solved, and a more natural and smooth visual experience is achieved.
Patent Information
- Application Number
- CN202411748848.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-11
AI Technical Summary
In traditional technology, the size change animation will be triggered when the distance between the user's mobile desktop object meets a certain threshold, but due to the inconsistency of the animation, it is more abrupt to visually present the user with an animation change.
By responding to user trigger instructions, adjust the shape of the desktop object, ensure that the shape adjustment animation is performed only after specific conditions are met, avoid animation flashing, and determine the target shape according to the user's further operations during the shape adjustment process, ensuring the consistency of the animation.
It realizes natural visual smoothness of desktop object changes, avoids the abruptness of animation, and provides users with a more coherent and silky operating experience.
Smart Images

Figure CN119597389A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a desktop object processing method, device, electronic device, computer-readable storage medium and computer program product. Background Art
[0002] With the popularization of electronic devices, more and more users are using electronic devices. There are many objects on the desktop of the electronic device, and the user can manage the objects by operations such as clicking and dragging.
[0003] In traditional technology, when the distance a user moves a desktop object meets a certain threshold, a size change animation will be triggered. When the user continues to move the desktop object, a new animation will be executed immediately, which makes the animation change visually abrupt to the user. Summary of the invention
[0004] The embodiments of the present application provide a desktop object processing method, device, electronic device, and computer-readable storage medium, which can make the adjustment and change of desktop objects appear natural and smooth to the user without appearing abrupt.
[0005] In a first aspect, the present application provides a desktop object processing method, the method comprising:
[0006] In response to a first trigger instruction on a desktop object satisfying a target trigger condition, adjusting the shape of the desktop object;
[0007] During the shape adjustment, in response to a second trigger instruction to the desktop object, determining a target shape of the desktop object;
[0008] After the shape adjustment of the desktop object satisfies the first target adjustment condition, the shape of the desktop object is adjusted according to the target shape.
[0009] In a second aspect, the present application further provides a desktop object processing device, the device comprising:
[0010] an adjustment module, configured to adjust the shape of the desktop object in response to a first trigger instruction on the desktop object satisfying a target trigger condition;
[0011] a determination module, configured to determine a target shape of the desktop object in response to a second trigger instruction to the desktop object during shape adjustment;
[0012] The adjustment module is further configured to adjust the shape of the desktop object according to the target shape after the shape adjustment of the desktop object satisfies a first target adjustment condition.
[0013] In a third aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method steps in the first aspect when executing the computer program.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method steps in the first aspect when executed by a processor.
[0015] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps in the method of the first aspect when executed by a processor.
[0016] The above-mentioned desktop object processing method, device, electronic device, computer storage medium and computer program product, in response to the first trigger instruction of the desktop object satisfying the target trigger condition, executes the shape adjustment animation of the desktop object, and only adjusts the shape of the desktop object when a certain trigger condition is met, thereby avoiding the situation where the animation is repeatedly triggered and flashes. Then, during the shape adjustment process, in response to the second trigger instruction of the desktop object, the target shape of the desktop object can be determined according to the second trigger instruction. After the shape adjustment of the desktop object satisfies the first target adjustment condition, the shape of the desktop object is adjusted according to the target shape. When a new trigger operation is received during the execution of the shape adjustment animation, the shape of the desktop object is adjusted according to the target shape only after the shape adjustment animation is executed to satisfy the first target adjustment condition. The previous shape adjustment animation will not be interrupted, thereby ensuring that the adjustment change animation is continuous, smooth and not abrupt, giving the user a more natural and smooth visual experience without appearing abrupt. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 is a flowchart of a desktop object processing method in one embodiment;
[0019] Figure 2 A schematic diagram of dividing the trigger directions corresponding to the first trigger instruction in an embodiment;
[0020] Figure 3 A schematic diagram of determining a target shape of the desktop object in response to a second trigger instruction to the desktop object in one embodiment;
[0021] Figure 4 A schematic diagram of dividing a folder into 2*2 adjustment areas and determining a target shape in an embodiment;
[0022] Figure 5 A schematic diagram of dividing a folder 1*1 into adjustment areas and determining a target shape in an embodiment;
[0023] Figure 6 A schematic diagram of dividing a folder 1*2 into adjustment areas and determining a target shape in an embodiment;
[0024] Figure 7 A schematic diagram of dividing a folder 2*1 into adjustment areas and determining a target shape in an embodiment;
[0025] Fig. 8A A schematic diagram of a process of dragging and deforming a folder in an embodiment;
[0026] Figure 8B A schematic diagram of a process of dragging and deforming a folder in another embodiment;
[0027] Fig. 9 A schematic diagram of the interface change when a folder is dragged and deformed in an embodiment;
[0028] Fig.10 is a schematic diagram of the structure of a desktop object processing device in one embodiment;
[0029] Fig.11 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] In some exemplary embodiments, Figure 1 As shown, a desktop object processing method is provided, and the method is applied to an electronic device as an example for explanation, wherein the electronic device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The desktop object processing method includes the following steps 102 to 106. Among them:
[0032] Step 102: In response to a first trigger instruction on a desktop object satisfying a target trigger condition, the desktop object is adjusted in shape.
[0033] Desktop objects can be elements on the desktop of an electronic device. Desktop objects can be elements such as folders, application icons, or desktop cards. Desktop cards are components that display information on electronic devices.
[0034] The first trigger instruction may be an instruction generated by a gesture operation or an instruction generated by a drag operation, etc. The first trigger instruction may be an instruction generated by a trigger operation in any direction, for example, it may be horizontal, vertical, oblique, curved, diagonal, circular, etc., but not limited thereto. The target trigger condition may be configured as needed, for example, it may be based on one or more associated trigger conditions such as the distance generated by the trigger operation, the throwing speed of the trigger operation, etc. Shape adjustment may be the size adjustment of the desktop object. The size may be the grid size occupied by the desktop object on the display area, etc.
[0035] Optionally, the screen of the electronic device may include multiple areas. The multiple areas may include a first status bar, a second status bar, and a main display area located between the first status bar and the second status bar. The first status bar can be used to display information such as communication signal marks, power, time, etc., and the second status bar can be used to display some commonly used icons, such as phone icons, browsers, cameras, etc. The main display area is used to display desktop objects. The main display area can be used to display multi-page containers, and each page container can be used to accommodate different desktop objects. The main display area can be divided into multiple grids, and each grid has the same width and length. Each desktop object can occupy one or more grids according to its own size.
[0036] Optionally, the screen of the electronic device can also be divided into a plurality of grids, each grid having the same width and length. Each desktop object can occupy one or more grids according to its own size.
[0037] It is understandable that the main display area or screen of the electronic device is divided into a plurality of grids, and the width and length of the grids may be different.
[0038] Optionally, a drag handle is configured at at least one of the four corners of the desktop object, and the shape of the desktop object changes by dragging the handle. If the target trigger condition is met, the shape of the desktop object is adjusted.
[0039] Optionally, in response to the first trigger instruction for the desktop object, the electronic device detects that the first trigger instruction meets the target trigger condition, and then adjusts the shape of the desktop object. The shape adjustment may be executing a shape adjustment animation.
[0040] Step 104 : during the shape adjustment, in response to a second trigger instruction to the desktop object, determining a target shape of the desktop object.
[0041] The second trigger instruction may be an instruction generated by a gesture operation or an instruction generated by a drag operation, etc. The second trigger instruction may be an instruction generated by a trigger operation in any direction, for example, horizontal, vertical, oblique, curved, circular, etc., but not limited thereto.
[0042] Optionally, the second trigger instruction may be an instruction generated by a subsequent touch operation in which no lift event is detected after the first trigger instruction. For example, after the user drags the desktop object with his finger to move it to meet the target trigger condition, he adjusts the shape of the desktop object and then lifts his finger without leaving the screen. During the shape adjustment, the electronic device detects that the user touches the desktop object with his finger again to move it.
[0043] Optionally, the second trigger instruction may be an instruction generated by a touch operation that occurs again after a lift event is detected after the first trigger instruction ends. For example, after a user drags a desktop object with a finger to meet the target trigger condition, the desktop object is adjusted in shape, and the finger leaves the screen. During the shape adjustment, the electronic device detects that the finger continues to move the desktop object.
[0044] The shape of the desktop object can be 1*1, 1*2, 2*2, 2*1, 3*1, 1*3, 3*2, 2*3, 3*3, etc. The smallest unit of the size can be 1 grid or other coordinate unit forms, but is not limited thereto.
[0045] Optionally, when performing shape adjustment animation on the desktop object, the electronic device responds to a second trigger instruction on the desktop object and can determine a target shape of the desktop object according to the second trigger instruction.
[0046] Step 106: After the shape adjustment of the desktop object satisfies the first target adjustment condition, the shape of the desktop object is adjusted according to the target shape.
[0047] Among them, the first target adjustment condition can be configured according to needs. For example, the first target adjustment condition can be to adjust the shape to reach the target time, or adjust the distance to reach the target distance, or adjust the end condition according to the requirements of the resistance algorithm model itself.
[0048] Optionally, after the electronic device adjusts the shape of the desktop object to meet the first target adjustment condition, the electronic device adjusts the shape of the desktop object according to the target shape.
[0049] In this embodiment, in response to the first trigger instruction of the desktop object satisfying the target trigger condition, a shape adjustment animation of the desktop object is executed. The shape of the desktop object is adjusted only when certain trigger conditions are met, thereby avoiding the situation where the animation is repeatedly triggered and flashes. Then, during the shape adjustment process, in response to the second trigger instruction of the desktop object, the target shape of the desktop object can be determined according to the second trigger instruction. After the shape adjustment of the desktop object satisfies the first target adjustment condition, the shape of the desktop object is adjusted according to the target shape. During the execution of the shape adjustment animation, a new trigger operation is received, and the shape of the desktop object is adjusted according to the target shape only after the shape adjustment animation is executed to satisfy the first target adjustment condition. The previous shape adjustment animation will not be interrupted, thereby ensuring that the adjustment change animation is smooth and unobtrusive.
[0050] In some exemplary embodiments, the method further includes: in the process of adjusting the shape of the desktop object according to the target shape, in response to a third trigger instruction to the desktop object, determining a new target shape of the desktop object; after the shape adjustment of the desktop object according to the target shape satisfies a second target adjustment condition, adjusting the shape of the desktop object according to the new target shape.
[0051] The third trigger instruction may be an instruction generated by a gesture operation or an instruction generated by a drag operation, etc. The third trigger instruction may be an instruction generated by a trigger operation in any direction, for example, horizontal, vertical, oblique, curved, circular, etc., but not limited thereto.
[0052] Optionally, the third trigger instruction may be an instruction generated by a subsequent touch operation in which no lift event is detected after the second trigger instruction. For example, a user drags a desktop object with his finger to determine that the desktop object is adjusted from a 1*1 shape to a 1*2 shape, and the finger does not leave the screen. During the shape adjustment, the electronic device detects that the user touches the desktop object with his finger again to move the object, and obtains a new target shape of 2*2.
[0053] Optionally, the third trigger instruction may be an instruction generated by a touch operation that occurs again after a lift event is detected after the second trigger instruction ends. For example, a user drags a desktop object with a finger to determine that the desktop object is adjusted from a 1*1 shape to a 1*2 shape, and the finger leaves the screen. During the shape adjustment, the electronic device detects that the user touches the desktop object again with a finger to move it, and the new target shape is 2*2.
[0054] The second target adjustment condition can be the same as or different from the first target adjustment condition. The second target adjustment condition can be configured as required. For example, the second target adjustment condition can be that the shape adjustment reaches the second target duration, or the distance is adjusted to reach the second target distance, or the end condition is adjusted according to the requirements of the resistance algorithm model itself. The second target duration can be the same as or different from the first target duration, and the second target distance can be the same as or different from the first target distance.
[0055] In some exemplary embodiments, in response to a first trigger instruction to a desktop object satisfying a target trigger condition, the desktop object is adjusted in shape, including: in response to the first trigger instruction to the desktop object, obtaining a vector distance and a throwing speed corresponding to the first trigger instruction; determining whether the target trigger condition is satisfied based on the vector distance and the throwing speed; and if it is determined that the target trigger condition is satisfied, adjusting the shape of the desktop object.
[0056] The vector distance may refer to the distance between the second touch point indicating the end of the first trigger instruction and the first touch point indicating the start of the first trigger instruction. The vector distance may be calculated using elastic hand mapping. The fling throwing speed may refer to the fling speed at the moment when the gesture operation determines the flinging behavior. The fling speed may be obtained by the gesture detection tool class GestureDetector, which uses the callback interface onFling to obtain whether there is a fling and the fling speed.
[0057] The target trigger condition may be a condition related to the vector distance and the throwing speed.
[0058] The trigger operation is judged through multiple dimensions such as vector distance and throwing speed, which ensures the rigor of the shape adjustment animation triggering method and avoids the situation of repeated triggering of animation flashing.
[0059] In some exemplary embodiments, obtaining the vector distance corresponding to the first trigger instruction includes: obtaining a first direction movement amount and a second direction movement amount corresponding to the first trigger instruction; and determining the vector distance according to the first direction movement amount and the second direction movement amount.
[0060] Optionally, the first direction axis corresponding to the first direction movement amount and the second direction axis corresponding to the second direction movement amount are perpendicular to each other. The first direction movement amount and the second direction movement amount are obtained by adding damping calculation after elastic hand mapping using the finger movement distance. The first direction axis is the X-axis, the second direction axis is the Y-axis, the first direction movement is the X-axis movement, and the second direction movement is the Y-axis movement. For ease of understanding, the upper left corner of the electronic device screen can be used as the coordinate origin, the horizontal right direction is the positive direction of the X-axis, and the vertical downward direction is the positive direction of the Y-axis to establish a rectangular coordinate system. Taking the calculation of the X-axis movement as an example, the electronic device can obtain the down point through the DOWN event, obtain the touch point x through the MOVE event, obtain the displacement distance of the x-down touch event, set x-down to the FinalPosition of SpringAnimation for a numerical mapping, obtain the first value, and then perform a damping operation on the first value. In the internal direction of the desktop object, the first value is multiplied by the coefficient to perform a linear operation, and a curve calculation is performed in the external direction of the desktop object. The calculation formula can be y = (1 -1 / ((curveRatio * x / maxDistance) + 1)) * maxDistance, curveRatio is a ratio parameter used to control the shape of the curve, and maxDistance is the maximum distance value. The calculation of the movement amount in the Y-axis direction can refer to the calculation principle of the movement amount in the X-axis direction.
[0061] The vector distance is obtained by square root operation: float distance = (float) Math.sqrt(mDeltaX* mDeltaX + mDeltaY * mDeltaY), where mDeltaX is the movement amount in the X-axis direction and mDeltaY is the movement amount in the Y-axis direction.
[0062] It can be understood that when establishing a coordinate system on the screen of an electronic device, the corresponding coordinate origin, the positive direction of the X-axis and the positive direction of the Y-axis can be selected as needed. The description in this application is only an exemplary description, and also includes establishing a rectangular coordinate system with other points as the coordinate origin. For example, the coordinate system can be established with the lower left corner of the screen as the coordinate origin, the horizontal right as the positive direction of the X-axis, and the vertical upward as the positive direction of the Y-axis. The coordinate system can also be established with the lower left corner or upper left corner of the main screen area as the coordinate origin, but is not limited to this.
[0063] In some exemplary embodiments, the target trigger condition may include the vector distance reaching a first vector distance threshold, or may include the vector distance reaching a second vector distance threshold and the throwing speed reaching a throwing speed threshold, wherein the first vector distance threshold is greater than the second vector distance threshold.
[0064] Optionally, both the first vector distance threshold and the second vector distance threshold can be determined according to the width of a single grid. The first vector distance threshold and the second vector distance threshold are positively correlated with the width of a single grid. The larger the width of a single grid, the larger the first vector distance threshold and the second vector distance threshold. The first vector distance threshold can be obtained by multiplying the width of a single grid by a first coefficient, and the second vector distance threshold can be obtained by multiplying the width of a single grid by a second coefficient. The first coefficient is greater than the second coefficient. For example, the first coefficient can be 0.66 and the second coefficient can be 0.33, or the first coefficient can be 0.6 and the second coefficient can be 0.35, etc., without limitation thereto.
[0065] The throwing speed threshold can be set as needed. The unit of the throwing speed can be pixels per second. The throwing speed threshold can be 800 pixels per second, 1000 pixels per second, etc.
[0066] Accordingly, determining whether the target trigger condition is met according to the vector distance and the throwing speed may include: determining whether the vector distance reaches a first vector distance threshold, or whether the vector distance reaches a second vector distance threshold and the throwing speed reaches a throwing speed threshold.
[0067] Accordingly, when it is determined that the target trigger condition is met, the shape of the desktop object is adjusted, including: when the vector distance reaches a first vector distance threshold, or the vector distance reaches a second vector distance threshold and the throwing speed reaches a throwing speed threshold, the shape of the desktop object is adjusted.
[0068] It can be understood that if it is determined that the target trigger condition is not met, the shape of the desktop object will not be adjusted. That is, if the vector distance is less than the second vector distance threshold, or the vector distance reaches the second vector distance threshold but the throwing speed is less than the throwing speed threshold, the shape of the desktop object will not be adjusted.
[0069] Through the first vector distance threshold, the second vector distance threshold and the throwing speed threshold, it is possible to simply, accurately and multi-dimensionally determine whether the first trigger instruction meets the target trigger condition, thereby avoiding the situation where the shape adjustment animation is repeatedly triggered and flashes.
[0070] In some exemplary embodiments, the method further includes: acquiring a direction angle corresponding to the first trigger instruction; determining a target movement direction according to the direction angle, and determining a target movement increment according to the target movement direction.
[0071] Correspondingly, when it is determined that the target trigger condition is met, the shape of the desktop object is adjusted, including: when it is determined that the target trigger condition is met, the shape of the desktop object is adjusted according to the target movement increment.
[0072] Optionally, the shape of the desktop object is adjusted according to the target movement increment, including: obtaining a new number of grids occupied by the desktop object according to the target movement increment and the original number of grids occupied by the desktop object, and if the new number of grids is different from the original number of grids, the shape of the desktop object is adjusted.
[0073] In some exemplary embodiments, obtaining the direction angle corresponding to the first trigger instruction includes: obtaining the angle of the vector distance in the positive direction of the X-axis; and using the angle as the direction angle corresponding to the first trigger instruction.
[0074] The direction angle can be the angle between the vector distance in the positive direction of the X axis, which can be calculated by the inverse trigonometric function formula. For example, it can be calculated by the arcsin function, and the calculation formula is as follows: float angle = (float) Math.toDegrees(Math.asin(Math.abs(mDeltaY) / Math.abs(distance))), or it can be calculated by the arccos function, and the calculation formula is as follows: float angle=(float)Math.toDegrees(Math.acos(Math.abs(mDeltaX) / Math.abs(distance))), where float angle is the direction angle, mDeltaX is the movement amount in the X direction, mDeltaY is the movement amount in the Y direction, and distance is the vector distance.
[0075] Optionally, the mapping relationship between the angle and the moving direction, and the mapping relationship between the moving direction and the moving increment can be preconfigured. First, the target moving direction is obtained from the mapping relationship between the angle and the moving direction according to the direction angle, and then the target moving increment is determined from the mapping relationship between the moving direction and the moving increment according to the target moving direction. The moving increment can be positive or negative.
[0076] In some exemplary embodiments, determining the moving direction based on the direction angle includes: comparing the direction angle with an angle threshold range; determining a target angle threshold range within which the direction angle is located, and using the moving direction corresponding to the target angle threshold range as the target moving direction.
[0077] Optionally, the mapping relationship between the configuration angle and the moving direction may be a mapping relationship between an angle threshold range and the moving direction. Different angle threshold ranges correspond to different moving directions.
[0078] Optionally, the electronic device compares the direction angle with the angle threshold range, determines the target angle threshold range where the direction angle is located, and then uses the moving direction corresponding to the target angle threshold range as the target moving direction.
[0079] In some exemplary embodiments, the target angle threshold range in which the direction angle is located is determined, and the moving direction corresponding to the target angle threshold range is used as the target moving direction, including: determining that the angle threshold range in which the direction angle is located is a first angle threshold range, and taking the first moving direction corresponding to the first angle threshold range as the target moving direction; determining that the angle threshold range in which the direction angle is located is a second angle threshold range, and taking the second moving direction corresponding to the first angle threshold range as the target moving direction; determining that the angle threshold range in which the direction angle is located is a third angle threshold range, and taking the third moving direction corresponding to the first angle threshold range as the target moving direction; wherein the maximum value of the first angle threshold range is less than the minimum value of the second angle threshold range, and the maximum value of the second angle threshold range is less than the minimum value of the third angle threshold range.
[0080] like Figure 2 As shown, the touch point starting from the first trigger instruction is the origin, the horizontal rightward is the positive direction of the X-axis, and the vertical downward is the positive direction of the Y-axis. The right angle formed by XY is divided into three angle threshold ranges, such as the first angle threshold range is 0 to 30 degrees, corresponding to the first moving direction 202 is isXDireciton, the second angle threshold range is greater than 30 degrees to less than or equal to 60 degrees, corresponding to the second moving direction 204 is isMiddleDireciton, and the third angle threshold range is greater than 60 degrees to less than or equal to 90 degrees, corresponding to the third moving direction 206 isYDireciton.
[0081] By dividing the angle threshold range into three ranges, the moving direction of the first trigger instruction can be quickly and accurately determined, thereby quickly determining the target movement increment.
[0082] In some exemplary embodiments, the target movement increment is determined according to the target movement direction, including: when the target movement direction is the first movement direction or the second movement direction, if the movement amount in the first direction is positive, the movement increment in the first direction is increased by 1 grid number, and if the movement amount in the first direction is negative, the movement increment in the first direction is decreased by 1 grid number; when the target movement direction is the second movement direction or the third movement direction, if the movement amount in the second direction is positive, the movement increment in the second direction is increased by 1 grid number, and if the movement amount in the second direction is negative, the movement increment in the second direction is decreased by 1 grid number.
[0083] The target movement increment includes a first direction movement increment and a second direction movement increment. The original number of grids occupied by the desktop object includes the original number of grids in the first direction and the original number of grids in the second direction. Optionally, a new number of grids occupied by the desktop object is obtained according to the target movement increment and the original number of grids occupied by the desktop object. If the new number of grids is different from the original number of grids, the desktop object is adjusted in shape, including: obtaining a new number of grids in the first direction according to the first direction movement increment and the original number of grids in the first direction, and obtaining a new number of grids in the second direction according to the second direction movement increment and the original number of grids in the second direction; comparing the new number of grids in the first direction with the original number of grids in the first direction, and comparing the new number of grids in the second direction with the original number of grids in the second direction. If the new number of grids in the first direction is different from the original number of grids in the first direction, or the new number of grids in the second direction is different from the original number of grids in the second direction, the desktop object is adjusted in shape.
[0084] The first direction movement amount may be the X-axis movement amount, and the second direction movement amount may be the Y-axis movement amount. The first direction movement increment may be the X-axis movement increment, and the second direction movement increment may be the Y-axis movement increment. When the target movement direction is the first movement direction (such as isXDireciton) or the second movement direction (such as isMiddleDireciton), when the X-axis movement amount is positive, the X-axis movement increment, i.e., the lateral movement increment, is 1 grid number, and when the X-axis movement amount is negative, the X-axis movement increment is -1, i.e., it decreases by 1 grid number. When the target movement direction is the second movement direction (such as isMiddleDireciton) or the third movement direction (isYDireciton), if the Y-axis movement amount is positive, the Y-axis movement increment, i.e., the longitudinal movement increment, is an increase of 1 grid number, and if the Y-axis movement amount is negative, the Y-axis movement increment is a decrease of 1 grid number.
[0085] According to the movement increment in the first direction and the movement increment in the second direction, as well as the position occupied by the original desktop object and the number of grids spanX across or the number of grids spanY across, calculation is performed to obtain the possible target size of the desktop object at this moment, newspanX, newspanY. If newspanX, newspanY are different from the original spanX and spanY, shape adjustment is performed, that is, animation is performed.
[0086] Optionally, after the first trigger instruction meets the target trigger condition, the shape of the desktop object is adjusted, that is, the SpringAnimation desktop object adjustment animation starts to execute. During the animation execution, the touch operation can be moved at will. Although the size change is left to the animation to execute, if you want to change the direction of the animation, that is, change the final effect of the desktop object size change, you need to block the SpringAnimation desktop object size adjustment animation process and modify the final target of the animation, that is, the final target shape of the desktop object.
[0087] In some exemplary embodiments, Figure 3 As shown, in response to the second trigger instruction of the desktop object, determining the target shape of the desktop object includes:
[0088] Step 302: In response to a second trigger instruction for the desktop object, obtain an initial touch point position.
[0089] The initial touch point position can be the starting point position of the second trigger instruction. If no lift event occurs between the second trigger instruction and the first trigger instruction, the starting point position of the second trigger instruction can be the ending point position of the first trigger instruction. If a lift event occurs between the second trigger instruction and the first trigger instruction, the starting point position of the second trigger instruction can be any position on the desktop object, for example, it can be any vertex position of the desktop object. If the desktop object is a folder, the starting point position of the second trigger instruction can be any vertex position of the four vertex positions of the folder. The second trigger instruction can be an instruction generated by a movement operation in any direction.
[0090] Optionally, the electronic device obtains the initial touch point position in response to a second trigger instruction to the desktop object.
[0091] Step 304: Determine a plurality of adjustment areas according to the coordinate system of the desktop object and the position of the initial touch point.
[0092] The coordinate system where the desktop object is located can be a coordinate system established with the upper left corner of the electronic device's screen as the coordinate origin, with the positive direction of the X-axis to the right horizontally and the positive direction of the Y-axis to the downward vertically. It can also be a coordinate system established with the lower left corner of the electronic device's screen as the coordinate origin, with the positive direction of the X-axis to the right horizontally and the positive direction of the Y-axis to the upward vertically. It can also be a coordinate system established with the upper left corner of the desktop object as the coordinate origin, with the positive direction of the X-axis to the right horizontally and the positive direction of the Y-axis to the downward vertically. The coordinate system is not limited to this.
[0093] According to the coordinate system of the desktop object and the initial touch point position, the moving area corresponding to the second trigger instruction can be divided into multiple adjustment areas. The adjustment area refers to the trigger area used to adjust the shape of the desktop object. Different adjustment areas correspond to different shapes of desktop objects.
[0094] In some exemplary embodiments, the point where the finger is pressed at the beginning of the second trigger instruction is taken as the initial touch point initpoint, and the desktop object is a folder as an example, the folder is regarded as a two-dimensional coordinate system, the right is the positive direction of the X axis, the downward is the positive direction of the Y axis, the finger position during the folder size change animation is taken as the target touch point position dragpoint, and the area where the finger moves is divided into multiple adjustment areas. When the finger moves to different adjustment areas, the corresponding folder has different shapes.
[0095] Optionally, based on the coordinate system where the desktop object is located and the position of the initial touch point, the moving area corresponding to the second trigger instruction can be divided into multiple adjustment areas, which may include: in the coordinate system where the desktop object is located, the moving area corresponding to the second trigger instruction is divided into multiple adjustment areas by a straight line passing through the position of the initial touch point.
[0096] Step 306: Acquire the target touch point position corresponding to the second trigger instruction.
[0097] The target touch point position may refer to the touch point position where the second trigger instruction ends.
[0098] Optionally, the electronic device monitors the second trigger instruction using the TouchEvent touch event, and obtains the target touch point position corresponding to when the second trigger instruction ends.
[0099] Step 308: determine the target adjustment area where the target touch point is located.
[0100] Optionally, the dividing lines of each adjustment area may be represented by a function expression, and the target adjustment area where the target touch point position is located may be determined based on the coordinates of the target touch point position and the function expression.
[0101] Step 310: Acquire a shape corresponding to the target adjustment area, and use the shape corresponding to the target adjustment area as a target shape of the desktop object.
[0102] The mapping relationship between the adjustment area and the shape of the desktop object can be preconfigured. The target adjustment area is obtained, that is, the shape corresponding to the target adjustment area is obtained from the mapping relationship between the adjustment area and the shape of the desktop object according to the target adjustment area, and the shape corresponding to the target adjustment area is used as the target shape of the desktop object.
[0103] In this embodiment, by responding to the second trigger instruction for the desktop object, the initial touch point position is obtained, multiple adjustment areas are determined according to the coordinate system of the desktop object and the initial touch point position, the target touch point position corresponding to the second trigger instruction is obtained, the target adjustment area where the target touch point position is located is determined, and the shape corresponding to the target adjustment area is obtained as the target shape of the desktop object. The target shape of the desktop object can be determined more accurately.
[0104] It can be understood that the processing process of the third trigger instruction is the same as that of the second trigger instruction, and the difference is that what is obtained is the initial touch point position corresponding to the third trigger instruction and the target touch point position corresponding to the third trigger instruction.
[0105] In some exemplary embodiments, the multiple adjustment areas are determined based on the coordinate system where the desktop object is located and the initial touch point position, including: obtaining a target angle formed by the initial touch point position in the coordinate system where the desktop object is located; and dividing the target angle into three adjustment areas according to two straight lines passing through the initial touch point position.
[0106] Optionally, the display area where the desktop object is located can be the screen of the electronic device or the main display area of the electronic device. The target angle formed by the initial touch point position can be a 90-degree right angle, or a 120-degree angle, etc., but not limited to this. The target magnification can be configured as needed, such as the target magnification can be a value between 0.3 and 0.9, or a value between 0.5 and 0.8, such as 0.66, 0.6, 0.55, etc., but not limited to this. The areas of the three adjustment areas are different, and the difficulty of the second trigger instruction or the third trigger instruction to reach different adjustment areas is different. The adjustment will be more precise, and it can be ensured that there is no repeated blocking.
[0107] In some exemplary embodiments, the above method also includes: dividing the three adjustment areas according to a circle with the initial touch point position as the center and the target ratio of the single grid width as the radius to obtain four adjustment areas; wherein the single grid width is the grid width that divides the display area where the desktop object is located into multiple grids.
[0108] Exemplarily, the four adjustment areas may include an area that retains the original shape. For the area that retains the original shape, that is, the target touch point falls in the area that retains the original shape, there is no need to adjust the shape of the desktop object.
[0109] Optionally, the four adjustment areas have different areas. If the four adjustment areas have different areas, the second trigger instruction or the third trigger instruction has different degrees of difficulty in reaching different adjustment areas, and the adjustment will be more precise, which can ensure that there is no repeated blocking.
[0110] In some exemplary embodiments, the three adjustment areas are divided according to a circle with the initial touch point position as the center and the target magnification of the single grid width as the radius, so as to obtain four adjustment areas, including: a circle with the initial touch point position as the center and the target magnification of the single grid width as the radius, the three adjustment areas are divided to obtain a sector-shaped area with the initial touch point position as the center and the target magnification of the single grid width as the radius, and three adjustment areas are formed by the remaining parts of the three adjustment areas after removing the sector-shaped area, so as to obtain four adjustment areas.
[0111] In some exemplary embodiments, the two straight lines passing through the initial touch point position include: a first straight line passing through the initial touch point position and close to the X-axis and a second straight line passing through the initial touch point position and close to the Y-axis; according to a circle with the initial touch point position as the center and the target magnification of the single grid width as the radius, the three adjustment areas are divided to obtain four adjustment areas, including: according to the circle with the initial touch point position as the center and the target magnification of the single grid width as the radius, obtaining a first tangent and a first tangent point that are tangent to the circle and parallel to the X-axis, obtaining a second tangent and a second tangent point that are tangent to the circle and parallel to the Y-axis, obtaining a first intersection point of the first tangent and the second straight line passing through the initial touch point position, and a second intersection point of the second tangent and the first straight line, and dividing the three adjustment areas according to a first line segment from the first tangent point to the first intersection point, a second line segment from the first intersection point to the second intersection point, and a third line segment from the second intersection point to the second tangent point to obtain four adjustment areas.
[0112] Take the desktop object as a folder as an example, the moment when the finger is pressed is the initial touch point position initpoint, and the folder is regarded as a two-dimensional coordinate system. The right is the positive direction of the X axis, the downward is the positive direction of the Y axis, and the target angle is 90 degrees. Two straight lines with 30 degrees and 60 degrees to the positive direction of the X axis are drawn from the initial touch point position to divide 90 degrees. The finger position during the animation process is the target touch point position dragpoint. The moving area of the finger during the second trigger command is divided into four areas, such as Figures 4 to 7 As shown, there are four size specifications of area divisions.
[0113] like Figure 4As shown, taking the 2*2 folder scene as an example, the upper left corner of the folder is taken as the coordinate origin O, the lower right corner A of the folder is known to be the initial touch point position of initpoint, and the vertical angle of 90 degrees is divided into three areas with an angle of 30 degrees, namely the first area 402 close to the X axis, the second area 404 close to the Y axis and the third area 406 located in the middle, the straight line 410 passing through point A is a straight line with an angle of 30 degrees, and the straight line 420 passing through point A is a straight line with an angle of 60 degrees. Then, the fourth area 408 is cut out with 0.66 of the width of a single grid as the radius, that is, the area close to initpoint. The fourth area can be represented by a three-segment polyline area or a circular arc segment. The shape of the folder corresponding to the first area 402 is 2*1, the shape of the folder corresponding to the second area 404 is 1*2, the shape of the folder corresponding to the third area 406 is 1*1, and the shape of the folder corresponding to the fourth area 408 is 2*2, that is, the target touch point position does not need to be adjusted when it is located in the fourth area 408.
[0114] For line 410: Slope = , through point A (a, b), substitute into the point-slope equation: ; For line 420: slope = , through point A (a, b), substitute into the point-slope equation: , the equations of the two straight lines passing through point A (a, b) are the function expressions of straight line 410: , the function expression of line 420 is: The center coordinates of the circle are A (a, b), and the radius r = 0.66 of the width of a single grid. Substituting into the circle equation is: . Get the coordinates (x1, y1) of the target touch point position dragpoint, calculate the distance between the target touch point position and A (a, b), if it is less than or equal to the radius, it means that the target touch point position is in the fourth area 408, if it is greater than the radius r, it means that the target touch point position is not in the fourth area 408. Substitute the x1 coordinate of the target touch point position dragpoint into the function expression of the straight line 410 to obtain the y2 value, substitute it into the function expression of the straight line 420 to obtain the y3 value, and compare the coordinate y1 of dragpoint with y2 and y3 respectively; if the coordinate y1 of dragpoint is greater than the obtained y2 value, dragpoint is in the first area 402, and the corresponding target shape is 2*1; if the coordinate y1 of dragpoint is less than or equal to the y2 value and greater than or equal to y3, dragpoint is in the third area 406, and the corresponding target shape is 1*1; if the coordinate y1 of dragpoint is less than y3, dragpoint is in the second area 404, and the corresponding target shape is 1*2.
[0115] like Figure 5 As shown, taking the folder 1*1 scene as an example, the upper left corner of the folder is taken as the coordinate origin O, the lower right corner A of the folder is known to be the initial touch point position of initpoint, and the vertical angle of 90 degrees is divided into three areas with an angle of 30 degrees, namely the first area 502 close to the X-axis, the second area 504 close to the Y-axis and the third area 506 located in the middle, the straight line 510 passing through point A is a straight line with an angle of 30 degrees, and the straight line 520 passing through point A is a straight line with an angle of 60 degrees, and then 0.66 of the single grid width is used as the radius to cut out the fourth area 508, which is the area close to initpoint. The fourth area can be represented by a three-segment broken line area (circular arcs are used instead of three-segment broken lines during calculation), or by arc segments. The shape of the folder corresponding to the first area 502 is 1*2, the shape of the folder corresponding to the second area 504 is 2*1, the shape of the folder corresponding to the third area 506 is 2*2, and the shape of the folder corresponding to the fourth area 508 is 1*1, that is, no adjustment is required when the target touch point position is within the fourth area 508.
[0116] For line 510: Slope = , through point A (a, b), substitute into the point-slope equation: ; For line 520: slope = , through point A (a, b), substitute into the point-slope equation: , the equations of the two straight lines passing through point A (a, b) are the function expressions of straight line 510: , the function expression of line 520 is: The center coordinates of the circle are A (a, b), and the radius r = 0.66 of the width of a single grid. Substituting into the circle equation is: . Get the coordinates (x1, y1) of the target touch point position dragpoint, calculate the distance between the target touch point position and A (a, b), if it is less than or equal to the radius, it means that the target touch point position is in the fourth area 508, if it is greater than the radius r, it means that the target touch point position is not in the fourth area 508. Substitute the x1 coordinate of the target touch point position dragpoint into the function expression of the straight line 510 to obtain the y2 value, substitute it into the function expression of the straight line 520 to obtain the y3 value, and compare the coordinate y1 of dragpoint with y2 and y3 respectively; if the coordinate y1 of dragpoint is less than the y2 value, dragpoint is in the first area 502, and the corresponding target shape is 1*2; if the coordinate y1 of dragpoint is greater than or equal to the y2 value and less than or equal to y3, dragpoint is in the third area 506, and the corresponding target shape is 2*2; if the coordinate y1 of dragpoint is greater than y3, dragpoint is in the second area 504, and the corresponding target shape is 2*1.
[0117] like Figure 6 As shown, taking the folder 1*2 scene as an example, the upper left corner of the folder is taken as the coordinate origin O, the lower right corner A of the folder is known to be the initial touch point position of initpoint, and the vertical angle of 90 degrees is divided into three areas with an angle of 30 degrees, namely the first area 602 close to the X-axis, the second area 604 close to the Y-axis and the third area 606 located in the middle, the straight line 610 passing through point A is a straight line with an angle of 30 degrees, and the straight line 620 passing through point A is a straight line with an angle of 60 degrees, and then 0.66 of the single grid width is used as the radius to cut out the fourth area 608, which is the area close to initpoint. The fourth area can be represented by a three-segment broken line area (circular arcs are used instead of three-segment broken lines during calculation), or by arc segments. The shape of the folder corresponding to the first area 602 is 2*2, the shape of the folder corresponding to the second area 604 is 1*1, the shape of the folder corresponding to the third area 606 is 1*2, and the shape of the folder corresponding to the fourth area 608 is 1*2, that is, no adjustment is required when the target touch point position is within the fourth area 608.
[0118] For line 610: Slope = , through point A (a, b), substitute into the point-slope equation: ; For line 620: slope = , through point A (a, b), substitute into the point-slope equation: , the equations of the two straight lines passing through point A (a, b) are the function expressions of straight line 610: , the function expression of line 620 is: The center coordinates of the circle are A (a, b), and the radius r = 0.66 of the width of a single grid. Substituting into the circle equation is: . Get the coordinates (x1, y1) of the target touch point position dragpoint, calculate the distance between the target touch point position and A (a, b), if it is less than or equal to the radius, it means that the target touch point position is in the fourth area 608, if it is greater than the radius r, it means that the target touch point position is not in the fourth area 608. Substitute the x1 coordinate of the target touch point position dragpoint into the function expression of the straight line 610 to obtain the y2 value, substitute it into the function expression of the straight line 620 to obtain the y3 value, and compare the coordinate y1 of dragpoint with y2 and y3 respectively; if the coordinate y1 of dragpoint is greater than the y2 value, dragpoint is in the first area 602, and the corresponding target shape is 2*2; if the coordinate y1 of dragpoint is less than or equal to the y2 value and greater than or equal to y3, dragpoint is in the third area 606, and the corresponding target shape is 1*2; if the coordinate y1 of dragpoint is less than y3, dragpoint is in the second area 604, and the corresponding target shape is 1*1.
[0119] like Figure 7 As shown, taking the folder 2*1 scene as an example, the upper left corner of the folder is taken as the coordinate origin O, the lower right corner A of the folder is known to be the initial touch point position of initpoint, and the vertical angle of 90 degrees is divided into three areas with an angle of 30 degrees, namely the first area 702 close to the X-axis, the second area 704 close to the Y-axis and the third area 706 in the middle, the straight line 710 passing through point A is a straight line with an angle of 30 degrees, and the straight line 720 passing through point A is a straight line with an angle of 60 degrees, and then 0.66 of the single grid width is used as the radius to cut out the fourth area 708, which is the area close to initpoint. The fourth area can be represented by a three-segment broken line area (circular arcs are used instead of three-segment broken lines during calculation), or by arc segments. The shape of the folder corresponding to the first area 702 is 1*1, the shape of the folder corresponding to the second area 704 is 2*2, the shape of the folder corresponding to the third area 706 is 2*1, and the shape of the folder corresponding to the fourth area 708 is 2*1, that is, no adjustment is required when the target touch point position is within the fourth area 708.
[0120] For line 710: Slope = , through point A (a, b), substitute into the point-slope equation: ; For line 720: slope = , through point A (a, b), substitute into the point-slope equation: , the equations of the two straight lines passing through point A (a, b) are the function expressions of straight line 710: , the function expression of line 720 is: The center coordinates of the circle are A (a, b), and the radius r = 0.66 of the width of a single grid. Substituting into the circle equation is: . Get the coordinates (x1, y1) of the target touch point position dragpoint, calculate the distance between the target touch point position and A (a, b), if it is less than or equal to the radius, it means that the target touch point position is in the fourth area 708, if it is greater than the radius r, it means that the target touch point position is not in the fourth area 708. Substitute the x1 coordinate of the target touch point position dragpoint into the function expression of the straight line 710 to obtain the y2 value, substitute it into the function expression of the straight line 720 to obtain the y3 value, and compare the coordinate y1 of dragpoint with y2 and y3 respectively; if the coordinate y1 of dragpoint is less than the y2 value, dragpoint is in the first area 702, and the corresponding target shape is 1*1; if the coordinate y1 of dragpoint is greater than or equal to the y2 value and less than or equal to y3, dragpoint is in the third area 706, and the corresponding target shape is 2*1; if the coordinate y1 of dragpoint is greater than y3, dragpoint is in the second area 704, and the corresponding target shape is 2*2.
[0121] Figures 4 to 7 A 30-degree angle is used to divide a 90-degree angle, and it can also be dynamically adjusted according to the length and width of the folder, for example, two straight lines are used, one straight line is 15 degrees to the X-axis direction, and the other straight line is 45 degrees to the X-axis direction, etc., but it is not limited to this.
[0122] Fig. 8A FIG. 1 is a flowchart of a folder dragging deformation process in some exemplary embodiments. Fig. 8A As shown, taking the change of the folder shape from 2*2 to 1*2 as an example, the following process is included: drag the deformation control's squeezing and stretching effect (801, 806) → preview image following hand displacement effect (802) → release hand adsorption effect (803, 807) → preview image content rearrangement effect (804) → preview image rearrangement effect supports blocking (805) → operation point displacement effect (808). For example, 801 is a 2*2 folder stretching to the right, and 806 is a 1*2 folder squeezing inward; 802 is the process of dragging a 2*2 folder inward and the internal icon squeezing the folder and becoming smaller as the hand moves inward; 803 and 807 are the effects of the folder restoring its original shape and adsorbing to the boundary when the hand is raised; 804 is when 802 drags the folder to the target trigger condition to trigger the rearrangement effect, and the deformation is controlled by the animation at this time; 805 is when the finger moves in other directions during 804, resulting in 2*2 not necessarily being deformed into 1*2, and may be blocked to other sizes, such as becoming 1*1 or 2*2; 808 is the operation point displacement effect.
[0123] Figure 8BFIG. 1 is a flow chart of a folder dragging deformation process in some other exemplary embodiments. Figure 8B As shown, a 2*2 folder can be enlarged by dragging the folder outwards, or can be reduced by squeezing the folder inwards. A 2*2 folder can be changed into a 1*1 folder.
[0124] like Fig. 8A and 8B As shown, when the folder drag box moves with the hand, the drag box will gradually become smaller or larger. Since it may be dragged diagonally, the new moving direction is also unknown. It is necessary to calculate the new size that needs to be reached to trigger the preview image rearrangement animation, that is, the folder size adjustment animation. Therefore, the threshold judgment for triggering the rearrangement animation does not only consider the X-axis or Y-axis single direction, but introduces multiple dimensions such as vector distance, direction angle and throwing speed to perform threshold judgment, and obtain the corresponding newSpanX and newSpanY, and then adjust the shape of the folder, that is, adjust the size of the folder.
[0125] In some exemplary embodiments, before step 102, the method further includes: displaying a desktop object on a screen; in response to a deformation triggering operation on the desktop object, displaying a window where the desktop object is located, and displaying a deformation triggering position of the desktop object in the window.
[0126] Among them, the deformation trigger operation can be at any position or target position on the desktop object. The deformation trigger operation is used to trigger the display of a window for shape adjustment. The deformation trigger position can be any position or multiple positions of the four top corners of the desktop object. The four top corners may include the upper left corner, the lower left corner, the upper right corner, and the lower right corner. The window can be a new layer, a floating window, or a page, etc. Optionally, the desktop object View is mapped to a new layer, and the outer frame and deformation trigger position of the desktop object are displayed on the new layer. The level of the new layer is above the real desktop object.
[0127] Step 102 includes: in response to a first trigger instruction for a deformation trigger position of a desktop object satisfying a target trigger condition, closing the window, and adjusting the shape of the desktop object on the screen.
[0128] By displaying the deformation trigger position in the window, the user can be easily prompted to perform the shape adjustment trigger operation. It is also convenient to accurately obtain the position of the first trigger instruction in the window, so as to accurately judge whether the target trigger conditions are met and improve the accuracy of the deformation trigger judgment logic.
[0129] In some exemplary embodiments, the method further includes: displaying function options in the window; and in response to a selection operation on the function option, performing a corresponding operation on the desktop object according to the selected function option.
[0130] Function options are related to desktop objects. For example, if the desktop object is a folder, the function options may include one or more of switching to a small folder, opening a folder, renaming, and disbanding. If the desktop object is a card, the function options may include one or more of switching to a small card or a large card, renaming, viewing details, and deleting. If the desktop object is an application icon, the function options may include one or more of resizing, renaming, uninstalling, deleting, and starting.
[0131] Fig. 9 Schematic diagram of the interface change of folder dragging deformation in some exemplary embodiments. Fig. 9 As shown, taking a folder as an example of a desktop object, a folder 902 is displayed on the screen of the electronic device. In response to a deformation trigger operation on the folder, a window 904 where the folder is located is displayed, and an outer frame and a deformation trigger position of the folder 902 are displayed in the window 904. The outer frame is a drag frame, and the deformation trigger position can be a drag handle 906 displayed in the lower right corner of the folder 902, as well as function options. The function options may include switching to a small folder, opening a folder, renaming, disbanding, and other function items. If the user selects to switch to a small folder, the folder is switched to a smaller folder, such as shrinking a 2*2 folder to a 1*1 folder. In response to the user dragging the handle to move, the vector distance, throwing speed and direction angle of the dragging movement of the folder are obtained. When the vector distance exceeds 0.66 of the width of a single grid, or the vector distance exceeds 0.33 of the width of a single grid and the throwing speed exceeds 1000 pixels / second, the target trigger condition is met, and the target movement direction is determined according to the direction angle. The target movement increment is determined according to the target movement direction. It can be seen that the X-direction movement increment is minus 1, and the target Y-direction movement increment is 0. Then, the animation of adjusting the shape of the folder is executed. During the shape adjustment process, in response to the user dragging the handle again to move, the corresponding target shape is determined according to the target touch point position of the dragged movement again. If the target shape is 1*1, the folder will be animatedly adjusted to a 1*2 shape first, and then animated to a 1*1 shape.
[0132] It should be understood that, although the steps in the flowcharts of the embodiments described above are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0133] Based on the same inventive concept, the embodiment of the present application also provides a device for implementing the above method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments provided below can refer to the limitations of the above method, which will not be repeated here.
[0134] In some exemplary embodiments, a desktop object processing device includes an adjustment module 1010 and a determination module 1020 .
[0135] The adjustment module 1010 is configured to adjust the shape of the desktop object in response to a first trigger instruction on the desktop object satisfying a target trigger condition.
[0136] The determination module 1020 is used to determine the target shape of the desktop object in response to a second trigger instruction to the desktop object during shape adjustment.
[0137] The adjustment module 1010 is further configured to adjust the shape of the desktop object according to the target shape after the shape adjustment of the desktop object satisfies the first target adjustment condition.
[0138] In one embodiment, the determination module 1020 is further configured to determine a new target shape of the desktop object in response to a third trigger instruction to the desktop object during the process of adjusting the shape of the desktop object according to the target shape; and to adjust the shape of the desktop object according to the new target shape after the shape adjustment of the desktop object according to the target shape satisfies a second target adjustment condition. The second target condition is the same as or different from the first target condition.
[0139] In one embodiment, the adjustment module 1010 is also used to respond to a first trigger instruction for a desktop object, obtain a vector distance and a throwing speed corresponding to the first trigger instruction; determine whether a target trigger condition is met based on the vector distance and the throwing speed; and if it is determined that the target trigger condition is met, adjust the shape of the desktop object.
[0140] In one embodiment, the adjustment module 1010 is further configured to obtain a first direction movement amount and a second direction movement amount corresponding to the first trigger instruction; and determine the vector distance according to the first direction movement amount and the second direction movement amount.
[0141] In one embodiment, the target trigger condition includes the vector distance reaching a first vector distance threshold, or the vector distance reaching a second vector distance threshold and the throwing speed reaching a throwing speed threshold, wherein the first vector distance threshold is greater than the second vector distance threshold; the adjustment module 1010 is also used to adjust the shape of the desktop object when the vector distance reaches the first vector distance threshold, or the vector distance reaches the second vector distance threshold and the throwing speed reaches the throwing speed threshold.
[0142] In one embodiment, the adjustment module 1010 is also used to obtain the direction angle corresponding to the first trigger instruction; determine the target movement direction according to the direction angle, and determine the target movement increment according to the target movement direction; when it is determined that the target trigger condition is met, adjust the shape of the desktop object according to the target movement increment.
[0143] In one embodiment, the adjustment module 1010 is further configured to obtain an angle of the vector distance in the positive direction of the X-axis; and use the angle as a direction angle corresponding to the first trigger instruction.
[0144] In one embodiment, the adjustment module 1010 is further used to compare the direction angle with the angle threshold range; determine the target angle threshold range where the direction angle is located, and use the moving direction corresponding to the target angle threshold range as the target moving direction.
[0145] In one embodiment, the adjustment module 1010 is also used to determine that the angle threshold range where the direction angle is located is a first angle threshold range, and then the first moving direction corresponding to the first angle threshold range is used as the target moving direction; determine that the angle threshold range where the direction angle is located is a second angle threshold range, and then the second moving direction corresponding to the first angle threshold range is used as the target moving direction; determine that the angle threshold range where the direction angle is located is a third angle threshold range, and then the third moving direction corresponding to the first angle threshold range is used as the target moving direction; wherein the maximum value of the first angle threshold range is less than the minimum value of the second angle threshold range, and the maximum value of the second angle threshold range is less than the minimum value of the third angle threshold range.
[0146] In one of the embodiments, the adjustment module 1010 is also used for, when the target moving direction is the first moving direction or the second moving direction, if the moving amount in the first direction is positive, then the moving increment in the first direction is to increase the number of grids by 1, and if the moving amount in the first direction is negative, then the moving increment in the first direction is to decrease the number of grids by 1; when the target moving direction is the second moving direction or the third moving direction, if the moving amount in the second direction is positive, then the moving increment in the second direction is to increase the number of grids by 1, and if the moving amount in the second direction is negative, then the moving increment in the second direction is to decrease the number of grids by 1.
[0147] In one embodiment, the determination module 1020 is also used to obtain the initial touch point position in response to a second trigger instruction for the desktop object; determine multiple adjustment areas based on the coordinate system of the desktop object and the initial touch point position; obtain the target touch point position corresponding to the second trigger instruction; determine the target adjustment area where the target touch point position is located; obtain the shape corresponding to the target adjustment area, and use the shape corresponding to the target adjustment area as the target shape of the desktop object.
[0148] In one embodiment, the determination module 1020 is further used to obtain a target angle formed by the initial touch point position in the coordinate system where the desktop object is located; and divide the target angle into three adjustment areas according to two straight lines passing through the initial touch point position.
[0149] In one embodiment, the determination module 1020 is also used to divide the three adjustment areas into four adjustment areas according to a circle with the initial touch point position as the center and the target ratio of the single grid width as the radius; wherein the single grid width is the grid width that divides the desktop area where the desktop object is located into multiple grids.
[0150] In one embodiment, the first trigger instruction or the second trigger instruction is an instruction generated by a movement operation in any direction.
[0151] In one of the embodiments, the device further includes: a first display module and a second display module.
[0152] The first display module is used to display desktop objects on the screen.
[0153] The second display module is used to display the window where the desktop object is located in response to the deformation triggering operation on the desktop object, and display the deformation triggering position of the desktop object in the window.
[0154] The adjustment module 1010 is further configured to close the window and adjust the shape of the desktop object on the screen in response to the first trigger instruction on the deformation trigger position of the desktop object satisfying a target trigger condition.
[0155] Each module in the above device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0156] In an exemplary embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, the above method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0157] Those skilled in the art will understand that Fig.11 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In an exemplary embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method when executing the computer program.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.
[0160] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps in the above method when executed by a processor.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0162] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A desktop object processing method, characterized in that: The method comprises: In response to a first trigger instruction on a desktop object satisfying a target trigger condition, adjusting the shape of the desktop object; During the shape adjustment, in response to a second trigger instruction to the desktop object, determining a target shape of the desktop object; After the shape adjustment of the desktop object satisfies the first target adjustment condition, the shape of the desktop object is adjusted according to the target shape.
2. The method according to claim 1, characterized in that: The method further comprises: In a process of adjusting the shape of the desktop object according to the target shape, in response to a third trigger instruction to the desktop object, determining a new target shape of the desktop object; After the desktop object is adjusted in shape according to the target shape to meet a second target adjustment condition, the desktop object is adjusted in shape according to the new target shape; the second target adjustment condition is the same as or different from the first target adjustment condition.
3. The method according to claim 1, characterized in that In response to the first trigger instruction on the desktop object satisfying the target trigger condition, adjusting the shape of the desktop object comprises: In response to a first trigger instruction for a desktop object, acquiring a vector distance and a throwing speed corresponding to the first trigger instruction; Determining whether a target trigger condition is met according to the vector distance and the throwing speed; When it is determined that the target trigger condition is met, the shape of the desktop object is adjusted.
4. The method according to claim 3, characterized in that The obtaining of the vector distance corresponding to the first trigger instruction includes: Acquire the movement amount in the first direction and the movement amount in the second direction corresponding to the first trigger instruction; The vector distance is determined according to the movement amount in the first direction and the movement amount in the second direction.
5. The method according to claim 4, characterized in that The target trigger condition includes that the vector distance reaches a first vector distance threshold, or the vector distance reaches a second vector distance threshold and the throwing speed reaches a throwing speed threshold, wherein the first vector distance threshold is greater than the second vector distance threshold; when it is determined that the target trigger condition is met, adjusting the shape of the desktop object includes: When the vector distance reaches the first vector distance threshold, or when the vector distance reaches the second vector distance threshold and the throwing speed reaches the throwing speed threshold, the desktop object is adjusted in shape.
6. The method according to claim 3, characterized in that: The method further comprises: Obtaining the direction angle corresponding to the first trigger instruction; Determine the target moving direction according to the direction angle, and determine the target moving increment according to the target moving direction; When it is determined that the target trigger condition is met, adjusting the shape of the desktop object includes: When it is determined that the target trigger condition is met, the shape of the desktop object is adjusted according to the target movement increment.
7. The method according to claim 6, characterized in that The obtaining the direction angle corresponding to the first trigger instruction includes: Obtaining the angle of the vector distance in the positive direction of the X-axis; The included angle is used as the direction angle corresponding to the first trigger instruction.
8. The method according to claim 6, characterized in that The determining the moving direction according to the direction angle comprises: comparing the direction angle with an angle threshold range; A target angle threshold range within which the direction angle is located is determined, and a moving direction corresponding to the target angle threshold range is used as a target moving direction.
9. The method according to claim 8, characterized in that The determining a target angle threshold range where the direction angle is located, and taking a moving direction corresponding to the target angle threshold range as a target moving direction, comprises: Determine that the angle threshold range in which the direction angle is located is a first angle threshold range, and use a first moving direction corresponding to the first angle threshold range as a target moving direction; Determine that the angle threshold range within which the direction angle is located is a second angle threshold range, and use a second moving direction corresponding to the first angle threshold range as a target moving direction; Determine that the angle threshold range within which the direction angle is located is a third angle threshold range, and use a third moving direction corresponding to the first angle threshold range as a target moving direction; The maximum value of the first angle threshold range is smaller than the minimum value of the second angle threshold range, and the maximum value of the second angle threshold range is smaller than the minimum value of the third angle threshold range.
10. The method according to claim 9, characterized in that The step of determining the target movement increment according to the target movement direction comprises: When the target moving direction is the first moving direction or the second moving direction, if the moving amount in the first direction is positive, the moving increment in the first direction is an increase of 1 grid number; if the moving amount in the first direction is negative, the moving increment in the first direction is a decrease of 1 grid number; When the target moving direction is the second moving direction or the third moving direction, if the second direction moving amount is positive, the second direction moving increment is an increase of 1 grid number; if the second direction moving amount is negative, the second direction moving increment is a decrease of 1 grid number.
11. The method according to claim 1, characterized in that The step of determining a target shape of the desktop object in response to a second trigger instruction of the desktop object comprises: In response to a second trigger instruction for the desktop object, acquiring an initial touch point position; Determining a plurality of adjustment areas according to the coordinate system where the desktop object is located and the position of the initial touch point; Acquire the target touch point position corresponding to the second trigger instruction; Determine a target adjustment area where the target touch point position is located; A shape corresponding to the target adjustment area is acquired, and the shape corresponding to the target adjustment area is used as a target shape of the desktop object.
12. The method according to claim 11, characterized in that The step of determining a plurality of adjustment areas according to the coordinate system where the desktop object is located and the position of the initial touch point includes: Acquire a target angle formed by the initial touch point position in the coordinate system where the desktop object is located; The target angle is divided into three adjustment areas according to two straight lines passing through the initial touch point position.
13. The method according to claim 12, characterized in that The method further comprises: According to a circle with the initial touch point position as the center and the target magnification of the single grid width as the radius, the three adjustment areas are divided to obtain four adjustment areas; The single grid width is the grid width for dividing the desktop area where the desktop object is located into multiple grids.
14. The method according to any one of claims 1 to 13, characterized in that The first trigger instruction or the second trigger instruction is an instruction generated by a movement operation in any direction.
15. The method according to any one of claims 1 to 13, characterized in that The method further comprises: Display desktop objects on the screen; In response to a deformation triggering operation on the desktop object, displaying a window where the desktop object is located, and displaying a deformation triggering position of the desktop object in the window; In response to the first trigger instruction on the desktop object satisfying the target trigger condition, adjusting the shape of the desktop object comprises: In response to a first trigger instruction on a deformation trigger position of the desktop object satisfying a target trigger condition, the window is closed and the shape of the desktop object is adjusted on the screen.
16. A desktop object processing device, characterized in that: The device comprises: an adjustment module, configured to adjust the shape of the desktop object in response to a first trigger instruction on the desktop object satisfying a target trigger condition; a determination module, configured to determine a target shape of the desktop object in response to a second trigger instruction to the desktop object during shape adjustment; The adjustment module is further configured to adjust the shape of the desktop object according to the target shape after the shape adjustment of the desktop object satisfies a first target adjustment condition.
17. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 15 are implemented.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.