Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present invention aims to provide a method and a system for dynamically scaling a card UI, a storage medium and a vehicle-mounted terminal, which can scale the card UI according to actual requirements, thereby achieving better visual effects.
To achieve the above and other related objects, the present invention provides a card type UI dynamic scaling method, comprising the steps of: acquiring an adjustment proportion value of the card; setting different zooming speeds for different UI elements in the card; and when the card moves, scaling the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card.
In an embodiment of the present invention, the adjustment ratio v=1+ (W/L) × (X/W) S, where W is the card width, L is the screen width, X is the left end position of the card, and S is the scaling factor.
In an embodiment of the present invention, the scaling factor is a preset value.
In an embodiment of the present invention, the zooming of the card based on the adjustment scale value and the zooming speed corresponding to different UI elements in the card includes the following steps:
traversing UI elements of the card, and acquiring the scaling speed of each UI element;
for each UI element, using Interpolator. GetInteraction (V) as the adjustment value for the UI element, V is the adjustment scale value for the card.
Correspondingly, the invention provides a card type UI dynamic scaling system based on a vehicle-mounted terminal, which comprises an acquisition module, a setting module and a scaling module;
the acquisition module is used for acquiring an adjustment proportion value of the card;
the setting module is used for setting different zooming speeds for different UI elements in the card;
and the scaling module is used for scaling the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card when the card moves.
In an embodiment of the present invention, the adjustment ratio v=1+ (W/L) × (X/W) S, where W is the card width, L is the screen width, X is the left end position of the card, and S is the scaling factor.
In an embodiment of the present invention, the scaling factor is a preset value.
In an embodiment of the present invention, the scaling module performs the scaling of the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card, and performs the following steps:
traversing UI elements of the card, and acquiring the scaling speed of each UI element;
for each UI element, using Interpolator. GetInteraction (V) as the adjustment value for the UI element, V is the adjustment scale value for the card.
The invention provides a storage medium, on which a computer program is stored, which when executed by a processor implements the card-type UI dynamic scaling method based on the vehicle-mounted terminal.
Finally, the present invention provides a vehicle-mounted terminal, including: a processor and a memory;
the memory is used for storing a computer program;
the processor is used for executing the computer program stored in the memory so that the vehicle-mounted terminal can execute the card-type UI dynamic scaling method based on the vehicle-mounted terminal.
As described above, the card UI dynamic scaling method and system, the storage medium and the vehicle-mounted terminal of the present invention have the following beneficial effects:
(1) When the card of the card type UI is far away from the screen at one side of the driver, UI elements on the card can be dynamically scaled, and different scaling speeds and scaling degrees are formulated for each UI element according to service requirements, so that the card type UI achieves a better visual effect;
(2) The user experience is greatly improved.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention.
It should be noted that, the illustrations provided in the present embodiment merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complex.
According to the card type UI dynamic scaling method and system, the storage medium and the vehicle-mounted terminal, UI elements on the card can be dynamically scaled, and different scaling speeds and scaling degrees are formulated for each UI element according to service requirements, so that a better visual effect of the card type UI is achieved, and user experience is greatly improved.
As shown in fig. 1, in an embodiment, the method for dynamic scaling of a card UI of the present invention includes the following steps:
and S1, acquiring an adjustment proportion value of the card.
Specifically, in order to set the adjustment degree of the card, an adjustment ratio value of the card needs to be obtained. In an embodiment of the present invention, the adjustment ratio v=1+ (W/L) × (X/W) S, where W is the card width, L is the screen width, X is the left end position of the card, and S is the scaling factor.
For example, the card width is set to 300, the screen width is 3000, and the zoom factor is 1. When the card moves to the far right, the left end position of the card is 2700, and the adjustment ratio value v=1+ (300/3000) × (2700/300) ×1=1+0.9=1.9 of the card. That is, the adjustment degree of the card is 1.9 times of that of the original base.
Preferably, the scaling factor S is preset data, and may be adjusted up or down according to service requirements.
Step S2, setting different zooming speeds for different UI elements in the card.
Specifically, the card sets different zoom accelerator objects for different UI elements inside according to the service requirement, that is, sets different zoom speeds. Based on the above-described setting, different UI elements have different zoom-in and zoom-out speeds, and the zoom speeds of all UI elements are not linearly uniform. Therefore, by setting, when the card is far away from the driver, the importance of different contents in the card, such as the music card, can be highlighted, and the image amplification speed of the album art is higher than that of the progress bar when the card is far away, so that the acquisition of the information of the music card is accelerated. And when the user is far away, the font amplification speed of the first few backlog is higher than that of the second few backlog, so that important information is seen preferentially, and the user experience is greatly improved.
And S3, when the card moves, scaling the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card.
Specifically, when the card moves, a card moving event and an adjustment proportion value are sent to the card based on the card container, so that the card is scaled based on the adjustment proportion value and scaling speeds corresponding to different UI elements in the card. That is, the card is dynamically scaled according to the preset adjustment degree and adjustment speed of the card, so that various viewing requirements are met, and the viewing requirements of a user are ensured.
In an embodiment of the present invention, the zooming of the card based on the adjustment scale value and the zooming speed corresponding to different UI elements in the card includes the following steps:
31 Traversing the UI elements of the card, and acquiring the zoom speed of each UI element;
32 For each UI element, using interstator. Getinterstator (V) as the adjustment value of the UI element, V being the adjustment scale value of the card.
As shown in fig. 2, in an embodiment, the card UI dynamic scaling system based on the vehicle-mounted terminal of the present invention includes an acquisition module 21, a setting module 22 and a scaling module 23.
The obtaining module 21 is configured to obtain an adjustment ratio value of the card.
Specifically, in order to set the adjustment degree of the card, an adjustment ratio value of the card needs to be obtained. In an embodiment of the present invention, the adjustment ratio v=1+ (W/L) × (X/W) S, where W is the card width, L is the screen width, X is the left end position of the card, and S is the scaling factor.
For example, the card width is set to 300, the screen width is 3000, and the zoom factor is 1. When the card moves to the far right, the left end position of the card is 2700, and the adjustment ratio value v=1+ (300/3000) × (2700/300) ×1=1+0.9=1.9 of the card. That is, the adjustment degree of the card is 1.9 times of that of the original base.
Preferably, the scaling factor S is preset data, and may be adjusted up or down according to service requirements.
The setting module 22 is connected to the obtaining module 21 for setting different zoom speeds for different UI elements in the card.
Specifically, the card sets different zoom accelerator objects for different UI elements inside according to the service requirement, that is, sets different zoom speeds. Based on the above-described setting, different UI elements have different zoom-in and zoom-out speeds, and the zoom speeds of all UI elements are not linearly uniform. Therefore, by setting, when the card is far away from the driver, the importance of different contents in the card, such as the music card, can be highlighted, and the image amplification speed of the album art is higher than that of the progress bar when the card is far away, so that the acquisition of the information of the music card is accelerated. And when the user is far away, the font amplification speed of the first few backlog is higher than that of the second few backlog, so that important information is seen preferentially, and the user experience is greatly improved.
The scaling module 23 is connected to the obtaining module 21 and the setting module 22, and is configured to scale the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card when the card moves.
Specifically, when the card moves, a card moving event and an adjustment proportion value are sent to the card based on the card container, so that the card is scaled based on the adjustment proportion value and scaling speeds corresponding to different UI elements in the card. That is, the card is dynamically scaled according to the preset adjustment degree and adjustment speed of the card, so that various viewing requirements are met, and the viewing requirements of a user are ensured.
In an embodiment of the present invention, the scaling module 23 performs the scaling of the card based on the adjustment scale value and the scaling speed corresponding to different UI elements in the card, and performs the following steps:
31 Traversing the UI elements of the card, and acquiring the zoom speed of each UI element;
32 For each UI element, using interstator. Getinterstator (V) as the adjustment value of the UI element, V being the adjustment scale value of the card.
It should be noted that, it should be understood that the division of the modules of the above system is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the x module may be a processing element that is set up separately, may be implemented in a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and the function of the x module may be called and executed by a processing element of the apparatus. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a module is implemented in the form of a processing element scheduler code, the processing element may be a general purpose processor, such as a Central Processing Unit (CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The storage medium of the present invention stores a computer program which, when executed by a processor, implements the card-type UI dynamic scaling method based on the vehicle-mounted terminal. Preferably, the storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
As shown in fig. 3, in an embodiment, the vehicle-mounted terminal of the present invention includes a processor 31 and a memory 32.
The memory 32 is used for storing a computer program.
The memory 32 includes: various media capable of storing program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
The processor 31 is connected to the memory 32, and is configured to execute a computer program stored in the memory 32, so that the vehicle-mounted terminal executes the card-type UI dynamic scaling method based on the vehicle-mounted terminal.
Preferably, the processor 31 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In summary, the card type UI dynamic scaling method and system, the storage medium and the vehicle-mounted terminal can dynamically scale the UI elements on the card when the card of the card type UI is far away from the screen on one side of the driver, and formulate different scaling speeds and scaling degrees for each UI element according to service requirements, so that the card type UI achieves better visual effect; the user experience is greatly improved. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. Accordingly, it is intended that all equivalent modifications and variations of the invention be covered by the claims, which are within the ordinary skill of the art, be within the spirit and scope of the present disclosure.