Methods, apparatuses, and media for adjusting view components

By setting touch listening events and gesture operations for view components in the vehicle-to-everything (V2X) smart terminal, the custom size and position adjustment of view components are realized, solving the problem that users cannot customize the style of the smart terminal and improving the user experience.

CN115700476BActive Publication Date: 2026-04-07SHANGHAI QINGGAN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-26
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing vehicle-to-everything (V2X) smart terminal products, users cannot customize the style and element positions of the smart terminal, leading to visual fatigue and failing to meet personalized needs.

Method used

By setting the first touch listener event of the view component, touch operations can be monitored in real time, automatically triggering the size adjustment state, and triggering layout parameter adjustment when the preset size parameter threshold is reached. Users can customize the size and position of the view component and achieve flexible adjustment by combining gesture operations and drag operations.

Benefits of technology

It enables flexible size and position adjustment of view components, improving the user experience, avoiding visual fatigue, and meeting users' personalized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700476B_ABST
    Figure CN115700476B_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for adjusting a view component. The method includes: setting a first touch listening event for the view component; listening to and acquiring a first touch operation based on the first touch listening event; adjusting the first component size of the view component according to the first touch operation; and triggering the setting of layout parameters corresponding to the view component to adjust the view component when the actual size parameter of the first component reaches a preset size parameter threshold. In this invention, users can redefine the size of view components on the desktop according to their own needs; the size of the view component can be adjusted within a certain size range, and the corresponding attribute parameters of the view component are also dynamically adjusted according to the size of the view component. This prevents the view component size from increasing without changing the content, thus avoiding wasted space. It enables users to customize the display interface, meets higher user needs, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interface display control technology, and in particular to a method, device and medium for adjusting a view component. Background Technology

[0002] Existing connected vehicle smart terminal products have fixed elements, sizes, and positions on the smart terminal desktop. Users cannot customize their smart terminal style, homepage elements, element positions, etc. Staring at the same smart terminal every day can easily lead to visual fatigue, thus failing to meet the actual needs of users. Summary of the Invention

[0003] One objective of this invention is to provide a method for adjusting view components. Its advantage lies in that a first touch listener event is pre-set for each view component. By listening to the first touch listener event in real time to obtain the corresponding touch operation, the view component is automatically triggered to enter a size-adjustable state, enabling flexible adjustment of the component's size. During the adjustment process, when the actual size parameter of the view component reaches a preset size parameter threshold, the layout parameters corresponding to that view component are set, completing the final adjustment of the view component. Users can redefine the size of view components on the desktop according to their own needs, greatly improving the user experience.

[0004] Another objective of this invention is to provide a method for adjusting a view component. Its advantage is that the user can trigger a pop-up window for displaying size parameters by setting an operation, and then input the corresponding aspect ratio parameters in the pop-up window to customize the size of the corresponding view component according to their own needs, thereby improving the user experience.

[0005] Another objective of this invention is to provide a method for adjusting a view component. Its advantage lies in that by picking up the distance of the gesture movement performed by the user within a set area where the view component is located, that is, by obtaining the gesture movement direction and gesture displacement based on the position coordinate data corresponding to the initial gesture position and the end gesture position respectively, and then combining the pre-fixed relationship between the gesture movement direction and scaling, it is determined whether to shrink or enlarge, and the corresponding shrinkage amount and enlargement amount, thereby realizing flexible adjustment of the component size of the view component.

[0006] Another objective of this invention is to provide a method for adjusting a view component, the advantage of which is that when the component size of the view component is adjusted to the minimum size parameter threshold or the maximum size parameter threshold, the minimum size parameter threshold or the maximum size parameter threshold is stored in the local storage of the smart terminal to fix the component size of the view component. At this time, if the user continues to zoom in or out, the component size of the view component will no longer change and will remain at the corresponding minimum size parameter threshold or maximum size parameter threshold.

[0007] Another objective of this invention is to provide a method for adjusting a view component, the advantage of which is that, during the process of adjusting the component size of the view component, when the component size of the view component is enlarged to a first size parameter threshold, a first component of the view component is generated and added to the view component; a second touch listening event of the first component is established, and a first touch operation is listened to according to the second touch listening event to realize flexible adjustment of the component size of the first component.

[0008] Another objective of this invention is to provide a method for adjusting a view component, the advantage of which is that, during the process of adjusting the component size of the view component, when the component size of the view component is enlarged to a first size parameter threshold, a first component of the view component is generated and added to the view component; a third touch listening event of the first component is established, and a second touch operation of the corresponding second preset touch response area in the view component is listened to according to the third touch listening event, so as to realize flexible adjustment of the component size of the first component.

[0009] Another objective of this invention is to provide a method for adjusting a view component, the advantage of which is that the drag path of the view component is determined based on the drag operation, and the movement direction and movement offset corresponding to the drag operation are determined by the positional deviation between the end point of the drag and the center point of the view component, so as to realize arbitrary movement operation of the view component.

[0010] Another objective of this invention is to provide a method for adjusting view components, the advantage of which is that the various view components in the initial display interface can be flexibly placed through touch operation to meet the desktop style of different users; users can adjust them regularly or irregularly according to their own needs to avoid visual fatigue and improve the user experience.

[0011] Another objective of this invention is to provide an electronic device with the advantage of implementing the aforementioned method for adjusting view components. Users can redefine the size of view components on the desktop and adjust their arrangement according to their needs. The size of the view components can be adjusted within a certain range, and the corresponding attribute parameters of the view components are also dynamically adjusted according to the size of the view components. This prevents the view components from becoming larger without changing their content, thus avoiding wasted space. Users can customize the display style, homepage elements, and element positions of the display interface in the smart terminal, meeting higher user needs and greatly improving the user experience.

[0012] Another objective of this invention is to provide a computer-readable storage medium with the advantage of implementing the aforementioned method for adjusting view components. Users can redefine the size of view components on the desktop and adjust their arrangement according to their needs. The size of the view components can be adjusted within a certain range, and the corresponding attribute parameters of the view components are also dynamically adjusted according to the size of the view components. This prevents the view component size from increasing while the content remains unchanged, thus avoiding wasted space. It also allows users to customize the display style, homepage elements, and element positions of the display interface on the smart terminal, meeting higher user needs and greatly improving the user experience.

[0013] The present invention solves the above-mentioned technical problems through the following technical solution:

[0014] This invention provides a method for adjusting a view component, the method comprising the following steps:

[0015] Set the first touch listener event for the view component;

[0016] Based on the first touch listening event, listen for and obtain the first touch operation;

[0017] Adjust the first component size of the view component according to the first touch operation;

[0018] When the actual size parameter of the first component reaches the preset size parameter threshold, the layout parameters corresponding to the view component are set, and the view component is adjusted.

[0019] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for adjusting the view component.

[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the above-described method for adjusting the view component.

[0021] Based on common knowledge in the field, the preferred conditions described can be combined arbitrarily to obtain various preferred embodiments of the present invention. Attached Figure Description

[0022] Figure 1 This is a flowchart of the adjustment method for the view component according to Embodiment 1 of the present invention.

[0023] Figure 2 This is a first flowchart of the adjustment method for the view component according to Embodiment 2 of the present invention.

[0024] Figure 3 This is a second flowchart of the adjustment method for the view component according to Embodiment 2 of the present invention.

[0025] Figure 4 This is the third flowchart of the view component adjustment method of Embodiment 2 of the present invention.

[0026] Figure 5 This is the fourth flowchart of the view component adjustment method of Embodiment 2 of the present invention.

[0027] Figure 6 This is a schematic diagram illustrating the position adjustment of different view components in Embodiment 2 of the present invention.

[0028] Figure 7 This is a schematic diagram of view components of different sizes according to Embodiment 2 of the present invention.

[0029] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the adjustment method of the view component according to Embodiment 3 of the present invention. Detailed Implementation

[0030] The present invention will be further illustrated by way of embodiments below, but the present invention is not limited to the scope of the embodiments described herein.

[0031] Example 1

[0032] like Figure 1 As shown, the method for adjusting the view component in this embodiment includes:

[0033] S101, Set the first touch listener event for the view component;

[0034] View components include, but are not limited to, APP (application) icons displayed on the display interface of a smart terminal, such as navigation applications, music applications, etc.

[0035] S102, Listen for and obtain the first touch operation based on the first touch listening event;

[0036] S103. Adjust the size of the first component of the view component according to the first touch operation;

[0037] A first touch listener event is pre-set for each view component to detect the corresponding touch operation in real time and automatically trigger the view component to enter the adjustable size state, thereby enabling flexible adjustment of the component size.

[0038] S104. When the actual size parameter of the first component reaches the preset size parameter threshold, the layout parameters corresponding to the view component are set, and the view component is adjusted.

[0039] During the process of adjusting the size of a view component, when the actual size parameter of the view component reaches the preset size parameter threshold, the layout parameters corresponding to the view component are set, thus completing the final adjustment of the view component.

[0040] In this embodiment, a first touch listener event is pre-set for each view component. The corresponding touch operation is detected in real time through the first touch listener event, and the view component is automatically triggered to enter the adjustable size state, realizing flexible adjustment of the component size. During the adjustment of the component size, when the actual size parameter of the view component reaches the preset size parameter threshold, the layout parameter corresponding to the view component is set, completing the final adjustment of the view component. Users can redefine the size of the view components on the desktop according to their own needs, greatly improving the user experience.

[0041] Example 2

[0042] The method for adjusting the view component in this embodiment is a further improvement on Embodiment 1, specifically:

[0043] In one possible embodiment, such as Figure 2 As shown, when the first touch operation corresponds to the first preset touch response area and is a long press or double-click operation, step S103 includes:

[0044] S1031. Trigger a pop-up window for inputting display size parameters based on the first touch operation;

[0045] S1032. Obtain component size input parameters based on the parameter input pop-up window, and adjust the first component size of the view component.

[0046] Users can trigger a pop-up window for displaying size parameters by setting a specific operation. They can then enter the corresponding aspect ratio parameters in this pop-up window to customize the size of the corresponding view components according to their own needs, thereby improving the user experience.

[0047] Considering that the size of each view component cannot be scaled indefinitely, it is necessary to pre-set upper and lower limits for the component size adjustment of each view component. When the component size input parameter entered by the user in the input size parameter pop-up window is greater than the upper limit or less than the lower limit, a reminder message is generated to prompt the user that the current input parameter is too large or too small, so that the user can make adaptive adjustments and further improve the user experience.

[0048] In addition, the component size input parameters entered by the user can be cached in the local storage of the smart terminal. This ensures that the view component corresponding to the component size input parameters from the last shutdown is displayed on the smart terminal's display page the next time the device is powered on, further improving the user experience.

[0049] In one possible embodiment, such as Figure 3 As shown, step S103 includes:

[0050] S1033, Obtain the gesture movement distance corresponding to the first touch operation;

[0051] S1034. Based on the gesture movement distance, determine the scaling operation and corresponding scaling value to be performed on the view component, and adjust the first component size of the view component.

[0052] By picking up the distance of the user's gesture movement within a defined area where the view component is located, that is, based on the position coordinate data corresponding to the initial gesture position and the end gesture position respectively, the gesture movement direction and gesture displacement are obtained. Then, combined with the pre-fixed relationship between the gesture movement direction and scaling, it is determined whether to shrink or enlarge (for example, the gesture movement direction away from the view component corresponds to a zoom operation, the gesture movement direction closer to the view component corresponds to a zoom operation; the gesture movement direction upward corresponds to a zoom operation, the gesture movement direction downward corresponds to a zoom operation, etc.), as well as the corresponding shrinkage and enlargement amount, thereby realizing flexible adjustment of the component size of the view component.

[0053] In one possible embodiment, the preset size parameter thresholds include a minimum size parameter threshold and a maximum size parameter threshold.

[0054] Step S104 includes:

[0055] When the actual size parameter of the first component is reduced to the minimum size parameter threshold, the size of the first component of the view component is adjusted using the minimum size parameter threshold, and the minimum size parameter threshold is saved to fix the size of the first component of the view component.

[0056] When the actual size parameter of the first component is enlarged to the maximum size parameter threshold, the size of the first component of the view component is adjusted using the maximum size parameter threshold, and the maximum size parameter threshold is saved to fix the size of the first component of the view component.

[0057] When the size of a view component is adjusted to the minimum or maximum size parameter threshold, the minimum or maximum size parameter threshold is stored in the local storage of the smart terminal to fix the size of the view component. If the user continues to zoom in or out, the size of the view component will no longer change and will remain at the corresponding minimum or maximum size parameter threshold.

[0058] In one embodiment, the preset size parameter thresholds include a minimum size parameter threshold, a maximum size parameter threshold, and a first size parameter threshold, wherein the first size parameter threshold is greater than the minimum size parameter threshold and less than the maximum size parameter threshold.

[0059] like Figure 4 As shown, step S104 includes:

[0060] S10411. When the actual size parameter of the first component is enlarged to the threshold of the first size parameter, the first component corresponding to the view component is generated.

[0061] S10412, Establish the second touch listener event for the first component;

[0062] S10413. Add the first component to the view component;

[0063] The execution order of steps S10412 and S10413 can be interchanged.

[0064] S10414. Listen for and obtain the first touch operation based on the second touch listening event, and adjust the size of the second component of the first component according to the first touch operation;

[0065] In this case, the adjusted size of the second component of the first component is adapted to the size of the first component of the corresponding view component;

[0066] Additionally, when the actual size parameter of the first component of the view component shrinks to the threshold of the first size parameter, the first component is removed from the view component.

[0067] During the process of adjusting the size of a view component, when the size of the view component is enlarged to the first size parameter threshold, the first component of the view component is generated and added to the view component. For example, a Text View (text component) corresponding to the singer information is added to the music view component. A second touch listener event is established for the first component, and the first touch operation is listened to according to the second touch listener event to realize the flexible adjustment of the size of the first component.

[0068] Of course, you can also configure it so that when the size of the view component is increased to the first size parameter threshold, multiple first components corresponding to the view component are generated and added to the view component; establish a second touch listener event for each first component, and listen for the first touch operation according to the second touch listener event to achieve synchronous adjustment of the component size of each first component. The size adjustment method of each first component is the same as described above, so it will not be repeated here.

[0069] Additionally, multiple different first size parameter thresholds can be set. This allows the generation of a corresponding first component to be triggered when the size of a view component reaches a certain first size parameter threshold during the component resizing process. Different first components can be generated under different first size parameter thresholds. The size adjustment method for each first component is the same as described above, so it will not be repeated here.

[0070] In one embodiment, the preset size parameter thresholds include a minimum size parameter threshold, a maximum size parameter threshold, and a first size parameter threshold, wherein the first size parameter threshold is greater than the minimum size parameter threshold and less than the maximum size parameter threshold.

[0071] like Figure 5 As shown, step S104 includes:

[0072] S10421. When the actual size parameter of the first component is enlarged to the threshold of the first size parameter, the first component corresponding to the view component is generated.

[0073] S10422, Establish the third touch listener event for the first component;

[0074] S10423. Add the first component to the view component;

[0075] The execution order of steps S10422 and S10423 can be interchanged.

[0076] S10424. Set the second preset touch response area corresponding to the first component in the view component;

[0077] S10425. Listen for and obtain the second touch operation corresponding to the second preset touch response area based on the third touch listening event, and adjust the size of the second component of the first component according to the second touch operation;

[0078] In this case, the adjusted size of the second component of the first component is adapted to the size of the first component of the corresponding view component;

[0079] Additionally, when the actual size parameter of the first component of the view component shrinks to the threshold of the first size parameter, the first component is removed from the view component.

[0080] During the process of adjusting the size of a view component, when the size of the view component is enlarged to the first size parameter threshold, the first component of the view component is generated and added to the view component. For example, a Text View (text component) corresponding to the singer information is added to the music view component. A third touch listener event is established for the first component, and the second touch operation of the corresponding second preset touch response area in the view component is listened to according to the third touch listener event, so as to realize the flexible adjustment of the size of the first component.

[0081] Of course, you can also configure it so that when the size of the view component is increased to the first size parameter threshold, multiple first components corresponding to the view component are generated and added to the view component; establish a third touch listener event for each first component, and listen for second touch operations based on the third touch listener event to achieve synchronous adjustment of the component size of each first component. The size adjustment method of each first component is the same as described above, so it will not be repeated here.

[0082] Additionally, multiple different first size parameter thresholds can be set. This allows the generation of a corresponding first component to be triggered when the size of a view component reaches a certain first size parameter threshold during the component resizing process. Different first components can be generated under different first size parameter thresholds. The size adjustment method for each first component is the same as described above, so it will not be repeated here.

[0083] In one possible embodiment, when the first touch operation corresponds to a first preset touch response area and is a drag operation, the method further includes:

[0084] Based on the drag path of the drag operation, obtain the first position information when the drag operation stops;

[0085] Based on the first position information and the center position information corresponding to the view component, determine the movement parameters corresponding to the view component and complete the drag operation of the view component.

[0086] The movement parameters include the direction of movement and the offset of movement.

[0087] The drag path of the dragged view component is determined by dragging the drag operation, and the movement direction and movement offset corresponding to the drag operation are determined by the positional deviation between the drag end point and the center point of the view component, so as to realize arbitrary movement operation of the view component.

[0088] In one possible embodiment, when the first touch operation corresponds to a first preset touch response area and is a long press operation, the method further includes:

[0089] Move different view components to a regular or irregular preset layout path.

[0090] like Figure 6 As shown, the left side is the initial display interface. Through touch operation, the various view components in the initial display interface can be flexibly placed to obtain the custom display interface on the right, so as to meet the desktop definition style of different users. Users can adjust it regularly or irregularly according to their own needs to avoid visual fatigue and significantly improve the user experience.

[0091] The working principle of the view component adjustment method in this embodiment will be explained in detail below with examples:

[0092] (1) Add a size setting item for each view component. When the View is loaded into the view layout, set the width and height to the adjusted size in the onMeasure method, and cache the adjusted width and height in local storage through SharePreference (a lightweight caching solution in Android system), so that the latest stored size parameters will continue to be used to display the corresponding view component when the device is booted up again.

[0093] At the same time, define the minimum size parameter threshold A, the first size parameter threshold B, and the maximum size parameter threshold C for the view component.

[0094] (2) Each view component has a corresponding specific area for responding to gesture scaling. Within this specific area, gesture operations are obtained using the method `Rect rect = new Rect(); View.getHitRect(rect)`. Specifically, the relevant properties of the touch event `MotionEvent` are: touch type `N_UP` (indicates release), touch x-coordinate `getX()`, touch y-coordinate `getY()`, and `getAction()`: `ACTION_DOWN` (indicates press), `ACTION_MOVE` (indicates drag), and `ACTIO` (indicates dragging). To add gesture interaction, set an `OnTouchListener` (touch listener event) for the view component `View` to listen for touch operations. If the touch is within the specific area, the component size can be adjusted proportionally based on the dragging gesture.

[0095] Taking the multimedia view component as an example, as Figure 7 shown, the process of adjusting the size of the view component from small to large is specifically described ( Figure 7 from left to right in), and its initial size is the minimum size parameter threshold A, showing the music envelope.

[0096] Obtain the touch operation corresponding to the multimedia view component a, process the gesture operation through the MotionEvent in the OnTouchListener callback. If the action of the MotionEvent is MotionEvent.ACTION_DOWN, the press logic is triggered to check whether the touch operation is within a specific area range; the following only describes the case where the touch is on the right side of the view component a:

[0097] If the action of the MotionEvent is MotionEvent.ACTION_MOVE, by comparing the x coordinate point M where the action is MotionEvent.ACTION_DOWN and the x coordinate point N where the action is MotionEvent.ACTION_MOVE, if M < N, it corresponds to the zoom-in operation, and if M > N, it corresponds to the zoom-out operation. Taking the implementation of the zoom-in function as an example, according to the gesture movement distance, define the original size of the view component a + the dragged x distance as the size zoom-in value to obtain the calculated size parameter, and set this size parameter into the LayouParam (the layout parameter of the component, including width and height) corresponding to the view component a to implement the adjustment of the size of the view component a. The implementation process of the zoom-out function is similar to the above, so it will not be elaborated here.

[0098] Enlarge the actual component size parameter of the multimedia view component a to the first size parameter threshold B, then trigger the generation of the TextView component b corresponding to the singer information in the multimedia view component a, establish the second touch listening event corresponding to the TextView component b, and add the TextView component b to the multimedia view component a, and then based on the second touch listening event corresponding to the TextView component b, monitor the first touch operation to trigger the adjustment of the size of the TextView component b.

[0099] Alternatively, by enlarging the actual component size parameter of the multimedia view component a to the first size parameter threshold B, a Text View component b corresponding to the singer information in the multimedia view component a is generated, a third touch listener event corresponding to the Text View component b is established, and the Text View component b is added to the multimedia view component a; a second preset touch response area corresponding to the Text View component b in the multimedia view component a is set, and then the second touch operation corresponding to the second preset touch response area is listened to and obtained based on the third touch listener event to trigger the adjustment of the size of the Text View component b.

[0100] The process of adjusting the size of the Text View component b based on gesture movement is similar to the process of adjusting the size of the view component a described above, so it will not be repeated here.

[0101] If the actual component size parameter of the multimedia view component a is enlarged to the maximum size parameter threshold C, then the size of the multimedia view component a will no longer be enlarged. The action of MotionEvent is MotionEvent.ACTION_UP to trigger the gesture end logic. The adjusted width and height are cached in local storage through SharePreference so that the multimedia view component a can continue to be displayed with the same size parameter the next time the device is booted.

[0102] like Figure 7 As shown below, the process of adjusting the size of the view component from large to small is explained in detail. Figure 7 (From right to left in the middle):

[0103] Assuming the initial size of multimedia view component a is the maximum size parameter threshold C, when the actual component size parameter of multimedia view component a is reduced to the first size parameter threshold B, the Text View component b corresponding to the singer information is deleted from multimedia view component a. When the actual component size parameter of multimedia view component a is further reduced to the minimum size parameter threshold A, the size of multimedia view component a is no longer reduced. The action of MotionEvent is MotionEvent.ACTION_UP, which triggers the gesture end logic. The adjusted width and height are cached in local storage through SharedPreferences so that multimedia view component a can continue to be displayed with the same size parameters on the next boot.

[0104] In addition, define the upper, lower, left, and right W px (W is a specific value) of the central area (x, y) of the view component as the response area for dragging, that is: when (x1, y1) where the action of OnTouchListener is MotionEvent.ACTION_DOWN satisfies (x - W) < x1 < (x + W) && (y - W) < y1 < (y + W), the dragging function of the view component is triggered. When the action of OnTouchListener is MotionEvent.ACTION_MOVE, the dragging operation of the view component is implemented through ObjectAnimator transYAnim = ObjectAnimator.ofFloat(component, "translationY", offset); when the action of OnTouchListener is MotionEvent.ACTION_UP, the dragging logic ends.

[0105] In this embodiment, the user can redefine the size of the view components on the desktop according to their own needs and adjust the arrangement of the view components on the desktop; the size of the view components can be adjusted within a certain size range, and the corresponding attribute parameters of the view components (such as text content) are also dynamically adjusted according to the size of the view components, so that the situation where the size of the view components becomes larger while the content remains unchanged, resulting in wasted space, will not occur. The user can customize the display style, home page elements, element positions, etc. of the display interface in the smart terminal, meeting the higher usage requirements of the user and greatly improving the user experience.

[0106] Embodiment 3

[0107] Figure 8 It is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the adjustment method of the view component in any one of Embodiments 1 or 2. Figure 8 The displayed electronic device 30 is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present invention.

[0108] As Figure 8 shown, the electronic device 30 can be presented in the form of a general computing device, for example, it can be a server device. The components of the electronic device 30 may include, but are not limited to: at least one of the above processors 31, at least one of the above memories 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0109] The bus 33 includes a data bus, an address bus, and a control bus.

[0110] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.

[0111] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0112] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the method for adjusting the view component in any of embodiments 1 or 2 of the present invention.

[0113] Electronic device 30 can also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 35. Furthermore, the model-generating device 30 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 36. Figure 8 As shown, network adapter 36 communicates with other modules of the model-generated device 30 via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0114] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0115] Example 4

[0116] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the adjustment method of the view component in any one of embodiments 1 or 2.

[0117] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0118] In a possible implementation, the present invention can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform steps in the adjustment method of the view component in any one of embodiments 1 or 2.

[0119] The program code for executing the present invention can be written using any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0120] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.

Claims

1. A method for adjusting a view component, characterized in that, The method includes the following steps: Set the first touch listener event for the view component; Based on the first touch listening event, listen for and obtain the first touch operation; Adjust the first component size of the view component according to the first touch operation; When the actual size parameter of the first component reaches the preset size parameter threshold, the layout parameters corresponding to the view component are set, and the view component is adjusted. The preset size parameter thresholds include a minimum size parameter threshold and a maximum size parameter threshold; The preset size parameter threshold includes a first size parameter threshold, which is greater than the minimum size parameter threshold and less than the maximum size parameter threshold. The step of setting the layout parameters corresponding to the view component and adjusting the view component when the actual size parameter of the first component reaches a preset size parameter threshold includes: When the actual size parameter of the first component is enlarged to the threshold of the first size parameter, the first component corresponding to the view component is generated; Establish a second touch listener event for the first component; Add the first component to the view component; Based on the second touch listening event, the first touch operation is listened for and obtained, and the size of the second component of the first component is adjusted according to the first touch operation; Wherein, the adjusted size of the second component of the first component is adapted to the size of the first component of the corresponding view component; When the actual size parameter of the first component of the view component is reduced to the first size parameter threshold, the first component is removed from the view component; or, The step of setting the layout parameters corresponding to the view component and adjusting the view component when the actual size parameter of the first component reaches a preset size parameter threshold includes: When the actual size parameter of the first component is enlarged to the threshold of the first size parameter, the first component corresponding to the view component is generated; Establish a third touch listener event for the first component; Add the first component to the view component; Set the second preset touch response area corresponding to the first component in the view component; Based on the third touch listening event, the second touch operation corresponding to the second preset touch response area is listened to and obtained, and the second component size of the first component is adjusted according to the second touch operation; Wherein, the adjusted size of the second component of the first component is adapted to the size of the first component of the corresponding view component; When the actual size parameter of the first component of the view component is reduced to the threshold of the first size parameter, the first component is removed from the view component.

2. The method for adjusting a view component as described in claim 1, wherein when the first touch operation corresponds to a first preset touch response area and is a long press or double-click operation, the step of adjusting the first component size of the view component according to the first touch operation includes: A pop-up window for inputting display size parameters is triggered based on the first touch operation; Based on the parameter input pop-up, obtain the component size input parameters and adjust the first component size of the view component.

3. The method for adjusting a view component as described in claim 1, wherein the step of adjusting the first component size of the view component according to the first touch operation includes: Obtain the gesture movement distance corresponding to the first touch operation; Based on the gesture movement distance, the scaling operation and corresponding scaling value performed on the view component are determined, and the first component size of the view component is adjusted.

4. The method for adjusting a view component as described in any one of claims 1-3, wherein the step of triggering the setting of layout parameters corresponding to the view component and adjusting the view component when the actual size parameter of the first component reaches a preset size parameter threshold includes: When the actual size parameter of the first component is reduced to the minimum size parameter threshold, the first component size of the view component is adjusted using the minimum size parameter threshold, and the minimum size parameter threshold is saved to fix the first component size of the view component. When the actual size parameter of the first component is enlarged to the maximum size parameter threshold, the first component size of the view component is adjusted using the maximum size parameter threshold, and the maximum size parameter threshold is saved to fix the first component size of the view component.

5. The method for adjusting a view component as described in claim 1, wherein when the first touch operation corresponds to a first preset touch response area and is a drag operation, the method further includes: Based on the drag path of the drag operation, obtain the first position information when the drag operation stops; Based on the first position information and the center position information corresponding to the view component, determine the movement parameters corresponding to the view component, and complete the drag operation of the view component; The movement parameters include the movement direction and the movement offset.

6. The method for adjusting a view component as described in any one of claims 1-3 and 5, wherein when the first touch operation corresponds to a first preset touch response area and is a long press operation, the method further includes: Move the different view components to a regular or irregular preset layout path.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes a computer program, it implements the adjustment method of the view component according to any one of claims 1-6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the adjustment method of the view component according to any one of claims 1-6.

Citation Information

Patent Citations

  • Tool bar adjusting method, device and equipment and computer readable storage medium

    CN112631475A

  • Method and apparatus for adjusting size of a list item

    US20130014042A1