WO2022222931A1 - Graphical interface display method, electronic device, medium, and program product - Google Patents

Graphical interface display method, electronic device, medium, and program product Download PDF

Info

Publication number
WO2022222931A1
WO2022222931A1 PCT/CN2022/087751 CN2022087751W WO2022222931A1 WO 2022222931 A1 WO2022222931 A1 WO 2022222931A1 CN 2022087751 W CN2022087751 W CN 2022087751W WO 2022222931 A1 WO2022222931 A1 WO 2022222931A1
Authority
WO
WIPO (PCT)
Prior art keywords
elements
distance
animation
present disclosure
electronic device
Prior art date
Application number
PCT/CN2022/087751
Other languages
French (fr)
Chinese (zh)
Inventor
卞超
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022222931A1 publication Critical patent/WO2022222931A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites

Definitions

  • the present disclosure generally relates to the field of information technology, and more particularly, to a graphical interface display method, an electronic device, a computer-readable storage medium, and a computer program product.
  • a graphical interface display method, electronic device, medium, and program product are provided, which can strengthen the connection between animation effects of different UI elements, highlight the relationship between individual UI elements, and make UI
  • the animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
  • a graphical interface display method is provided.
  • M user interface UI elements are displayed on the screen of the electronic device, where M is a positive integer greater than 1.
  • a press on a first UI element of the M UI elements is detected.
  • each of the N UI elements on the screen is changed with a corresponding animation effect, where N is a positive integer between 1 and M-1.
  • Making the N UI elements change with corresponding animation effects includes: determining a distance between the first UI element and a second UI element among the N UI elements; and determining the second UI element based on the distance and the pressed position in the UI animating the change; and animating the second UI element to visually indicate the press.
  • the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted, so that the UI animation effects are more in line with the user's usage habits, thereby significantly improving the user experience.
  • a first reference point of the first UI element and a second reference point of the second UI element may be determined; and a distance between the first reference point and the second reference point may be determined as the distance.
  • the distance can be determined based on the determined reference point of the UI element, thereby improving the accuracy of the determined distance and the flexibility of the way of determining the distance, thereby improving the user experience.
  • a first reference point of the first UI element may be determined; from a plurality of circles having respective radii centered on the first reference point, the intersection with the second UI element and the radius is determined the smallest target circle; and determining the radius of the target circle as the distance.
  • the horizontal spacing between the first UI element and the second UI element can be determined; the vertical spacing between the first UI element and the second UI element can be determined; and based on any of the following: Determine distance: at least one of horizontal spacing and vertical spacing, or at least one of horizontal spacing and vertical spacing, and a direction from the second fiducial point of the second UI element to the first fiducial point of the first UI element.
  • Determine distance at least one of horizontal spacing and vertical spacing, or at least one of horizontal spacing and vertical spacing, and a direction from the second fiducial point of the second UI element to the first fiducial point of the first UI element.
  • the method may further include: determining an area of influence of the first UI element based on a size of the first UI element; and determining a UI element within the area of influence among the M UI elements as N UI elements. In this way, the UI element that changes in linkage with the UI element can be determined based on the size of the pressed UI element, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
  • the method may further include: determining M-1 UI elements other than the first UI element among the M UI elements as N UI elements. In this way, all the UI elements on the screen except the pressed UI elements can be linked and changed with the UI elements, so that the UI elements that are linked and changed can be determined more simply and conveniently, and the animation effect of the UI can be more in line with the user's usage habits, so that it is more obvious. Improve user experience.
  • the animation effect may include a rocker-like movement of the position visually relative to the position of the press, or a depression or protrusion visually relative to the position of the press. In this way, the animation effect of the UI element being pressed can be presented intuitively, so that the animation effect of the UI is more in line with the user's usage habits, thereby significantly improving the user experience.
  • the first magnitude of the change of the first UI element in response to the press may be determined; and the magnitude of the change of the second UI element in response to the press may be determined based on any of the following: A magnitude and a distance, or at least one of a size of the second UI element and a size of the first UI element, a first magnitude, and a distance.
  • the animation effect of the first UI element can be caused to be conducted to the second UI element, and further the animation effect of the second UI element can be caused to be based on the distance between the first UI element and the second UI element and the second UI element
  • the size of the UI can be determined, so that the animation effect of the UI can be more in line with the user's usage habits, thereby significantly improving the user experience.
  • the first magnitude of change of the first UI element may be determined based on at least one of the following associated with the first UI element: a size of the first UI element, a size of the first reference point of the first UI element The position, the range of the amplitude that the first UI element can change, the position of the pressing, the duration of the pressing, and the predetermined pressing force.
  • the first magnitude of the change of the first UI element can be determined intuitively, reasonably and flexibly based on various factors associated with the first UI element, thereby making the animation effect of the UI more in line with the user's usage habits , thereby significantly improving the user experience.
  • changing the second UI element may include: determining a delay time based on the distance; and changing the second UI element in response to the delay time elapsed after the pressing occurs. In this way, it is possible to visually show that the linkage change propagates with the distance, so that the animation effect of the UI is more in line with the user's usage habits, thereby significantly improving the user experience.
  • causing the second UI element to change may include determining a speed at which the second UI element changes in response to the press based on a predefined curve of magnitude versus time. In this way, the change of the first UI element can be conveniently controlled based on a predefined curve whose amplitude varies with time, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
  • the predefined curve may be a Bezier curve or an elastic force curve.
  • the change of the first UI element can be conveniently controlled based on the Bezier curve or the elastic force curve, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
  • the method may further include: restoring the changed second UI element to the second UI element.
  • the UI element can be restored after being released, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
  • the method may be implemented by at least one of an AAR format file, a JAR format file, and a system interface. In this way, a graphical interface display with linked changes can be realized simply and conveniently.
  • an electronic device in a second aspect of the present disclosure, includes a processor and a memory storing instructions, wherein the instructions, when executed by the processor, cause the electronic device to perform any of the methods according to the first aspect and implementations thereof.
  • a computer-readable storage medium stores instructions, wherein the instructions, when executed by a processor, cause an electronic device to perform any of the methods according to the first aspect and implementations thereof.
  • a computer program product comprises instructions, wherein the instructions, when executed by a processor, cause an electronic device to perform any of the methods according to the first aspect and implementations thereof.
  • FIG. 1A to 1B show schematic diagrams of the hardware structure and the software structure of an electronic device that can implement embodiments of the present disclosure.
  • FIG. 2 shows a block diagram of another electronic device that may implement embodiments of the present disclosure.
  • 3A-3C respectively illustrate schematic diagrams of example UIs according to some embodiments of the present disclosure.
  • FIG. 4 shows a schematic diagram of an example drag linkage in accordance with some embodiments of the present disclosure.
  • 5A and 5B show schematic diagrams, respectively, of an example velocity time curve and an example displacement time curve of a friction model according to some embodiments of the present disclosure.
  • FIG. 6 shows a schematic diagram of examples of restricted and non-restricted mobile locations in accordance with some embodiments of the present disclosure.
  • FIGS. 7A-7C show schematic diagrams of examples of curves of spring deflection x versus time t for critically damped, under-damped, and over-damped states, respectively, according to some embodiments of the present disclosure.
  • FIG. 8 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
  • FIG. 9 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
  • FIG. 10 shows a schematic diagram of an example of the determination of a distance according to an embodiment of the present disclosure.
  • FIGS. 11A-11C illustrate schematic diagrams of examples of distance determinations according to embodiments of the present disclosure.
  • FIG. 12 shows a schematic diagram of an example of distance determination according to an embodiment of the present disclosure.
  • FIG. 13 shows a schematic diagram of an example of the determination of distance according to an embodiment of the present disclosure.
  • FIG. 14A and 14B illustrate schematic diagrams of examples of distance determination according to embodiments of the present disclosure.
  • FIG. 15 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
  • 16A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
  • 16B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with a hand according to an embodiment of the present disclosure.
  • 17A shows a schematic diagram of an example of a scenario in which UI elements do not completely follow the hand, according to an embodiment of the present disclosure.
  • 17B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element does not completely move with the hand, according to an embodiment of the present disclosure.
  • FIG. 18A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
  • 18B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with a hand according to an embodiment of the present disclosure.
  • 19A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
  • 19B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
  • FIG. 20 shows a schematic diagram of an example of a UI element changing when pressed, according to some embodiments of the present disclosure.
  • 21 shows a schematic diagram of an example of a UI element changing when pressed at different locations, according to some embodiments of the present disclosure.
  • FIG. 22 shows a schematic diagram of an example of UI element changes at different pressing forces according to some embodiments of the present disclosure.
  • FIG. 23 shows a schematic diagram of an example of UI element changes at different press durations, according to some embodiments of the present disclosure.
  • FIG. 24 shows a schematic diagram of an example of UI elements changing at different sizes, according to some embodiments of the present disclosure.
  • FIG. 25 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
  • FIG. 26 shows a schematic diagram of an example of deep linkage of N UI elements according to an embodiment of the present disclosure.
  • FIG. 27 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
  • FIG. 28 shows a schematic diagram of an example of distance-based scaling of UI elements, according to an embodiment of the present disclosure.
  • FIG. 29 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
  • FIG. 30 shows a schematic diagram of an example of scaling of UI elements with a delay time in accordance with the present disclosure.
  • 31 shows a schematic diagram of an example of displacement of movement of UI elements according to an embodiment of the present disclosure.
  • 32A-32B illustrate schematic diagrams of examples of restoration of UI elements without displacement and restoration of UI elements with displacement, respectively, according to embodiments of the present disclosure.
  • FIGS. 33A-33B respectively show schematic diagrams of an example of a restored size time curve and a displacement time curve of a UI element with a springback effect according to an embodiment of the present disclosure
  • FIGS. 33C-33D respectively show a A schematic diagram of an example of the restored size time curve and displacement time curve of a UI element with the rebound effect of multiple rebounds with reduced rebound amplitudes of an embodiment.
  • FIG. 34 shows a schematic diagram of an example of a UI element that is a rigid body changing when pressed, according to some embodiments of the present disclosure.
  • 35 shows a schematic diagram of an example of pressing and stretching of a spring that simulates pressing of a UI element, according to some embodiments of the present disclosure.
  • 36 shows a schematic diagram of an example of a UI element that is a non-rigid body when pressed, according to some embodiments of the present disclosure.
  • Figure 37 shows a schematic diagram of an example of UI element changes at different pressing forces, according to some embodiments of the present disclosure.
  • FIG. 38 shows a schematic diagram of an example of UI element changes at different press durations, according to some embodiments of the present disclosure.
  • 39 shows a schematic diagram of an example of UI elements changing at different sizes in accordance with some embodiments of the present disclosure.
  • FIG. 40 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
  • 41 shows a schematic diagram of an example of pressure linkage of N UI elements according to an embodiment of the present disclosure.
  • FIG 43 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
  • 44 shows a schematic diagram of an example of a distance-based UI element change according to an embodiment of the present disclosure.
  • FIG. 45 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
  • 46A shows a schematic diagram of an example of restoration of UI elements according to an embodiment of the present disclosure.
  • 46B shows a schematic diagram of an example of an angle-time curve of recovery of a UI element with a bouncing effect, according to an embodiment of the present disclosure.
  • 46C shows a schematic diagram of an example of an angle-time curve of recovery of a UI element with a rebound effect of multiple rebounds with reduced rebound amplitudes, according to an embodiment of the present disclosure.
  • FIG. 47 shows a schematic diagram of animation implementation according to an embodiment of the present disclosure.
  • Figure 48 shows a schematic diagram of a system framework for implementing "linkage” animation effect capabilities or functions according to an embodiment of the present disclosure.
  • FIG. 49 shows a schematic diagram of the relationship between the application side and the UI framework side involved in the "linkage" animation effect capability or function according to an embodiment of the present disclosure.
  • FIG. 50 shows a schematic diagram of a specific description of three ways of implementing the “linkage” animation effect capability or function according to an embodiment of the present disclosure.
  • the term “including” and variations thereof mean open-ended inclusion, ie, “including but not limited to”.
  • the term “or” means “and/or” unless specifically stated otherwise.
  • the term “based on” means “based at least in part on”.
  • the terms “embodiments” and “some embodiments” mean “at least some embodiments.”
  • the terms “first”, “second”, etc. are used for description to distinguish different objects, etc., and do not represent the order of precedence, nor do they limit the "first” and “second” to be different types.
  • the term "UI” refers to the interface through which the user interacts with the application or operating system and exchanges information, which enables the conversion between the internal form of the information and the form acceptable to the user.
  • the UI of an application is source code written in a specific computer language such as java, extensible markup language (XML), etc.
  • the UI source code is parsed and rendered on the electronic device, and finally presented as content that the user can recognize , such as images, text, buttons and other UI elements.
  • the attributes and content of UI elements in the UI are defined by tags or nodes.
  • the UI elements contained in the UI are specified by nodes such as ⁇ Textview>, ⁇ ImgView>, and ⁇ VideoView>.
  • a node corresponds to a UI element or attribute in the UI. After parsing and rendering, the node is presented as user-visible content.
  • many applications, such as hybrid applications often contain web pages in their UI.
  • a web page can be understood as a special UI element embedded in the UI of an application.
  • a web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (cascading style sheets) , CSS), java script (JavaScript, JS), etc.
  • the web page source code can be loaded and displayed as user-identifiable content by a browser or a web page display component similar in function to a browser.
  • the specific content contained in a web page is also defined by tags or nodes in the source code of the web page. For example, HTML defines the elements and attributes of web pages through ⁇ p>, ⁇ img>, ⁇ video>, and ⁇ canvas>.
  • UI element includes, but is not limited to: window, scrollbar, tableview, button, menu bar, text box , Navigation bar, toolbar (toolbar), image (image), static text (tatictext), widget (Widget) and other visual UI elements.
  • animations are essentially real-time display of user interface UI or UI elements based on refresh rate. Due to the human vision persistence principle, the user feels that the picture is moving.
  • the animation transitions from the initial state of the animation to the final state of the animation after the animation time has elapsed.
  • the animation can be controlled by the animation type and animation transformation form.
  • animation types may include displacement animations, rotation animations, scale animations, and transparency animations, among others.
  • the animation transformation form can be controlled by controllers such as interpolators and estimators. Such a controller can be used to control the speed at which the animation is transformed during animation time.
  • animation is only a combination of simple animation effects, which makes the animation effect single, does not conform to the laws of physics, and does not consider real usage scenarios and user usage habits.
  • an embodiment of the present disclosure proposes a new solution for displaying a graphical interface.
  • the embodiments of the present disclosure relate to the linkage of UI elements in the UI on animation effects, including drag linkage, depth linkage, and pressure linkage.
  • the manipulated target UI element can affect other UI elements that are not manipulated.
  • triggering the animation effect of the target UI element may jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI.
  • the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
  • FIG. 1A shows a schematic diagram of a hardware structure of an electronic device 100 that can implement embodiments of the present disclosure.
  • the electronic device 100 may include a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charging management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193 , a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structures shown in the embodiments of the present disclosure do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown, or combine some components, or separate some components, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 can couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing, and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • the GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present disclosure is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , the electronic device 100 can also be powered by the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G/6G etc. applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 may provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), 5G and subsequent evolution standards, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA broadband Code Division Multiple Access
  • TD-SCDMA Time Division Code Division Multiple Access
  • LTE Long Term Evolution
  • 5G and subsequent evolution standards BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc.
  • GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi- zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • the camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point, and the like.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs.
  • the electronic device 100 can play or record videos of various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save files such as music, video, etc. in an external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 employs an eSIM, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present disclosure take a mobile operating system with a layered architecture as an example to illustrate the software structure of the electronic device 100 as an example.
  • FIG. 1B is a schematic diagram of a software structure of the electronic device 100 according to an embodiment of the present disclosure.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the operating system may be divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an operating system runtime and system library, and a kernel layer.
  • the application layer can include a series of application packages. As shown in FIG. 1B , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
  • a window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, and the like.
  • the view system includes visual controls, such as controls that display text, controls that display images, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface that includes an icon for an SMS notification may include a view for displaying text and a view for displaying images.
  • the phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, images, layout files, video files, etc.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
  • the operating system runtime includes core libraries and virtual machines.
  • the operating system runtime is responsible for the scheduling and management of the operating system.
  • the core library consists of two parts, one is the function functions that the Java language needs to call, and the other is the core library of the operating system.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the Java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example, surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg OpenGL ES), 2D graphics engine (eg: SGL) and so on.
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • FIG. 2 shows a block diagram of another electronic device 200 in which embodiments of the present disclosure may be implemented.
  • electronic device 200 may be in the form of a general-purpose computing device.
  • Components of electronic device 200 may include, but are not limited to, one or more processors or processing units 210, memory 220, storage devices 230, one or more communication units 240, one or more input devices 250, and one or more output devices 260.
  • the processing unit 210 may be an actual or virtual processor and can perform various processes according to programs stored in the memory 220 . In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to increase the parallel processing capability of the electronic device 200 .
  • Electronic device 200 typically includes multiple computer storage media. Such media can be any available media that can be accessed by electronic device 200, including but not limited to volatile and nonvolatile media, removable and non-removable media.
  • Memory 220 may be volatile memory (eg, registers, cache, random access memory (RAM)), non-volatile memory (eg, read only memory (ROM), electrically erasable programmable read only memory (EEPROM) , Flash) or some combination of them.
  • Storage device 230 may be removable or non-removable media, and may include machine-readable media, such as flash drives, magnetic disks, or any other media that may be capable of storing information and/or data (eg, training data for training). ) and can be accessed within the electronic device 200.
  • the electronic device 200 may further include additional removable/non-removable, volatile/non-volatile storage media.
  • disk drives may be provided for reading or writing from removable, non-volatile magnetic disks (eg, "floppy disks") and for reading or writing from removable, non-volatile optical disks CD-ROM drive for reading or writing.
  • each drive may be connected to a bus (not shown) by one or more data media interfaces.
  • the memory 220 may include a computer program product 225 having one or more program modules configured to perform the object editing methods or processes of embodiments of the present disclosure.
  • the communication unit 240 enables communication with other computing devices through a communication medium. Additionally, the functions of the components of the electronic device 200 may be implemented in a single computing cluster or multiple computing machines capable of communicating through a communication link. Accordingly, electronic device 200 may operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
  • PCs network personal computers
  • Input device 250 may be one or more input devices, such as a mouse, keyboard, trackball, and the like.
  • Output device 260 may be one or more output devices, such as a display, speakers, printer, and the like.
  • the output device 260 may include a touch screen with a touch sensor, which may receive a user's touch input.
  • the electronic device 200 may also communicate with one or more external devices (not shown) through the communication unit 240 as needed, such as a storage device, a display device, etc., with one or more devices that allow a user to interact with the electronic device 200 communicate, or with any device (eg, network card, modem, etc.) that enables electronic device 200 to communicate with one or more other computing devices. Such communication may be performed via an input/output (I/O) interface (not shown).
  • I/O input/output
  • the electronic device 100 shown in FIG. 1 and the electronic device 200 shown in FIG. 2 above are merely two example electronic devices capable of implementing one or more embodiments of the present disclosure, and should not constitute a any limitations on the functionality and scope of the described embodiments.
  • the embodiments of the present disclosure relate to the linkage of animation effects of UI elements in the UI when dragging, which is also referred to as drag linkage.
  • the dragged target UI element can affect other UI elements that are not dragged.
  • triggering the animation effect of the target UI element may jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI.
  • other UI elements can also move with a corresponding animation effect, thereby visually presenting the linkage drag.
  • the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
  • drag linkage will be described below with reference to FIGS. 3A-19B .
  • UI elements may have irregular sizes and shapes.
  • UI 300A may include multiple UI elements, such as UI elements 1-13, where UI elements 1, 2, 4, and 5 have different sizes and shapes.
  • the UI may also have irregular parts.
  • FIG. 3B the right side of UI elements 16 and 18 in UI 300B is vacant, that is, there is no UI element.
  • the embodiments of the present disclosure are equally applicable to regular layouts, sizes and shapes.
  • UI 300C has a regular layout, and UI elements 25-40 in UI 300C all have the same size and shape. It should be understood that the embodiments of the present disclosure are applicable to any suitable regular or irregular layout, size and shape.
  • UI elements in the UI can be dragged.
  • the user may drag the UI element when the user desires to move the UI element.
  • a user may drag a UI element when the user desires to change the position of the UI element in the UI, merge the UI element with another UI element, put the UI element into a toolbar or trash, or the like.
  • the UI element can be moved with an animation effect to visually present the drag action.
  • the dragged target UI element can affect other UI elements that are not dragged.
  • other UI elements can also move with a corresponding animation effect, thereby visually presenting a linked drag.
  • FIG. 4 shows a schematic diagram of an example drag linkage 400 in accordance with some embodiments of the present disclosure.
  • UI element 3 may move with an animation effect to visually present the drag action.
  • other UI elements 2 and 4 can also move with a corresponding animation effect, thereby visually presenting a linked drag.
  • Figure 4 only shows the coordinated movement of UI elements 2-3. It should be understood that linked movement can occur at any at least two UI elements in any UI, for example, at any at least two UI elements in UIs 300A-300C.
  • a drag at UI element 3 is detected at time T01, causing UI element 3 and other UI elements 2 and 4 to move.
  • the distance between UI element 3 and UI element 4 located in the dragging direction becomes smaller.
  • Spacing may represent the distance between corresponding reference points of two UI elements.
  • the center point of the UI element may be determined as the fiducial point of the UI element.
  • the spacing may represent the distance between adjacent boundaries of two UI elements.
  • UI element 3 may even cover at least a portion of UI element 4 .
  • the distance between UI element 3 and UI element 2 located in the opposite direction of the dragging direction becomes larger.
  • UI element 3 is moving faster than UI elements 2 and 4.
  • the distance between UI element 3 and UI element 4 located in the drag direction becomes larger, and the distance from UI element 2 located in the opposite direction to the drag direction becomes smaller.
  • UI element 3 moves at a lower speed than UI elements 2 and 4.
  • UI element 3 and other elements 2 and 4 move to a predetermined distance, thereby stopping the movement.
  • the predetermined distance may be determined based on a friction force model.
  • the manner of determining the distance based on the friction force model will be described in detail, and thus the description thereof is omitted here.
  • Movement of UI elements may be controlled by friction factors, linkage factors, catch-hand factors, catch-hand ratio factors, release rebound factors, and/or inertial rebound factors.
  • the friction factor can control UI elements to stop moving.
  • Linkage factors can control the animation of other UI elements.
  • the follow factor can control the follow movement of UI elements, such as the follow movement of UI elements when dragging without crossing the boundary.
  • the follow-to-hand ratio factor can control the ratio of the follow-hand movement of the UI element, such as the ratio of the UI element's displacement to the hand's displacement when dragging after crossing the bounds.
  • the release rebound factor can control the reset of UI elements after letting go, for example, the reset of UI elements after dragging and letting go.
  • the inertial rebound factor can control the rebound of UI elements after crossing the boundary. For example, friction factors may not stop the UI element from moving when it moves out of bounds. In this case, the inertial springback factor can control the springback of UI elements after they cross the bounds.
  • the friction force model associated with the friction force factor and the elastic force model associated with the linkage factor will be described in detail.
  • the friction model can be used to determine the distance that the UI element will move, thereby determining the source and destination locations of the UI element's movement.
  • the spring parameters of other UI elements that are moved in linkage can be determined based on the spring parameters (eg, elasticity coefficient, damping coefficient) of the dragged UI element, using a conduction method that will be described in detail below, so that the dragged UI can
  • each UI element is controlled to move according to the elastic force model based on the respective spring parameters of each UI element.
  • the friction model can be used to determine how far a UI element will move, such as how far a UI element will move after letting go or slipping. This distance can be determined by equations (1) and (2) as follows:
  • f friction is the friction force, which is configurable by the electronic device or user
  • t is the moving time
  • V 0 is the initial velocity, which is configurable by the electronic device or the user, or obtained by detecting the speed of the user's dragging
  • V(t) represents the final velocity, since the movement of the UI element will eventually stop, so V(t) is 0
  • e represents the natural constant
  • S(t) represents the distance the UI element will move.
  • the time t of the movement can be determined by equation (1).
  • the distance S(t) can be further determined by equation (2).
  • various parameters in the equation eg, friction, initial velocity, etc.
  • 5A and 5B show schematic diagrams of an example velocity time curve 500A and an example displacement time curve 500B, respectively, of a friction force model according to some embodiments of the present disclosure.
  • the moving speed of the UI element decreases to 0 with time, and the moving distance of the UI element increases with time until the movement stops.
  • the positions to which UI elements can be moved are not limited.
  • the distance determined based on the friction model is the distance the UI element will move.
  • the positions to which UI elements can be moved are limited.
  • UI elements can only be moved to predetermined positions.
  • the distance that the UI element will move can be determined based on the friction force model, if the UI element is not located at the predetermined position after moving the distance, the distance that the UI element will move needs to be adjusted so that the UI Elements can be moved to predetermined positions.
  • the UI element can be moved to a predetermined position closest to the stop position determined based on the friction model.
  • the distance that the UI element is to be moved can be jointly determined based on both the friction model and the predetermined position.
  • FIG. 6 shows a schematic diagram of an example 600 of restricted and unrestricted mobile locations in accordance with some embodiments of the present disclosure.
  • the UI element can only be moved from the source position 620 on the screen 610 to the predetermined position 630 .
  • UI elements can be moved from source position 620 on screen 610 to any position 640 without limitation to the position to which the UI element can be moved.
  • the moving range of the UI element may also be limited. UI elements that move beyond this range will be considered out of bounds.
  • the range can be any suitable range.
  • the range may be a distance from the screen boundary that is less than a predetermined proportion of the screen size or a range of predetermined pixels (such as 10% or 1000 pixels), or the distance from the source location of the UI element to the destination location is less than a predetermined proportion of the screen size. or a range of predetermined pixels (such as 50% or 10000 pixels).
  • the distance that the UI element is to be moved can also be determined based on the range.
  • the friction force model is described in detail above, and the elastic force model is further described below.
  • the displacement versus time curve of the movement of the UI element may be an elastic force curve conforming to an elastic force model. Since displacement and time can determine velocity, the velocity of UI elements' movement also follows the elastic force model. For this reason, it can be considered that the movement of UI elements can simulate the motion law of springs. It should be understood that, in order to describe the elastic force model here, a curve of the displacement of the UI element moving with time is described as an elastic force curve. However, the displacement versus time curve of the movement of the UI element may also be any suitable predefined curve, such as a Bezier curve.
  • the elastic force model can be based on the damped vibration equations (3) and (4) under Hooke's law:
  • f represents the force on the spring during vibration (ie, moving), which can be electronically or user-configurable
  • a represents the acceleration of the movement
  • t represents the time of movement
  • k represents the spring coefficient of the spring
  • x represents the spring
  • g represents the damping coefficient of the spring;
  • m represents the mass of the UI element, where the size of the UI element can be equivalent to the mass of the UI element.
  • the coefficient of elasticity is the amount of force required for a unit of deformation of the spring.
  • the elasticity coefficient k is electronically or user configurable.
  • the value range of the elastic coefficient k may be 1-999, and the suggested value range of the elastic coefficient k may be 150-400.
  • the damping coefficient is a quantitative representation of the damping force (such as fluid resistance, friction, etc.) of the spring during the vibration process.
  • the above damping force can gradually reduce the amplitude of the spring until it stops at the equilibrium position.
  • the damping coefficient g is electronically or user configurable. In some embodiments, the value range of the damping coefficient g may be 1-99.
  • the distance S(t) that the UI element is to be moved can be determined based on the friction force model, as described above.
  • S(t) can be regarded as the amount of deformation of the spring. Therefore, S(t) is equal to x.
  • the elastic force model has three damping states, namely critical damping state, under damping state and over damping state.
  • the critical damping conforms to the following equation (5):
  • g is the damping coefficient of the spring
  • m is the size of the UI element
  • k is the spring's elastic coefficient
  • FIGS. 7A-7C show schematic diagrams of examples of plots 700A-700C of spring deflection amount x versus time t for a critically damped state, an under-damped state, and an over-damped state, respectively, according to some embodiments of the present disclosure.
  • Fig. 7A in the critical damping state, the spring stops moving after returning to the equilibrium position with the smoothest speed and the shortest time, and no longer oscillates.
  • Fig. 7B in the under-damped state, the spring slowly reduces the amplitude gradually through multiple oscillations, and finally returns to the equilibrium position.
  • Fig. 7C in the overdamped state, the spring hardly vibrates, and the amplitude gradually decreases, reaching the equilibrium position.
  • the displacement versus time curve of the movement of the UI element may be an elastic force curve conforming to an elastic force model. Therefore, it can be considered that the movement of the UI element can simulate the motion law of the spring, that is, the change law of the displacement of the UI element can simulate the change law of the spring deformation.
  • the damping coefficient and/or the elastic coefficient the change law of the displacement of the UI element can be adjusted, so that the UI element simulates the motion law of the spring in a critical damping state, over damping or under damping state.
  • the spring parameters of other UI elements that are moved in linkage can be determined based on the spring parameters (such as elasticity coefficient, damping coefficient) of the dragged UI element, using a conduction method that will be described in detail below, so as to During the movement of the dragged UI element and the UI element that is moved in linkage, each UI element is controlled to move according to the elastic force model based on its respective spring parameters.
  • the dragged UI elements and the UI elements that are moved in linkage can simulate the motion law of springs with different spring parameters, so that the interval between UI elements in the drag direction decreases first and then recovers (similar to a spring First compress and then restore), and the interval between UI elements in the opposite direction of the dragging direction first increases and then restores (similar to the animation effect of a spring stretching and then restoring), which increases the dynamic feedback to the user's dragging action.
  • the animation effect of a UI element that is moved in linkage is determined based on the animation effect of the dragged UI element moving and the distance between the dragged UI element and the UI element that is moved in linkage. Since the animation effect of the UI element moving in linkage changes with the distance, it can also be considered that the animation effect of its movement is conducted with the distance.
  • the conduction may be non-linear conduction. Alternatively, the conduction can also be linear conduction.
  • the animation effect of the movement of UI elements that move in conjunction can be determined by the following equation (6):
  • x n represents the animation effect of the UI element moving in linkage
  • x represents the animation effect of the UI element being dragged
  • n represents the distance between the UI element being dragged and the UI element that is moved in linkage
  • g represents the conduction coefficient , when the conduction coefficient is 0, the animation effect of the UI element moving in linkage is the same as the animation effect of the UI element being dragged
  • the constant in equation (6) is only an example, which is configurable by the electronic device or user of.
  • the animation effect of the movement may be controlled by a damping coefficient and/or an elastic coefficient.
  • x may be determined based on at least one of a damping coefficient and a spring coefficient.
  • x can be the ratio of the elastic coefficient to the damping coefficient of the UI element being dragged.
  • the ratio of the elastic coefficient to the damping coefficient of the dragged UI element is transmitted to the UI element that moves in conjunction with the distance n, thereby obtaining the ratio x n of the elastic coefficient to the damping coefficient of the UI element that moves in conjunction.
  • the animation effect of the dragged UI element moving can be transferred to the UI element that is moved in conjunction based on the distance.
  • the larger the ratio of elastic coefficient to damping coefficient the weaker the correlation between the movement of UI elements, the greater the difference in spring characteristics and movement between UI elements, which can be considered as "softer" springs.
  • the smaller the ratio of the elastic coefficient to the damping coefficient the stronger the correlation between the movement of UI elements, and the smaller the difference in spring characteristics and movement between UI elements, which can be considered as a “harder” spring.
  • the ratio of the elastic coefficient to the damping coefficient of the UI element being dragged by x is merely an example.
  • x can be any suitable factor.
  • x may be the elasticity coefficient of the UI element being dragged.
  • x may also be the damping coefficient of the UI element being dragged.
  • the animation effect of UI element movement may follow any suitable predetermined curve, such as a Bezier curve.
  • the Bezier curve may have control points corresponding to the order.
  • the Bezier curve can have two control points.
  • the Bezier curve can have one control point
  • the Bezier curve can have three control points, and so on .
  • the animation effect of the movement can be controlled by the coordinates of at least one of at least one control point of the Bezier curve.
  • the animation of the movement can be controlled by one or both of the two control points of the second-order bezier curve.
  • x may be determined based on the coordinates of at least one of the at least one control point.
  • x n represents the animation effect of the UI element moving in linkage
  • x represents the animation effect of the UI element being dragged
  • n represents the distance between the UI element being dragged and the UI element that is moved in linkage
  • g represents the conduction coefficient , when the conduction coefficient is 0, the animation effect of the UI element moving in linkage is the same as the animation effect of the UI element being dragged.
  • the animation effect of the movement can be controlled by a damping coefficient and/or an elastic coefficient.
  • x may be determined based on at least one of a damping coefficient and a spring coefficient.
  • the animation effect of the movement can be controlled by the coordinates of at least one of at least one control point of the Bezier curve.
  • x may be determined based on the coordinates of at least one of the at least one control point.
  • FIG. 8 shows a flowchart of a graphical interface display method 800 according to an embodiment of the present disclosure. It should be understood that the method 800 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 800 is described herein with reference to UI 300A of Figure 3A. It should be understood, however, that UI 300A is merely an example, and method 800 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
  • the M user interface UI elements are displayed on the screen of the electronic device.
  • M is a positive integer greater than 1.
  • the M UI elements may be UI elements 1 to 13 .
  • a drag at a first UI element of the M UI elements is detected.
  • the first UI element may be UI element 5 .
  • the drag on the first UI element will cause the first UI element to move with an animation effect to present the drag effect.
  • each of the N UI elements on the screen is moved with a corresponding animation effect.
  • N is a positive integer between 1 and M-1.
  • the drag linkage can act on all UI elements on the screen.
  • M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements.
  • the drag linkage may only act on some UI elements on the screen.
  • the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein.
  • the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
  • UI elements that intersect the area of influence may be considered to be within the area of influence.
  • the area of influence is a circle with a predetermined radius
  • the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
  • FIG. 9 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
  • UI elements 3 , 4 , 7 , and 8 are within the influence area 910 of UI element 5 , UI elements 3 , 4 , 7 , and 8 will move in conjunction with UI element 5 .
  • UI elements 1, 2, 6, 9-13 are not within the influence area 910 of UI element 5, UI elements 1, 2, 6, 9-13 will not move in conjunction with UI element 5.
  • the distance between the first UI element and each of the N UI elements may be determined.
  • how to determine the distance between the first UI element and the second UI element among the N UI elements will be described.
  • the distances may be divided into a plurality of distance classes according to the range in which the distances lie.
  • the operated UI element itself may be at distance level 0
  • the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element...
  • UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage.
  • the distance itself may also be used, thereby allowing UI elements to be more precisely linked.
  • distance classes are referred to interchangeably as distances.
  • FIG. 10 shows a schematic diagram of an example 1000 of distance determination according to an embodiment of the present disclosure.
  • a first fiducial point for a first UI element eg, UI element 5
  • a second fiducial point for a second UI element eg, UI element 2
  • the reference point of each UI element is indicated by "+”.
  • the center point of the UI element may be determined as the fiducial point of the UI element.
  • the fiducial point of the UI element may be electronically or user-configurable, so that the location of the fiducial point may be any suitable location, and the present disclosure is not limited herein.
  • the distance between the first reference point and the second reference point can be determined as the distance between the first UI element and the second UI element.
  • the distance can be determined by the following equation (8):
  • n represents the distance
  • x0 represents the abscissa of the first reference point
  • y0 represents the ordinate of the first reference point
  • x1 represents the abscissa of the second reference point
  • y1 represents the ordinate of the second reference point.
  • the distances between UI element 5 and other UI elements determined in the above manner are as follows: the distance between UI element 5 and itself is 0, the distance between UI element 5 and UI elements 3, 7, and 8 is 1, and the distance between UI element 5 and itself is 0. The distance between UI elements 2, 4, 6, 9 is 2, and the distance from UI elements 1, 10-13 is 3.
  • FIG. 11A-11C show schematic diagrams of examples 1100A-1100C of distance determination according to embodiments of the present disclosure.
  • a first reference point for the first UI element may be determined.
  • a plurality of circles having respective radii, such as circles 1110A-1130A, may be determined from the first reference point as the center of the circle. It should be understood that, in addition to a circle, any other suitable shapes with respective sizes can also be determined with the first reference point as the center, such as rectangles, diamonds, etc., and the present disclosure is not limited herein.
  • a first reference point for the first UI element may be determined.
  • a plurality of rectangles having respective dimensions, eg, rectangles 1110B-1120B, may be determined from the first reference point as the center.
  • a first reference point for the first UI element may be determined.
  • a plurality of diamonds having respective dimensions, such as rectangles 1110C-1140C, may be determined from the first reference point as the center.
  • the radii of the plurality of circles may increase by a predetermined size or ratio.
  • the radii of the plurality of circles may be electronically or user configurable, and the present disclosure is not limited herein.
  • the circle intersecting the second UI element can be determined. From this, the radius of the intersecting circles can be determined as the distance. In some embodiments, if there is more than one circle that intersects the second UI element, from these circles, a target circle that intersects the second UI element and has the smallest radius can be determined. Further, in some embodiments, if no circle intersects the second UI element, the circle closest to the second UI element may be used as the target circle, whereby the radius of the target circle may be determined as the distance.
  • the distance between UI element 5 and other UI elements determined in the above manner is as follows: the distance between UI element 5 and itself is 0. Since the circle with the smallest radius that intersects UI elements 3, 4, 7, 8 is circle 1110, the distance between UI elements 3, 4, 7, 8 and UI element 5 is 1. Since circle 1120 intersects UI elements 2, 6, 9, the distance between UI elements 2, 6, 9 and UI element 5 is 2. Also, since circle 1130 intersects UI elements 1, 10-13, the distance between UI elements 1, 10-13 is 3.
  • FIG. 12 shows a schematic diagram of an example 1200 of distance determination according to an embodiment of the present disclosure.
  • the horizontal spacing between the first UI element and the second UI element may be determined, and/or the vertical spacing between the first UI element and the second UI element may be determined.
  • the lateral spacing may represent the sum of the lengths of one or more lateral spacings between the first UI element and the second UI element.
  • Horizontal spacing may represent the spacing between the vertical boundaries of two UI elements on the screen.
  • vertical spacing may represent the sum of the lengths of one or more vertical spacings between the first UI element and the second UI element.
  • Vertical spacing may represent the spacing between the horizontal boundaries of two UI elements on the screen.
  • the lengths of the horizontal and vertical spaces between UI elements can be irregular.
  • the lengths of the horizontal and vertical spaces between UI elements may be electronically device or user configurable.
  • the distance may be determined based on the lateral spacing and/or the longitudinal spacing. For example, there are two vertical spaces between UI element 5 and UI element 13. Thus, the distance between UI element 5 and UI element 13 may be the sum of the lengths of these two longitudinal intervals. As another example, there is a lateral space between UI element 12 and UI element 13 . Thus, the distance between UI element 12 and UI element 13 may be the length of this lateral separation.
  • UI element 5 has a distance of 0 from itself, and distances from UI elements 2-4 and UI elements 6-9. is 1, and the distance from UI elements 1, 10-13 is 2.
  • FIG. 13 shows a schematic diagram of an example 1300 of distance determination according to an embodiment of the present disclosure.
  • the horizontal spacing may represent the sum of the lengths of one or more horizontal spacings between the first UI element and the second UI element and the width of one or more intermediate UI elements.
  • the vertical spacing may represent the sum of the lengths of one or more vertical gaps between the first UI element and the second UI element and the height of one or more intermediate UI elements.
  • the distance may be determined based on the lateral spacing and/or the longitudinal spacing. For example, there are two vertical spaces and an intermediate UI element 9 between UI element 5 and UI element 13 . Thus, the distance of UI element 5 from UI element 13 may be the sum of the lengths of these two longitudinal intervals and the height of UI element 9 . As another example, there is one lateral space and one intermediate UI element 12 between UI element 11 and UI element 13 . Thus, the distance of UI element 11 from UI element 13 may be the sum of the length of this lateral separation and the width of UI element 12 . Additionally, there is a vertical space between UI element 3 and UI element 5. Thus the distance between UI element 3 and UI element 5 is the length of this longitudinal interval.
  • the distance between UI element 3 and UI element 11 is the sum of the length of the three longitudinal intervals and the height of the two intermediate UI elements 5 and 7 .
  • the distances between UI element 5 and other UI elements determined in the above manner are as follows: the distance between UI element 5 and itself is 0, and the distance between UI elements 2-4 and UI elements 6-9 is 1 and the distance to UI element 1, 10-13 and UI element 5 is 2.
  • the operation direction may also be taken into account in the horizontal and vertical spacing.
  • the operation direction may be the direction of dragging the first UI element.
  • the drag linkage scenario is described here, as will be described below, there are also deep linkage scenarios and pressure linkage scenarios. In the depth linkage scene and the pressure linkage scene, the distance determination method considering the operation direction can also be used.
  • UI elements can be pressed.
  • the direction from the second UI element to the first UI element (such as the direction from the second reference point to the first reference point) can be regarded as an operation direction, so that the direction of operation is taken into account in the horizontal and vertical spacing.
  • the lateral spacing and/or the longitudinal spacing may first be determined using the manner of determining the distance described with reference to FIGS. 12 and 13 . Then, the angle between the operation direction and the horizontal direction and/or the vertical direction can be determined. Thus, the distance in the operation direction can be determined using the principle of trigonometric functions.
  • the trigonometric function principle can be used to determine the distance between the operation direction 1410A and the horizontal direction. distance.
  • the distance in the operation direction may be determined by selecting one of the horizontal direction and the vertical direction that is closer to the operation direction as the reference direction according to the included angle between the operation direction and the horizontal direction and the vertical direction. For example, as shown in FIG. 14B , since the operation direction 1430B is closer to the vertical direction, the vertical direction can be selected as the reference direction, and based on the longitudinal distance and the angle between the operation direction 1430B and the vertical direction, the principle of trigonometric function is used to determine Distance in operating direction 1430B.
  • the horizontal distance in the operation direction 1420B can be determined based on the horizontal spacing and the angle between the operation direction 1420B and the horizontal direction, using the principle of trigonometric functions.
  • the reference direction may be electronically or user-configurable, and the present disclosure is not limited herein.
  • the reference direction may be set to a horizontal direction, a vertical direction or any other suitable direction.
  • the distance in the operation direction is determined by using the horizontal distance and the vertical distance.
  • the horizontal and vertical spacing may be determined by the size of the intermediate spacing and intermediate UI elements. Therefore, the distance in the manipulation direction can also be determined piecewise for each intermediate interval and intermediate UI element. Specifically, for each intermediate interval and intermediate UI element, the size of the intermediate interval or the intermediate UI element, and the included angle between the operation direction and the horizontal direction or the vertical direction can be determined. Thus, the distance in the operation direction can be determined by using the principle of trigonometric functions. The distances in the manipulation direction determined for each intermediate interval and intermediate UI element may then be summed to determine the total distance in the manipulation direction.
  • an animation effect of moving the second UI element may be determined based on the distance.
  • a first animation effect of the movement of the first UI element in response to the drag may be determined.
  • the first animation effect of the movement of the first UI element may be controlled by a predefined curve of displacement over time.
  • the predefined curve can be a Bezier curve or an elastic force curve.
  • the animation effect of the movement of the second UI element in response to the drag may be determined based on the first animation effect and the distance between the first UI element and the second UI element.
  • the first animation effect of the movement of the first UI element in the case where the first animation effect of the movement of the first UI element is controlled by a predefined curve of the displacement of the first UI element over time, it may be based on the predefined curve of the displacement of the first UI element over time.
  • a plot of the displacement of the second UI element versus time is determined. For example, in the case of an elastic force curve, the damping coefficient and/or the spring coefficient of the distance conduction spring can be based.
  • the coordinates of at least one of the at least one control point of the Bezier curve may be conducted based on distance. How to transmit the animation effect of the first UI element to the second UI element, so as to obtain the animation effect of the second UI element, can be realized by using the transmission method described in detail above. Therefore, its description is omitted here.
  • the size of the second UI element can also affect the animation effect of its movement.
  • the size of the second UI element may also be considered to determine the animation effect of the second UI element.
  • the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, and the size of the second UI element.
  • the size of the first UI element may also affect the animation effect of the movement of the second UI element.
  • the size of the first UI element may also be considered to determine the animation effect of the second UI element.
  • the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, and the size of the first UI element.
  • both the size of the first UI element and the size of the second UI element may affect the animation effect of moving the second UI element. Therefore, in some embodiments, the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
  • the second UI element may be moved with the animation effect to visually indicate that the second UI element moves with the first UI element.
  • N UI elements they can all be moved with respective animation effects to visually indicate dragging on the entire screen or a partial area of the screen, thereby presenting a dragging linkage.
  • the movement direction of a UI element that moves in conjunction can be associated with the drag direction, thereby visually indicating the drag action.
  • the direction of the drag may be determined, and the second UI element may be animated to move in association with the determined direction.
  • the first UI element and the second UI element do not start to move at the same time.
  • a first UI element may start moving when the drag occurs, while a second UI element may start moving some time after the drag occurs.
  • a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is moved in response to the delay time elapsed after the drag occurs.
  • a delay factor may be determined, and the delay time is determined based on the distance and the delay factor.
  • the delay time may be the quotient of the distance divided by the delay factor.
  • the delay factor may be electronically and user configurable.
  • FIG. 15 shows a schematic diagram of an example of a delay time 1500 according to an embodiment of the present disclosure.
  • the first UI element eg, UI element 5
  • the UI elements with a distance of 1 eg, UI elements 3, 4, 7, 8
  • UI elements with distance 2 eg, UI elements 2, 6, 9
  • UI elements with distance 3 eg, UI elements 1, 10-13
  • the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
  • FIG. 16A shows a schematic diagram of an example of a scene 1600A in which UI elements move completely with the hand, according to an embodiment of the present disclosure.
  • 16B shows a schematic diagram of an example of a displacement time curve 1600B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
  • T11 UI element 5 is dragged.
  • T11a UI element 5 starts to move following the drag of the finger.
  • T11a may be equal to T11 if UI element 5 begins to move when the drag occurs.
  • T11a may be greater than T11 if UI element 5 begins to move after the drag occurs.
  • other UI elements eg, UI elements 2-4 and 6-9 also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
  • T12 the user releases or slips, in which case the dragging of UI element 5 ends.
  • UI element 5 stops moving.
  • T12a may be equal to T12 if UI element 5 stops moving when released or slipped.
  • T12a may be greater than T12 if UI element 5 stops moving after being released or slipped.
  • the displacement of the UI element 5 in the dragging direction is S10.
  • the displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is S11.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S12.
  • Displacement S10 is greater than displacement S11, and displacement S11 is greater than displacement S12.
  • a predefined curve eg, an elastic force curve
  • the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 decreases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the distance in the drag direction increases between UI elements 3, 4, 7, and 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction.
  • the displacement of the UI element 5 in the drag direction remains at S10.
  • the UI elements 3, 4, 7, and 8 with a distance of 1 move by displacement S10 in the drag direction, and stop moving.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction has not yet reached S10, and continues to move with an animation effect controlled by a predefined curve.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction increases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction is reduced.
  • 17A shows a schematic diagram of an example of a scene 1700A in which UI elements do not completely follow the hand, according to an embodiment of the present disclosure.
  • 17B shows a schematic diagram of an example of a displacement time curve 1700B for a scene in which a UI element does not completely follow the hand, according to an embodiment of the present disclosure.
  • UI element 5 is dragged.
  • T21a UI element 5 begins to move following the drag of the finger.
  • T21a may be equal to T21 if UI element 5 begins to move when the drag occurs.
  • T21a may be greater than T21 if UI element 5 starts to move after the dragging occurs.
  • other UI elements eg, UI elements 2-4 and 6-9 also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
  • T22 the user releases or swipes, in which case dragging UI element 5 ends.
  • UI element 5 stops moving.
  • T22a may be equal to T22 if UI element 5 stops moving when released or slipped.
  • T22a may be greater than T22 if the UI element 5 stops moving after being released or slipped.
  • the displacement of the finger in the dragging direction is SF2.
  • the displacement of the UI element 5 in the dragging direction is S20.
  • the displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S21.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S22.
  • Displacement SF2 is greater than displacement S20, displacement S20 is greater than displacement S21, and displacement S21 is greater than displacement S22.
  • UI element 5 stops moving, while UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 continue the animation controlled with a predefined curve (eg, an elastic force curve) The effect moves.
  • a predefined curve eg, an elastic force curve
  • the distance between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is increased.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
  • the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 decreases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the distance in the drag direction increases between UI elements 3, 4, 7, and 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction.
  • the displacement of the UI element 5 in the drag direction remains at S20.
  • the UI elements 3, 4, 7, and 8 with a distance of 1 move the displacement S20 in the drag direction, and stop moving.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the dragging direction has not yet reached S20, and continues to move with an animation effect controlled by a predefined curve.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction increases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction is reduced.
  • UI elements 5 all stop moving after stopping the dragging. However, the UI element 5 may also continue to move a certain distance after stopping the dragging. In some embodiments, the distance may be determined based on a friction force model as described above. Whether the UI element 5 continues to move after stopping the drag is electronically device and user configurable. For example, if the electronic device is configured to allow continued movement after a release or slip, UI element 5 may continue to move. Conversely, UI element 5 will stop moving as the dragging stops.
  • FIG. 18A shows a schematic diagram of an example of a scene 1800A in which UI elements move completely with the hand, according to an embodiment of the present disclosure.
  • 18B shows a schematic diagram of an example of a displacement time curve 1800B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
  • T31 UI element 5 is dragged.
  • T11a UI element 5 starts to move following the drag of the finger.
  • T31a may be equal to T31 if UI element 5 begins to move when the drag occurs.
  • T31a may be greater than T31 if UI element 5 begins to move after the drag occurs.
  • other UI elements eg, UI elements 2-4 and 6-9 also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
  • T32 the user releases or swipes, in which case dragging UI element 5 ends.
  • UI element 5 continues to move with an animation effect controlled by a predefined curve (eg, an elastic force curve).
  • T32a may be equal to T32 if the UI element 5 moves with an animation controlled by a predefined curve when the drag is ended.
  • T32a may be greater than T32 if the UI element 5 is moved with an animation effect controlled by a predefined curve after the end of the drag.
  • the displacement of the UI element 5 in the drag direction is SF3.
  • the displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S31.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S32.
  • the displacement SF3 is greater than the displacement S31, and the displacement S31 is greater than the displacement S32.
  • UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 also continue to move with the animation effect of the predefined curve.
  • T31 the distance in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 is increased.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
  • the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 increases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
  • the UI element can bounce back a certain distance.
  • the displacement of the spring oscillates between positive and negative values over time. Therefore, the spring force curve of the underdamped state can be used to control the springback of UI elements.
  • UI elements are shown to be allowed to overlap each other, eg UI element 8 overlaps UI element 9 at times T32-T34.
  • UI elements may not be allowed to overlap each other. Whether overlapping is allowed is electronically device or user configurable. Movement of UI elements follows the elastic force curve of the underdamped state, with overlap allowed. The movement of UI elements follows the elastic force curve of the overdamped state without allowing overlap. Further, whether any two UI elements overlap may also depend on the relative movement magnitudes of the two UI elements. For example, where the relative movement of the two UI elements is small, the UI elements generally do not overlap. In the case of a large relative movement of the two UI elements, the UI elements may overlap.
  • FIG. 19A shows a schematic diagram of an example of a scene 1900A in which UI elements move completely with the hand, according to an embodiment of the present disclosure.
  • 19B shows a schematic diagram of an example of a displacement time curve 1900B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
  • T41 UI element 5 is dragged.
  • T41a UI element 5 begins to move following the drag of the finger.
  • T41a may be equal to T41 if UI element 5 begins to move when the drag occurs.
  • T41a may be greater than T41 if UI element 5 begins to move after the drag occurs.
  • other UI elements eg, UI elements 2-4 and 6-9 also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
  • T42 the user releases or swipes, in which case dragging UI element 5 ends.
  • UI element 5 continues to move with an animation effect controlled by a predefined curve (eg, an elastic force curve).
  • T42a may be equal to T42 if the UI element 5 moves with an animation controlled by a predefined curve when the drag is ended.
  • T42a may be greater than T42 if the UI element 5 is moved with an animation effect controlled by a predefined curve after ending the drag.
  • the displacement of the UI element 5 in the drag direction is SF4.
  • the displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S41.
  • the displacement of UI elements 2, 6, and 9 with a distance of 2 in the dragging direction is S42.
  • the displacement SF4 is greater than the displacement S41, and the displacement S41 is greater than the displacement S42.
  • UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 also continue to move with the animation effect of the predefined curve.
  • T41 the distance between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is increased.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases.
  • the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
  • the UI element 5 moves the displacement S40 in the drag direction, and starts to spring back.
  • the distance between the displacement S40 in the drag direction at the position of the rebound and the displacement SF4 in the drag direction at the position of the release or slip may be determined based on the friction force model as described above.
  • the UI element 9 with a distance of 2 moves a displacement S40 in the drag direction, and also starts to spring back.
  • UI element 5 is shown to bounce ahead of UI elements 3, 4, 7, 8 with distance 1, and UI elements 3, 4, 7, 8 with distance 1 are shown to precede distance UI elements 2, 6, and 9 for 2 bounce back, but all UI elements can bounce together.
  • UI element 5 may stop moving to wait for other UI elements to move by displacement S40, and then start bouncing back together.
  • all UI elements are shown as rebounding to the position of letting go or slipping, all UI elements may rebound more or less, and the embodiments of the present disclosure are not limited thereto.
  • the embodiments of the present disclosure relate to the linkage of UI elements in the UI in the depth direction, which is also referred to as depth linkage.
  • the depth direction refers to a direction perpendicular to the screen of the electronic device.
  • the pressed target UI element can affect other UI elements that are not pressed.
  • triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element .
  • other UI elements can also be scaled by a corresponding magnitude, thereby visually showing a linked scaling.
  • the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
  • Deep linkage can occur in a UI with any suitable regular or irregular layout, and UI elements in the UI can have any suitable size and shape.
  • deep linkage can occur in UIs 300A-300C as shown in Figures 3A-3C.
  • UI elements in the UI can be pressed.
  • a user may press a UI element when the user desires to perform an operation associated with the UI element.
  • a user may press a UI element when the user desires to enter an application represented by the UI element, open a menu associated with the UI element, and the like.
  • the UI element may change, eg, the UI element may be scaled to render the press action in the depth direction.
  • UI elements can be scaled down to render away in the depth direction.
  • UI elements can be enlarged to render close in depth direction.
  • zooming will be described taking UI element zooming out as an example. However, it should be understood that zooming may also be enlarging UI elements.
  • FIG. 20 shows a schematic diagram of an example of a UI element changing 2000 when pressed, according to some embodiments of the present disclosure. As shown in FIG. 20, upon detection of a press at the UI element, the UI element can be zoomed out to appear away in the depth direction.
  • Changes in UI elements can conform to the surface pressure model.
  • the pressure is the same at every part of the UI element (eg, every pixel or every part divided in any other suitable way). That is, the pressure is the same for all parts of the UI element, regardless of which part of the UI element is pressed (eg, whether the center of the UI element is pressed or the edge of the UI element). So no matter which part of the UI element is pressed, the UI element changes will be the same.
  • FIG. 21 shows a schematic diagram of an example of a change 2100 of a UI element as it is pressed at different locations, according to some embodiments of the present disclosure. As shown in Figure 21, whether a press is detected at the center of the UI element or the edge of the UI element, the UI element can be shrunk by the same amount to appear away in the depth direction.
  • the pressed position may no longer be within the range of the shrunk UI element.
  • the press can continue to be detected as a press on the UI element.
  • the press will not be detected as a press on the UI element. In this case, the compression can be considered to be over.
  • the magnitude of the changes may depend on the magnitude of the pressing force.
  • the magnitude of the force usually refers to the actual magnitude of the force.
  • the greater the pressing force the greater the change in the depth direction.
  • the force of the pressing may be the force of the pressing applied by the user detected by the electronic device.
  • the pressing force may also be a predetermined pressing force set by the electronic device or the user.
  • FIG. 22 shows a schematic diagram of an example of a UI element changing 2200 at different pressing forces in accordance with some embodiments of the present disclosure.
  • the UI elements in the case of a large pressing force, the UI elements can be shrunk by a larger margin to present a greater degree of distance in the depth direction.
  • UI elements may even shrink to disappear from the UI, ie, to a size of 0, so as to appear as far away as possible in the depth direction.
  • the UI elements in the case of a small pressing force, the UI elements can be shrunk by a smaller amount to present a smaller degree of separation in the depth direction.
  • UI elements scale in response to different pressing forces is electronically device or user configurable. For example, UI elements can shrink in smaller increments when the pressing force is high, and can shrink by a larger amount when the pressing force is small.
  • the change in the depth direction based entirely on the real pressing force may have high requirements on the user, and may require the electronic device to be equipped with relevant hardware.
  • the time of the compression may be used to simulate or replace the force of the compression. For example, if the pressing time is longer, it can be considered that the pressing force is larger, and thus the change in the depth direction is larger.
  • FIG. 23 shows a schematic diagram of an example of a change 2300 of UI elements at different press durations, according to some embodiments of the present disclosure.
  • the UI element in the case where the duration of the pressing is long, the UI element can be shrunk by a larger amount to present a greater degree of distance in the depth direction.
  • UI elements may even shrink to disappear from the UI, ie, to a size of 0, so as to appear as far away as possible in the depth direction.
  • the duration of the press is short, the UI element may shrink by a smaller amount to present a smaller degree of separation in the depth direction.
  • UI elements scale in response to different press durations is electronically device or user configurable. For example, where the duration of the press is long, the UI element may shrink by a smaller amount, and when the duration of the press is short, the UI element may shrink by a larger amount.
  • the magnitude of changes may depend on the sizes of UI elements.
  • the same press may be difficult to press on a larger UI element, while it may be easier to press on a smaller UI element.
  • larger UI elements may be less affected by presses, while smaller UI elements may be more affected by presses.
  • FIG. 24 shows a schematic diagram of an example of a UI element changing 2400 at different sizes, according to some embodiments of the present disclosure.
  • the UI element in the case where the size of the UI element is large, the UI element can be shrunk by a larger magnitude to present a greater degree of distance in the depth direction.
  • the UI element in the case where the size of the UI element is small, the UI element can be reduced by a smaller amount to present a smaller degree of separation in the depth direction.
  • UI elements scale at different sizes is electronically device or user configurable. For example, in order to make the size of the scaled UI elements more balanced, larger UI elements may be more affected by presses, while smaller UI elements may be less affected by presses. To this end, in the case of a large size of the UI element, the UI element can be scaled down by a smaller amount, and in the case of a small size of the UI element, the UI element can be scaled down by a larger scale to render more depthwise A small distance away.
  • the range that the UI element can be zoomed may be limited, so that the UI element can only be zoomed within the allowed range.
  • the magnitude range may be any suitable range, such as 10%-90% of the size of the UI element, 100 pixels-10,000 pixels, or 2%-50% of the screen-to-body ratio, or the like.
  • the magnitude range is 10%-90% of the size of the UI element. In this case, no matter how hard the pressing force is or how long the pressing duration is, the pressed UI element can only be reduced to at most 10% of its original size, and it is impossible to disappear from the screen.
  • the pressed target UI element can affect other UI elements that are not pressed.
  • triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element .
  • other UI elements can also be scaled by a corresponding magnitude, thereby visually showing a linked scaling. Therefore, hereinafter, the depth linkage will be described in detail with reference to FIGS. 25 to 33 .
  • FIG. 25 shows a flowchart of a graphical interface display method 2500 according to an embodiment of the present disclosure. It should be understood that the method 2500 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 2500 is described herein with reference to UI 300A of Figure 3A. However, it should be understood that UI 300A is merely an example, and method 2500 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
  • the M user interface UI elements are displayed on the screen of the electronic device.
  • M is a positive integer greater than 1.
  • the M UI elements may be UI elements 1-13.
  • a press is detected for a duration at a first UI element of the M UI elements.
  • the first UI element may be UI element 5 .
  • a press at the first UI element for a duration will cause the first UI element to scale over time to present the effect of the press in the depth direction.
  • each of the N UI elements on the screen is scaled.
  • N is a positive integer between 1 and M-1. Thereby, interlocking pressing is visually indicated.
  • FIG. 26 shows a schematic diagram of an example of a depth linkage 2600 of N UI elements according to an embodiment of the present disclosure.
  • UI element 5 is pressed during a duration, so that UI element 5 is scaled over time to present a pressing effect in the depth direction.
  • other UI elements on the screen eg, UI elements 1 to 4, and 6 to 13
  • FIG. 26 only shows the depth linkage of UI elements 1-13 in UI 300A. It should be understood that deep linkage can occur at any at least two UI elements in any UI, for example, at any at least two UI elements in UIs 300A-300C.
  • deep linkage can work on all UI elements on the screen.
  • M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements.
  • deep linkage can only act on some UI elements on the screen.
  • the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein.
  • the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
  • UI elements that intersect the area of influence may be considered to be within the area of influence.
  • the area of influence is a circle with a predetermined radius
  • the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
  • FIG. 27 shows a schematic diagram of an example of a UI element's area of influence 2700 according to an embodiment of the present disclosure.
  • UI elements 3, 4, 7, and 8 are within the influence area 2710 of UI element 5
  • UI elements 3, 4, 7, and 8 will be scaled in conjunction with UI element 5.
  • UI elements 1, 2, 6, 9-13 are not within the influence area 2710 of UI element 5, UI elements 1, 6, 9-13 will not be scaled in conjunction with UI element 5.
  • the distance between the first UI element and each of the N UI elements may be determined.
  • distances may be divided into a plurality of distance levels according to the range in which the distances lie.
  • the operated UI element itself may be at distance level 0
  • the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element...
  • UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage.
  • the distance itself may also be used, thereby allowing UI elements to be more precisely linked.
  • distance classes are referred to interchangeably as distances.
  • the magnitude of scaling the second UI element may be determined based on the distance. For example, if the distance between the first UI element and the second UI element is greater, the second UI element may be scaled less, thereby visually indicating that the press has less impact on the distant UI element. Alternatively, if the distance between the first UI element and the second UI element is larger, the magnitude of the zooming of the second UI element may also be larger, thereby visually indicating that the impact of the press on the distant UI element becomes larger .
  • a first magnitude by which the first UI element is scaled in response to the press may be determined.
  • the first magnitude of scaling of the first UI element may be determined based on various factors associated with the first UI element. These factors may include, but are not limited to, the size of the first UI element, the range of magnitudes within which the first UI element can vary, the duration of the pressing, and the predetermined pressing force. In the above, the effects of these factors on the zooming amplitude of the UI elements are described in detail, so the descriptions thereof are omitted here.
  • the magnitude by which the second UI element scales in response to the press can then be determined based on the first magnitude and the distance between the first UI element and the second UI element.
  • How to transmit the magnitude of scaling the first UI element to the second UI element, so as to obtain the magnitude of scaling the second UI element can be implemented using the conducting manner described in detail above.
  • the difference is that in deep linkage, x n in conduction equations (7) and (8) represents the zoom magnitude of the linked-zoomed UI element (eg, the second UI element), while x represents the pressed UI element (eg. , the zoom range of the first UI element). Therefore, its description is omitted here.
  • the zooming amplitude of the second UI element is determined by the zooming amplitude of the first UI element and the distance between the second UI element and the first UI element, it can be intuitive, natural, and conform to the user's usage habits. deep linkage.
  • the size of the second UI element may also affect the magnitude of the scaling of the second UI element.
  • the size of the second UI element may also be considered to determine the magnitude by which to scale the second UI element. For example, if the second UI element is larger, the range of scaling the second UI element may be larger, so that the sizes of the scaled UI elements on the screen are more similar and thus more visually coordinated. Alternatively, if the second UI element is larger, the magnitude of scaling the second UI element may be smaller, so that the size difference of the scaled UI element on the screen is larger.
  • the magnitude by which the second UI element scales in response to the press may be determined based on the first magnitude, the distance, and the size of the second UI element.
  • the size of the first UI element may also affect the magnitude of the scaling of the second UI element.
  • the size of the first UI element may also be considered to determine the magnitude by which the second UI element is scaled. For example, the larger the size of the first UI element, the greater the possible linkage effect, so the animation effect of scaling the second UI element can be proportional to the size of the first UI element.
  • the magnitude by which the second UI element is scaled may be determined based on the first magnitude, the distance, and the size of the first UI element.
  • both the size of the first UI element and the size of the second UI element may affect the magnitude of the scaling of the second UI element.
  • the magnitude of scaling the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
  • the second UI element can be scaled by the magnitude to visually indicate that the second UI element scales as the first UI element is pressed.
  • N UI elements they can all be scaled with respective amplitudes to visually indicate pressing on the entire screen or a partial area of the screen, thereby presenting a pressing linkage.
  • FIG. 28 shows a schematic diagram of an example of distance-based scaling of UI elements 2800 in accordance with an embodiment of the present disclosure.
  • UI elements with a distance of 0 eg, UI element 5 itself
  • UI elements with a distance of 1 eg, UI elements 3, 4, 7, 8
  • UI elements with a distance of 1 is zoomed more than UI elements with a distance of 2 (eg, UI elements 2, 6, 9)
  • UI elements with a distance of 2 are zoomed more than UI elements with a distance of 3 (eg, UI elements 1, 10-13) .
  • the first UI element and the second UI element do not start scaling at the same time.
  • a first UI element may start scaling when a press occurs, while a second UI element may start scaling some time after the press occurs.
  • a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is scaled in response to the delay time elapsed after the press occurs.
  • a delay factor may be determined, and the delay time is determined based on the distance and the delay factor.
  • the delay time may be the quotient of the distance divided by the delay factor.
  • the delay factor may be electronically and user configurable.
  • FIG. 29 shows a schematic diagram of an example of a delay time 2900 according to an embodiment of the present disclosure.
  • the first UI element with a distance of 0 starts scaling when the press occurs
  • the UI element with a distance of 1 is scaled later than the first UI element
  • the UI element with a distance of 2 is scaled later than the UI element with a distance of 1 UI elements
  • UI elements with a distance of 3 are scaled later than UI elements with a distance of 2.
  • FIG. 30 shows a schematic diagram of an example of scaling 3000 of UI elements with a delay time in accordance with the present disclosure.
  • UI element 5 with a distance of 0 starts scaling at time T51 when the press occurs
  • UI elements 3, 4, 7, and 8 with a distance of 1 start scaling at a later time T52 and UI elements with a distance of 2 start scaling at time T52.
  • 2, 4, 6, 9 start scaling at a later time T53 and UI elements 1, 10-13 with a distance of 3 start scaling at the latest T54.
  • the speed of zooming of UI elements may be controlled by a predefined curve of amplitude versus time.
  • the predefined curve can be a Bezier curve or an elastic force curve.
  • the speed of scaling can be controlled by controlling the damping and stiffness coefficients of the spring.
  • the speed of scaling can be controlled by controlling the coordinates of at least one of the at least one control point of the Bezier curve.
  • the UI element that is zoomed in linkage can also be moved toward the pressed UI element.
  • the N UI elements may be moved toward the first UI element to further visually highlight the press.
  • the magnitude of the displacement may depend on at least one of the distance between the co-zoomed UI element and the pressed UI element, the duration of the pressing, the size of the second UI element, and the size of the first UI element.
  • movement may be determined based on the distance between the first UI element and the second UI element, the duration of the press, the size of the first UI element, and/or the size of the second UI element The displacement of the second UI element.
  • the second UI element can then be moved by the displacement in a direction from the second UI element to the first UI element.
  • the second UI element may be moved by the displacement in a direction from the second reference point of the second UI element to the first reference point of the first UI element.
  • the visual effect of this is that the second UI element is attracted to the first UI element.
  • the displacement can also be made to move the second UI element in the opposite direction (eg, from the first reference point of the first UI element to the second reference point of the second UI element). The visual effect of this is that the second UI element is repelled by the first UI element.
  • FIG. 31 shows a schematic diagram of an example of a displacement 3100 of movement of a UI element according to an embodiment of the present disclosure.
  • UI elements with a distance of 1 eg, UI elements 3, 4, 7, 8
  • UI elements with a distance of 2 e.g., UI elements 2, 6, 9
  • the distance is UI elements with a distance of 2 have a greater displacement magnitude than UI elements with a distance of 3 (e.g. UI elements 1, 10-13)
  • the scaled UI element may be restored after the press ends (eg, after the user lifts the finger off the screen). Specifically, both the pressed UI element and the N UI elements that are zoomed together can be restored. To this end, in some embodiments, the scaled second UI element may be restored to the pre-scaled second UI element.
  • the restoration process may be an inverse process of scaling, and thus a detailed description thereof is omitted here.
  • FIG. 32A shows a schematic diagram of an example of a restoration 3200A of UI elements in accordance with an embodiment of the present disclosure.
  • the scaled UI elements eg, UI elements 1-13
  • the scaled UI elements are all restored to their original size before scaling.
  • UI elements may also move in response to presses.
  • the moved UI element can be reset after the press ends.
  • all N UI elements moved toward the pressed UI element can be reset.
  • the second UI element may be restored from the moved position to the pre-move position.
  • FIG. 32B shows a schematic diagram of an example of restoration 3200B of UI elements with a displacement, according to an embodiment of the present disclosure.
  • the moved and scaled UI elements eg, UI elements 1-13
  • the restoration of zooming or the restoration of movement may have a bouncing effect.
  • the size of the UI element can be first increased to be larger than the initial size, and then reduced to the initial size.
  • the UI element that is moved in linkage can first move away from the pressed UI element to a farther than the initial position before the movement, and then return to the initial position.
  • 33A-33B show schematic diagrams, respectively, of an example of a restored size time curve 3300A and a displacement time curve 3300B of a UI element with a springback effect, according to an embodiment of the present disclosure.
  • UI element 5 is pressed to zoom out.
  • other UI elements eg, UI elements 1-4, 6-13 are also reduced in linkage.
  • UI element 5 is reduced to 0.5 times its original size.
  • UI elements with a distance of 1 eg, UI elements 3, 4, 7, and 8 are reduced in linkage, but the reduction rate is smaller than that of UI element 5.
  • UI elements with a distance of 2 for example, UI elements 2, 6, and 9 are also reduced in linkage, but the reduction rate is smaller than that of UI elements with a distance of 1.
  • UI elements with a distance of 3 for example, UI elements 1, 10-13 are also reduced in linkage, but the reduction rate is smaller than that of UI elements with a distance of 2.
  • UI elements start scaling and bouncing back.
  • the size of UI element 5 is increased to 1.2 times the original size.
  • UI elements with a distance of 1 eg, UI elements 3, 4, 7, 8
  • UI elements with a distance of 2 for example, UI elements 2, 6, and 9
  • UI elements with a distance of 3 also increase in synergy, but the increase is smaller than that of UI elements with a distance of 2.
  • the user lets go.
  • the displacement of UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) moving toward UI element 5 is -1.
  • UI elements with a distance of 2 (eg, UI elements 2, 6, 9) also move towards UI element 5, but the displacement magnitude is smaller than that of the UI elements with a distance of 1.
  • UI elements with a distance of 3 (eg, UI elements 1, 10-13) also move towards UI element 5, but the displacement magnitude is smaller than that of the UI elements with a distance of 2.
  • the displacement of UI elements with a distance of 1 exceeds the initial position and is +0.7.
  • UI elements with a distance of 2 eg, UI elements 2, 6, 9 are also displaced beyond the initial position, but the displacement magnitude is smaller than that of the UI elements with a distance of 1.
  • the displacement of UI elements with a distance of 3 eg, UI elements 1, 10-13 also exceeds the initial position, but the displacement magnitude is smaller than that of the UI elements with a distance of 2.
  • the scaling dimensions (eg, 0.5x, 1.2x) and movement displacements (eg, displacement-1, displacement 0.7) in Figures 33A-33B are only examples, and UI elements may be scaled smaller at any suitable size or at any Appropriate displacement moves.
  • the rebound effect is shown as only one rebound in Figures 33A-33B, a rebound effect with multiple rebounds can be achieved.
  • the number of rebounds may be any suitable number of rebounds, and the present disclosure is not limited herein.
  • the rebound magnitude of the multiple rebounds may decrease over time.
  • 33C-33D show schematic diagrams, respectively, of an example of a restored size-time curve 3300C and a displacement-time curve 3300D for a UI element with a rebound effect of multiple rebounds with reduced rebound amplitudes, according to embodiments of the present disclosure.
  • the UI element is restored to its original size after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) bounces back at a larger scale than the UI element with a distance of 1 (eg, UI element 5 ) 3, 4, 7, 8).
  • a UI element with a distance of 1 will have a larger rebound scale than a UI element with a distance of 2 (eg, UI elements 2, 6, 9).
  • a UI element with a distance of 2 will have a larger rebound scaling than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
  • the UI element recovers to the initial position after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) rebounds with a greater displacement magnitude than the UI element with a distance of 1 (eg, UI element 5 ) , UI elements 3, 4, 7, 8).
  • a UI element with a distance of 1 rebounds with a larger displacement magnitude than a UI element with a distance of 2 (eg, UI elements 2, 6, 9).
  • a UI element with a distance of 2 rebounds with a larger displacement magnitude than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
  • the springback effect may also be controlled by predefined curves (eg, elastic force curves, Bezier curves, etc.).
  • predefined curves eg, elastic force curves, Bezier curves, etc.
  • these UI elements can scale bounce or move bounce in an animated effect controlled by a predefined curve.
  • the embodiments of the present disclosure relate to the linkage of UI elements in the UI on the animation effect of pressing, which is also referred to as pressure linkage.
  • the pressed target UI element can affect other UI elements that are not pressed.
  • triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element .
  • other UI elements can also show the pressing effect with the corresponding animation effect, so as to visually present the linkage pressing .
  • the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
  • Pressure linkage can occur in a UI with any suitable regular or irregular layout, and UI elements in the UI can have any suitable size and shape.
  • pressure linkage can occur in UIs 300A-300C as shown in Figures 3A-3C.
  • UI elements in the UI can be pressed.
  • a user may press a UI element when the user desires to perform an operation associated with the UI element.
  • a user may press a UI element when the user desires to enter an application represented by the UI element, open a menu associated with the UI element, and the like.
  • the UI element may change with an animation effect, for example, the UI element may be visually moved in a rocker fashion relative to the position of the press (alternatively referred to hereinafter as a rotation), Or visually concave or protrude relative to the pressed position to present a pressing action.
  • changes in UI elements can conform to the point pressure model. In the point pressure model, the pressure of the UI element at the pressed position is greater than the pressure of other parts.
  • UI elements can be treated as rigid bodies.
  • the UI element upon detection of a press at the UI element, the UI element can be visually moved in a rocker fashion relative to the position of the press to present the press effect.
  • FIG. 34 shows a schematic diagram of an example of a UI element that is a rigid body changing 3400 when pressed, according to some embodiments of the present disclosure.
  • the UI element upon detection of a press at the UI element, the UI element can be animated from the initial shape 3410 to visually move the position in a rocker fashion relative to the position of the press. For example, when the pressed position is to the left of the UI element, the UI element is visually rotated to the left about its reference point (indicated by a "+"), changing to shape 3420.
  • the altered shape 3420 resembles a rocker with the left side depressed and the right side up.
  • the UI element when the pressed position is on the right side of the UI element, the UI element is visually rotated to the right around its reference point, changing to shape 3430 .
  • the altered shape 3430 resembles a rocker with the left side lifted and the right side depressed.
  • the UI element can be seen as a rocker connected to a spring on both sides, and the pressing of the UI element can be seen as pressing the spring on one side and stretching the spring on the other, thus implementing the UI as a whole Animate the element's rotation around its base point.
  • FIG. 35 shows a schematic diagram of an example of a pressing and stretching of a spring 3500 that simulates pressing of a UI element, according to some embodiments of the present disclosure.
  • Figure 3510 shows the two-sided spring in its initial state.
  • Graph 3520 shows that when the pressed position is on the left side of the UI element, the left spring is pressed and the right spring is stretched.
  • Diagram 3530 shows that when the pressed position is on the right side of the UI element, the right spring is pressed and the left spring is stretched.
  • model of the spring can be represented by the following equation (9):
  • L represents the horizontal distance between the pressed position and the reference point of the UI element
  • c represents the linear distance between the pressed position and the reference point
  • k' represents the spring coefficient of the spring
  • k' represents the elastic coefficient of the spring
  • x' represents the deformation amount of the spring
  • g' represents the damping coefficient of the spring
  • T represents the time of deformation
  • m' represents the size of the UI element.
  • UI elements may be considered non-rigid bodies.
  • the UI element upon detection of a press at the UI element, the UI element may be visually recessed or protruded relative to the location of the press to present the press effect.
  • UI elements can be viewed as grid diagrams.
  • the initial UI element 3610 may change with an animation effect to visually recess or protrude relative to the location of the press.
  • the coordinates of the grid within the initial UI element 3610 can be changed to change to UI element 3620 recessed relative to the location of the press.
  • the color (eg, hue, lightness, saturation, etc.) of the UI elements may also vary to accentuate the press.
  • the initial UI element 3610 may also change to a UI element 3630 that is recessed and darkened relative to the location of the press. It should be understood that color changes may also apply to UI elements that are rigid bodies.
  • the pressed position may no longer be within the range of the changed UI element.
  • the press can continue to be detected as a press on the UI element.
  • the press will not be detected as a press on the UI element. In this case, the compression can be considered to be over.
  • UI elements may also vary in other ways, such as being recessed or protruding visually relative to the location of the press.
  • the magnitude of the changes may depend on the magnitude of the pressing force.
  • the magnitude of the force usually refers to the actual magnitude of the force.
  • the greater the pressing force the greater the change in the UI element.
  • the force of the pressing may be the force of the pressing applied by the user detected by the electronic device.
  • the pressing force may also be a predetermined pressing force set by the electronic device or the user.
  • FIG. 37 shows a schematic diagram of an example of a UI element changing 3700 at different pressing forces, according to some embodiments of the present disclosure.
  • the UI element in the case where the pressing force is large, the UI element can be changed (eg, rotated) by a larger magnitude.
  • UI elements can change in smaller magnitudes when the pressing force is small.
  • the manner in which the UI elements change in response to different pressing forces is electronically device or user configurable. For example, UI elements can change in smaller magnitudes when the pressing force is high, and UI elements can change in larger magnitudes when the pressing force is small.
  • the time of the compression may be used to simulate or replace the force of the compression. For example, if the pressing time is longer, it can be considered that the pressing force is larger, and thus the change is larger.
  • the UI element may change (eg, rotate) by a larger magnitude with a long duration of the press.
  • UI elements may change in smaller magnitudes.
  • UI elements change in response to different press durations is electronically device or user configurable. For example, where the duration of the press is long, the UI elements may change in smaller magnitudes, and where the duration of the press is short, the UI elements may change by a larger magnitude.
  • the magnitude of changes may depend on the sizes of UI elements.
  • the same press may be difficult to press on a larger UI element, while it may be easier to press on a smaller UI element.
  • larger UI elements may be less affected by presses, while smaller UI elements may be more affected by presses.
  • FIG. 39 shows a schematic diagram of an example of a UI element changing 3900 at different sizes, according to some embodiments of the present disclosure.
  • the UI element in the case where the size of the UI element is large, the UI element can be changed by a larger magnitude. In contrast, where the size of the UI element is small, the UI element can vary in smaller magnitudes.
  • UI elements change at different sizes is electronically device or user configurable. For example, where the size of the UI element is large, the UI element may vary in smaller magnitudes, and in the case where the size of the UI element is small, the UI element may vary in larger magnitudes.
  • the range that the UI element can change may be limited, so that the UI element can only change within the range of the allowable range.
  • the magnitude range may be any suitable range, such as a rotation angle of a UI element between 0-60 degrees, a color change of a UI element between 10%-50% grayscale, or the coordinates of a grid within a UI element Variation between 100-10000 pixels etc.
  • the magnitude range is that the UI element's rotation angle is between 0-60 degrees. In this case, no matter how high the predetermined pressing force is and how long the pressing duration is, the pressed UI element can only be rotated at most 60 degrees around the reference point, and it is impossible to rotate by a larger amount.
  • the change of the pressed UI element is described in detail.
  • the pressed target UI element can affect other UI elements that are not pressed.
  • triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element .
  • other UI elements can also change with a corresponding animation effect, thereby visually presenting the linkage press down. Therefore, hereinafter, the pressure linkage will be described in detail with reference to FIGS. 40 to 46 .
  • FIG. 40 shows a flowchart of a graphical interface display method 4000 according to an embodiment of the present disclosure. It should be understood that the method 4000 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 4000 is described herein with reference to UI 300A of Figure 3A. However, it should be understood that UI 300A is merely an example, and method 2500 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
  • the M user interface UI elements are displayed on the screen of the electronic device.
  • M is a positive integer greater than 1.
  • the M UI elements may be UI elements 1-13.
  • a press at a first UI element of the M UI elements is detected.
  • the first UI element may be UI element 5 .
  • a press at the first UI element will cause the first UI element to rotate to render the press effect.
  • N is a positive integer between 1 and M-1. Thereby, interlocking pressing is visually indicated.
  • the direction in which the N UI elements change relative to the pressed position may be a direction from each of the N UI elements to the pressed position. In some embodiments, the direction may be a direction from the corresponding reference point of each of the N UI elements to the reference point of the pressed UI element.
  • the pressed position is the change reference point for the change of N elements, that is, the pressed position is visually indicated as the center of the pressed.
  • 41 shows a schematic diagram of an example of a pressure linkage 4000 of N UI elements according to an embodiment of the present disclosure. As shown in FIG. 41, UI element 5 is pressed, so that UI element 5 is rotated to present the pressing effect. In addition, other UI elements on the screen (eg, UI elements 1 to 4, and 6 to 13) also rotate at different magnitudes relative to the position of the press in response to the press to present the press effect. Thereby, interlocking pressing is visually presented.
  • UI elements 1 to 4, and 6 to 13 also rotate at different magnitudes relative to the position
  • the direction in which the N UI elements change relative to the pressed position may be the same as the direction in which the pressed UI element changes.
  • 42 shows a schematic diagram of another example of pressure linkage 4000 of N UI elements according to an embodiment of the present disclosure. As shown in FIG. 42, UI element 5 is pressed, so that UI element 5 is rotated to present the pressing effect.
  • other UI elements on the screen eg, UI elements 1 to 4, and 6 to 13
  • the change reference point of the change of N elements is its own reference point. Thereby, interlocking pressing is visually presented.
  • Figures 41-42 only show the pressure linkages of UI elements 1-13 in UI 300A. It should be understood that pressure linkage can occur at any at least two UI elements in any UI, eg, at any at least two UI elements in UIs 300A-300C.
  • pressure linkage can act on all UI elements on the screen.
  • M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements.
  • the pressure linkage may only act on some UI elements on the screen.
  • the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein.
  • the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
  • UI elements that intersect the area of influence may be considered to be within the area of influence.
  • the area of influence is a circle with a predetermined radius
  • the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
  • FIG. 43 shows a schematic diagram of an example of a UI element's area of influence 4300 according to an embodiment of the present disclosure. As shown in FIG. 43 , since UI elements 3, 4, 7, and 8 are within the influence area 4310 of UI element 5, UI elements 3, 4, 7, and 8 will change in conjunction with UI element 5. In addition, since UI elements 1, 2, 6, 9-13 are not within the influence area 4310 of UI element 5, UI elements 1, 6, 9-13 will not change in conjunction with UI element 5.
  • the distance between the first UI element and each of the N UI elements may be determined.
  • distances may be divided into a plurality of distance levels according to the range in which the distances lie.
  • the operated UI element itself may be at distance level 0
  • the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element...
  • UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage.
  • the distance itself may also be used, thereby allowing UI elements to be more precisely linked.
  • distance classes are referred to interchangeably as distances.
  • the animation effect of the change of the second UI element may be determined based on the distance. For example, if the distance between the first UI element and the second UI element is larger, the magnitude of the change in the second UI element may be smaller, thereby visually indicating that the impact of the press on the distant UI element is smaller. Alternatively, if the distance between the first UI element and the second UI element is larger, the magnitude of the change in the second UI element may also be larger, thereby visually indicating that the impact of the press on the distant UI element changes. big.
  • a first magnitude of the change in the first UI element in response to the press may be determined.
  • the first magnitude of change in the first UI element may be determined based on various factors associated with the first UI element. These factors may include, but are not limited to, the size of the first UI element, the location of the first reference point of the first UI element, the range of magnitudes that the first UI element can vary, the location of the press, the duration of the press, and the predetermined press force. In the above, the influences of these factors on the magnitudes of changes of UI elements are described in detail, so the descriptions thereof are omitted here.
  • the magnitude by which the second UI element changes in response to the press can then be determined based on the first magnitude and the distance between the first UI element and the second UI element. How to transmit the magnitude of the change of the first UI element to the second UI element, so as to obtain the magnitude of the change of the second UI element, can be implemented using the transmission method described in detail above. The difference is that in pressure linkage, x n in conduction equations (7) and (8) represents the magnitude of change of the UI element (e.g., the second UI element) that changes in linkage, while x represents the pressed UI element (e.g., the second UI element) , the first UI element). Therefore, its description is omitted here.
  • the magnitude of the change of the second UI element is determined by the magnitude of the change of the first UI element and the distance between the second UI element and the first UI element, it can be intuitive, natural and conform to the user's usage habits. pressure linkage.
  • the size of the second UI element may also affect the animation effect of the change of the second UI element.
  • the size of the second UI element may also be considered to determine the animation effect of the change of the second UI element. For example, if the second UI element is larger, the magnitude of the change in the second UI element may be larger. Alternatively, if the second UI element is larger, the magnitude of the change in the second UI element may be smaller. To this end, in some embodiments, the magnitude of the change in the second UI element in response to the press may be determined based on the first magnitude, the distance, and the size of the second UI element.
  • the size of the first UI element may also affect the animation effect of the change of the second UI element.
  • the size of the first UI element may also be considered to determine the animation effect of the change of the second UI element.
  • the magnitude of the change of the second UI element may be proportional to the size of the first UI element.
  • the magnitude of the second UI element may be determined based on the first magnitude, the distance, and the size of the first UI element.
  • both the size of the first UI element and the size of the second UI element may affect the animation effect of the change of the second UI element. Therefore, in some embodiments, the magnitude of the change in the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
  • the second UI element may be changed with the animation effect to visually indicate that the second UI element changes as the first UI element is pressed change.
  • N UI elements all of them can be changed with their respective animation effects to visually indicate pressing on the entire screen or a partial area of the screen, thereby presenting a pressing linkage.
  • FIG. 44 shows a schematic diagram of an example of a distance-based UI element change 4400 in accordance with an embodiment of the present disclosure.
  • UI elements with a distance of 0 eg, UI element 5 itself
  • UI elements with a distance of 1 e.g. UI elements 3, 4, 7, 8
  • UI elements with a distance of 1 Elements change more than UI elements with distance 2 (e.g. UI elements 2, 6, 9)
  • UI elements with distance 2 change more than UI elements with distance 3 (e.g. UI elements 1, 10) -13).
  • the first UI element and the second UI element do not start to change at the same time.
  • a first UI element may begin to change when a press occurs, while a second UI element may begin to change some time after the press occurs.
  • a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is changed in response to the elapse of the delay time after the pressing occurs.
  • a delay factor may be determined, and the delay time is determined based on the distance and the delay factor.
  • the delay time may be the quotient of the distance divided by the delay factor.
  • the delay factor may be electronically and user configurable.
  • the first UI element with a distance of 0 (eg, UI element 5) starts to change at time T81 when the press occurs, and the UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) Changes begin at a later time T82, UI elements with a distance of 2 (eg, UI elements 2, 4, 6, 9) begin to change at a later time T83, and UI elements with a distance of 3 (eg, UI Elements 1, 10-13) begin to change at the latest T84.
  • UI elements with a distance of 0 eg, UI element 5
  • the UI elements with a distance of 1 eg, UI elements 3, 4, 7, 8
  • Changes begin at a later time T82
  • UI elements with a distance of 2 (eg, UI elements 2, 4, 6, 9) begin to change at a later time T83
  • UI elements with a distance of 3 (eg, UI Elements 1, 10-13) begin to change at the latest T84.
  • the speed at which UI elements change may be controlled by a predefined curve of amplitude versus time.
  • the predefined curve can be a Bezier curve or an elastic force curve.
  • the speed at which the change occurs can be controlled by controlling the damping and stiffness coefficients of the spring.
  • the speed at which the change occurs can be controlled by controlling the coordinates of at least one of the at least one control point of the Bezier curve.
  • UI elements that have changed may be restored after the press ends (eg, after the user lifts the finger off the screen).
  • the pressed UI element and the N UI elements that are changed in linkage can be restored.
  • the changed second UI element may be restored to the second UI element before the change.
  • the restoration process may be an inverse process of the change, so a detailed description thereof is omitted here.
  • FIG. 46 shows a schematic diagram of an example of a restoration 4600 of UI elements in accordance with an embodiment of the present disclosure. As shown in FIG. 46, the UI elements (eg, UI elements 1-13) after the change are all restored to their pre-change forms.
  • the UI elements eg, UI elements 1-13
  • the UI element can change from being pressed on the left side while the right side is lifted, to being lifted on the left side while the right side is pressed down, and then back to the original shape. That is to say, after the user lets go, the effect of the UI element being flipped and then restored visually is presented.
  • 46B shows a schematic diagram of an example of an angle-time curve 4600B of recovery of a UI element with a bouncing effect, according to an embodiment of the present disclosure.
  • UI element 5 is pressed and changed.
  • UI element 5 is pressed on the left, thus rotating around its reference point.
  • UI element 5 is depressed on the left side, while the right side is lifted.
  • other UI elements eg, UI elements 1-4, 6-13 also change in conjunction.
  • the user lets go.
  • the angle by which the UI element 5 is rotated is -60°.
  • UI elements with a distance of 1 eg, UI elements 3, 4, 7, and 8 rotate in conjunction with each other, but the rotation magnitude is smaller than that of UI element 5.
  • UI elements with a distance of 2 for example, UI elements 2, 6, and 9 are also rotated in conjunction, but the rotation amplitude is smaller than that of UI elements with a distance of 1.
  • UI elements with a distance of 3 for example, UI elements 1, 10-13 are also rotated in conjunction, but the rotation amplitude is smaller than that of UI elements with a distance of 2.
  • UI element 5 rotates back at an angle of 45°.
  • UI elements with a distance of 1 for example, UI elements 3, 4, 7, and 8 rotate and rebound together, but the magnitude of the rotation rebound is smaller than that of UI element 5.
  • UI elements with a distance of 2 for example, UI elements 2, 6, and 9 also rotate and rebound in conjunction, but the magnitude of the rotation rebound is smaller than that of UI elements with a distance of 1.
  • UI elements with a distance of 3 for example, UI elements 1, 10-13 also rotate and rebound in linkage, but the magnitude of the rotation rebound is smaller than that of UI elements with a distance of 2.
  • the rotation angles in Figure 46B are examples only, and the UI elements may vary in any suitable pattern.
  • the rebound effect is shown as only one rebound in FIG. 46B, a rebound effect with multiple rebounds can be achieved.
  • the number of rebounds may be any suitable number of rebounds, and the present disclosure is not limited herein.
  • the rebound magnitude of the multiple rebounds may decrease over time.
  • 46C shows a schematic diagram of an example of a recovered angular time curve 4600C of a UI element with the rebound effect of multiple rebounds with reduced rebound amplitudes, according to an embodiment of the present disclosure.
  • the UI element recovers to its original shape after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) rebounds with a greater rotation amplitude (eg, rotation angle) than the UI with a distance of 1 elements (eg UI elements 3, 4, 7, 8).
  • a UI element with a distance of 1 bounces with a greater rotation magnitude than a UI element with a distance of 2 (eg, UI elements 2, 6, 9).
  • a UI element with a distance of 2 bounces with a greater rotation magnitude than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
  • the springback effect may also be controlled by predefined curves (eg, elastic force curves, Bezier curves, etc.).
  • predefined curves eg, elastic force curves, Bezier curves, etc.
  • these UI elements can bounce back and forth with animation effects controlled by predefined curves.
  • Figure 47 shows an animation implementation schematic 4700 in accordance with an embodiment of the present disclosure.
  • animation is essentially the real-time display of UI or UI elements based on refresh rate. Due to the human vision persistence principle, the user feels that the picture is moving.
  • the animation transitions from the initial state of the animation to the final state of the animation after the animation time has elapsed.
  • the animation can be controlled by the animation type and animation transformation form.
  • animation types may include displacement animations, rotation animations, scale animations, and transparency animations, among others.
  • the animation transformation form can be controlled by controllers such as interpolators and estimators. Such a controller can be used to control the speed at which the animation is transformed during animation time.
  • the interpolator is used to set the change logic of the animation property value transitioning from the initial state to the final state, thereby controlling the rate of animation change, so that the animation can change at one or more of the rates of uniform speed, acceleration, deceleration, and parabolic rate. .
  • the electronic device 100 may set the change logic of the animation property value according to a system interpolator or a custom interpolator (eg, an elastic force interpolator, a friction force interpolator).
  • a system interpolator e.g., an elastic force interpolator, a friction force interpolator.
  • the invalidate() function is called based on the animation property value to refresh the view, that is, the onDraw() function is called to redraw and display the view.
  • the electronic device 100 customizes an elastic force interpolator.
  • the parameters of the function of the elastic force interpolator include at least stiffness and damping.
  • the function code for an elastic force interpolator can be expressed as one of the following: “SpringInterpolator(float stiffness,float damping)", “SpringInterpolator(float stiffness,float damping,float endPos)", “SpringInterpolator(float stiffness,float)” damping,float endPos,float velocity)", “SpringInterpolator(float stiffness,float damping,float endPos,float velocity,float valueThreshold)".
  • the parameter endPos represents the relative displacement, that is, the difference between the initial position of the spring and the rest position.
  • endPos may represent a relative displacement of UI elements.
  • the parameter velocity represents the initial velocity.
  • velocity may represent the initial velocity of UI elements.
  • the parameter valueThreshold indicates the threshold for judging animation stop.
  • the animation stops running.
  • the larger the threshold the easier it is for the animation to stop and the shorter the run time; conversely, the longer the animation runs.
  • the value of the threshold can be set according to specific animation properties.
  • the default value of the elastic interpolator FloatValueHold parameter is 1/1000, and the threshold value is 1 in other construction methods.
  • the suggested values shown in Table 1 can be used according to the animation properties.
  • the threshold can directly use the following constants provided by the DynamicAnimation class: MIN_VISIBLE_CHANGE_PIXELS, IN_VISIBLE_CHANGE_ROTATION_DEGREES, MIN_VISIBLE_CHANGE_ALPHA, MIN_VISIBLE_CHANGE_SCALE.
  • the specific code of the animation class of the custom elastic force interpolator can be expressed as follows:
  • PhysicalInterpolatorBase interpolator new SpringInterpolator(400F, 40F, 200F, 2600F, 1F);
  • ObjectAnimator animator ObjectAnimator.ofFloat(listView, "translationY”, 0, 346);
  • electronic device 100 customizes a friction interpolator.
  • the function code for the friction interpolator can be expressed as "FlingInterpolator(float initVelocity, float friction)". Among them, initVelocity represents the initial velocity, and friction represents the frictional force.
  • the concrete code for an animation class using a friction interpolator can be represented as follows:
  • ObjectAnimator animator ObjectAnimator.ofFloat(listView,”translationY",0,interpolator.getEndOffset());
  • animator.setInterpolator (interpolator);//Set the custom interpolator to the animation class animator.start();"//Run the animation.
  • the electronic device 100 can set the animation time (Duration) and start position by itself; it can also call the engine model to obtain the animation time (Duration) and end position, and then set them to the animation class (Animator class).
  • the code for the electronic device 100 to call the engine model to obtain the animation time may be expressed as "com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#getDuration".
  • the code that calls the engine model to get the end position of the spring can be expressed as "com.xxx.dynamic animation.interpolator.PhysicalInterpolatorBase#getEndOffset”.
  • the code to set the parameter valueThreshold may be represented as "com.xxx.dynamic animation.interpolator.PhysicalInterpolatorBase#setValueThreshold”.
  • the code using the elastic engine animation class can be expressed as one of the following codes: "SpringAnimation(K object,FloatPropertyCompat ⁇ K>property,float stiffness,float damping,float startValue,float endValue,float velocity )", "SpringAnimation(K object,FloatPropertyCompat ⁇ K>property,float stiffness,float damping,float endValue,float velocity)”.
  • the parameter object represents the animation object
  • Property represents the animation class or the property object of the interpolator. See Table 1, this parameter can be used to indirectly set valueThreshold. This parameter is optional in the interpolator version. When valueThreshold has been set in other ways, this parameter can be omitted, that is, the construction method without the property parameter can be used directly. This parameter is required in the animation version.
  • the DynamicAnimation class already provides the following constants that can be used directly:
  • the electronic device 100 may also implement the ViewProperty interface by definition.
  • concrete code using the Spring Engine animation class can be expressed as follows:
  • “SpringAnimation animation SpringAnimation(listView,DynamicAnimation.TRANSLATION_Y,400F,40F,0,1000F);
  • the code using the friction engine animation class can be expressed as: "FlingAnimation(K object, FloatPropertyCompat ⁇ K> property, float initVelocity, float friction)”.
  • concrete code using the friction animation class can be expressed as follows:
  • Figure 48 shows a schematic diagram of a system framework 4800 for implementing "linkage" animation effects capabilities or functions according to an embodiment of the present disclosure.
  • the animation capabilities of the UI framework are based on Android or Hongmeng It is implemented by the overall architecture of the system, including the mainstream 4-layer logic processing, and the data processing process is presented to the user from the bottom to the top. Users mainly use and experience animation functions at the application layer.
  • the capability interaction relationship between the desktop and the UI framework is shown in FIG. 48 .
  • the system framework 4800 may include an application layer 4810 , an application framework layer 4830 , a hardware abstraction layer 4850 , and a kernel layer 4870 .
  • Application layer 4810 may include desktop 4812.
  • UI element operations 4814 may be implemented on the desktop 4812.
  • the UI element operation 4814 may include, for example, a drag operation, a press operation, a deep press operation, and the like.
  • the application framework layer 4830 may include system services 4832 and extension services 4834.
  • System services 4832 may include various system services, such as Service 4833.
  • Extension services 4834 may include various extension services, such as SDK 4835.
  • a hardware abstraction layer (HAL) 4850 may include HAL 3.0 4852 and algorithm Algo 4854.
  • Kernel layer 4870 may include drivers 4872 and physical devices 4874. Physical device 4874 may provide raw parameter streams to driver 4872, and driver 4872 may provide functional processing parameter streams to physical device 4874. As further shown in FIG.
  • the UI framework 4820 for implementing the linkage motion effect 4825 may be implemented between the application layer 4810 and the application framework layer 4830 .
  • UI framework 4820 may include platform capabilities 4822 and system capabilities 4824, both of which may be used to provide linkage animation 4825.
  • the linkage animation 4825 may in turn be provided to the UI element operations 4814 of the application layer 4810.
  • FIG. 49 shows a schematic diagram of the relationship between the application side and the UI framework side involved in the "linkage" animation effect capability or function according to an embodiment of the present disclosure.
  • the application side 4910 may include a desktop 4915, and UI elements on the desktop 4915 may implement operations such as dragging, pressing, and deep pressing.
  • the UI frame side 4950 may include UI frame motion effects 4952.
  • the UI frame motion effects 4952 may implement the linkage motion effect capability 4954.
  • the linkage motion effect capability 4954 may be implemented by means of AAR format 4951, JAR format 4953, and system interface 4955.
  • the application side 4910 can call the "linkage" animation effect capability or function provided by the UI framework side 4950 by integrating 4930 and calling 4940.
  • embodiments of the present disclosure implement a new type of linkage "animation effect” that links originally independent UI elements (eg, icons, cards, controls, etc.).
  • FIG. 50 shows a schematic diagram of a specific description of three ways of implementing the “linkage” animation effect capability or function according to an embodiment of the present disclosure.
  • the relationship 5001 between the AAR format 4951 and the system of the electronic device 100 is as follows: AAR format 4951 is packaged with capabilities in a binary format, which provides the ability to integrate the application side in the system, and can freely control the version rhythm, Do not follow the system.
  • the relationship 5003 between the JAR format 4953 and the system of the electronic device 100 is as follows: the JAR format 4953 is packaged with capabilities in a binary format, provides capabilities for all components in the system, and can freely control the version rhythm without following the system.
  • the relationship 5005 between the system interface 4955 and the system of the electronic device 100 is: the system interface 4955 is the interface of the framework layer in the system version, and provides the capability of all components in the system, following the system upgrade.
  • the focus of the present disclosure is the realization of the linkage dynamic effect capability.
  • integration is the way of AAR and JAR
  • invocation is the way of system interface.
  • the scene is not limited, but the way the ability is displayed is inconsistent. That is to say, the functions of the various methods described above in the present disclosure may be implemented through an AAR format file, a JAR format file, and/or a system interface of the electronic device 100 . In this way, the ability or functionality to "link" animation effects can be simply and conveniently implemented and provided to an application of an electronic device, such as a desktop.

Abstract

The present disclosure relates to a graphical interface display method, an electronic device, a computer-readable storage medium, and a computer program product. According to the graphical interface display method described herein, M user interface (UI) elements are displayed on a screen of an electronic device, and M is a positive integer greater than 1. Pressing that acts on a first UI element of the M UI elements is detected. In response to the pressing, each of the N UI elements on the screen is caused to change with a corresponding animation effect, and N is a positive integer between 1 and M-1. Causing the N UI elements to change with the corresponding animation effects comprises: determining a distance between the first UI element and a second UI element of the N UI elements; determining, on the basis of the distance and the position of the pressing in a UI, an animation effect that the second UI element changes; and causing the second UI element to change with the animation effect to visually indicate the pressing. In this way, the relationship between the animation effects of different UI elements can be enhanced, and the relationship between independent UI elements is highlighted, such that the animation effect of the UI better conforms to usage habits of users, thereby significantly improving user experience.

Description

图形界面显示方法、电子设备、介质以及程序产品Graphical interface display method, electronic device, medium and program product 技术领域technical field
本公开总体上涉及信息技术领域,并且更特别地涉及一种图形界面显示方法、电子设备、计算机可读存储介质以及计算机程序产品。The present disclosure generally relates to the field of information technology, and more particularly, to a graphical interface display method, an electronic device, a computer-readable storage medium, and a computer program product.
背景技术Background technique
随着信息技术的发展,各种类型的电子设备被配备有各种类型的屏幕。为此,屏幕上的用户界面(UI)的显示效果及风格成为影响用户体验的关键要素。动画已经成为UI中至关重要的一部分。随着智能电话等电子设备的性能提高,动画也随之发展。高刷新率、高渲染度、高复杂度的动画越来越多。因此,需要进一步改进动画的显示,以提高用户体验。With the development of information technology, various types of electronic devices are equipped with various types of screens. For this reason, the display effect and style of the user interface (UI) on the screen become the key elements affecting the user experience. Animation has become a vital part of UI. As the performance of electronic devices such as smartphones increased, so did animation. There are more and more animations with high refresh rate, high rendering degree and high complexity. Therefore, the display of animation needs to be further improved to improve user experience.
发明内容SUMMARY OF THE INVENTION
根据本公开的一些实施例,提供了一种图形界面显示方法、电子设备、介质以及程序产品,能够加强不同UI元素的动画效果之间的联系,突出各个独立UI元素之间的关系,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。According to some embodiments of the present disclosure, a graphical interface display method, electronic device, medium, and program product are provided, which can strengthen the connection between animation effects of different UI elements, highlight the relationship between individual UI elements, and make UI The animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
在本公开的第一方面,提供了一种图形界面显示方法。根据第一方面的图形界面显示方法,在电子设备的屏幕上显示M个用户界面UI元素,M为大于1的正整数。检测到作用于M个UI元素中的第一UI元素处的按压。响应于按压,使屏幕上的N个UI元素中的每个UI元素以相应动画效果发生变化,N为1与M-1之间的正整数。使N个UI元素以相应动画效果发生变化包括:确定第一UI元素与N个UI元素中的第二UI元素之间的距离;基于距离以及按压在UI中的位置,来确定第二UI元素发生变化的动画效果;以及使第二UI元素以动画效果发生变化,以从视觉上指示按压。以此方式,能够加强不同UI元素的动画效果之间的联系,突出各个独立UI元素之间的关系,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In a first aspect of the present disclosure, a graphical interface display method is provided. According to the graphical interface display method of the first aspect, M user interface UI elements are displayed on the screen of the electronic device, where M is a positive integer greater than 1. A press on a first UI element of the M UI elements is detected. In response to the press, each of the N UI elements on the screen is changed with a corresponding animation effect, where N is a positive integer between 1 and M-1. Making the N UI elements change with corresponding animation effects includes: determining a distance between the first UI element and a second UI element among the N UI elements; and determining the second UI element based on the distance and the pressed position in the UI animating the change; and animating the second UI element to visually indicate the press. In this way, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted, so that the UI animation effects are more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,为了确定距离,可以确定第一UI元素的第一基准点和第二UI元素的第二基准点;以及确定第一基准点与第二基准点之间的距离作为距离。以此方式,可以基于所确定的UI元素的基准点来确定距离,从而提高所确定的距离的准确性和距离确定方式的灵活性,由此提高用户体验。In some implementations, to determine the distance, a first reference point of the first UI element and a second reference point of the second UI element may be determined; and a distance between the first reference point and the second reference point may be determined as the distance. In this way, the distance can be determined based on the determined reference point of the UI element, thereby improving the accuracy of the determined distance and the flexibility of the way of determining the distance, thereby improving the user experience.
在一些实现方式中,为了确定距离,可以确定第一UI元素的第一基准点;从以第一基准点为圆心的、具有各自半径的多个圆中,确定与第二UI元素相交并且半径最小的目标圆;以及将目标圆的半径确定为距离。以此方式,可以更简单和方便地确定UI元素之间的距离,从而提高距离确定方式的灵活性,由此提高用户体验。In some implementations, in order to determine the distance, a first reference point of the first UI element may be determined; from a plurality of circles having respective radii centered on the first reference point, the intersection with the second UI element and the radius is determined the smallest target circle; and determining the radius of the target circle as the distance. In this way, the distance between UI elements can be determined more simply and conveniently, thereby improving the flexibility of the way of determining the distance, thereby improving the user experience.
在一些实现方式中,为了确定距离,可以确定第一UI元素与第二UI元素之间的横向间距;确定第一UI元素与第二UI元素之间的纵向间距;以及基于如下任一项来确定距离:横向间距和纵向间距中的至少一者,或横向间距和纵向间距中的至少一者、以及从第二UI元素的第二基准点指向第一UI元素的第一基准点的方向。以此方式,可以基于UI元素之间的间距来确定UI元素之间的距离,从而提高距离确定方式的灵活性,由此提高用户体验。In some implementations, to determine the distance, the horizontal spacing between the first UI element and the second UI element can be determined; the vertical spacing between the first UI element and the second UI element can be determined; and based on any of the following: Determine distance: at least one of horizontal spacing and vertical spacing, or at least one of horizontal spacing and vertical spacing, and a direction from the second fiducial point of the second UI element to the first fiducial point of the first UI element. In this way, the distance between UI elements can be determined based on the spacing between UI elements, thereby improving flexibility in the manner of distance determination, thereby improving user experience.
在一些实现方式中,方法还可以包括:基于第一UI元素的尺寸来确定第一UI元素的影 响区域;以及将M个UI元素中在影响区域内的UI元素确定为N个UI元素。以此方式,可以基于被按压的UI元素的尺寸来确定跟随该UI元素进行联动变化的UI元素,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the method may further include: determining an area of influence of the first UI element based on a size of the first UI element; and determining a UI element within the area of influence among the M UI elements as N UI elements. In this way, the UI element that changes in linkage with the UI element can be determined based on the size of the pressed UI element, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,方法还可以包括:将M个UI元素中除第一UI元素以外的M-1个UI元素确定为N个UI元素。以此方式,可以使得屏幕上除了被按压的UI元素都跟随该UI元素进行联动变化,从而更简单和方便地确定联动变化的UI元素,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the method may further include: determining M-1 UI elements other than the first UI element among the M UI elements as N UI elements. In this way, all the UI elements on the screen except the pressed UI elements can be linked and changed with the UI elements, so that the UI elements that are linked and changed can be determined more simply and conveniently, and the animation effect of the UI can be more in line with the user's usage habits, so that it is more obvious. Improve user experience.
在一些实现方式中,动画效果可以包括:视觉上相对于按压的位置以翘板方式移动位置,或视觉上相对于按压的位置的凹陷或突出。以此方式,可以直观地呈现UI元素被压下的动画效果,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the animation effect may include a rocker-like movement of the position visually relative to the position of the press, or a depression or protrusion visually relative to the position of the press. In this way, the animation effect of the UI element being pressed can be presented intuitively, so that the animation effect of the UI is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,为了确定动画效果,可以确定第一UI元素响应于按压而发生变化的第一幅度;以及基于如下任一项来确定第二UI元素响应于按压而发生变化的幅度:第一幅度和距离,或第二UI元素的尺寸和第一UI元素的尺寸中的至少一者、第一幅度、以及距离。以此方式,可以使得第一UI元素的动画效果被传导到第二UI元素,并且进一步使得第二UI元素的动画效果基于第一UI元素与第二UI元素之间的距离以及第二UI元素的尺寸来确定,由此可以使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, in order to determine the animation effect, the first magnitude of the change of the first UI element in response to the press may be determined; and the magnitude of the change of the second UI element in response to the press may be determined based on any of the following: A magnitude and a distance, or at least one of a size of the second UI element and a size of the first UI element, a first magnitude, and a distance. In this way, the animation effect of the first UI element can be caused to be conducted to the second UI element, and further the animation effect of the second UI element can be caused to be based on the distance between the first UI element and the second UI element and the second UI element The size of the UI can be determined, so that the animation effect of the UI can be more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,第一UI元素的变化的第一幅度可以基于与第一UI元素相关联的以下至少一项来确定:第一UI元素的尺寸,第一UI元素的第一基准点的位置,第一UI元素能够发生变化的幅度范围,按压的位置,按压的持续时间,和预定按压力。以此方式,可以基于与第一UI元素相关联的各种因素,直观、合理和灵活地确定第一UI元素的变化的第一幅度,由此可以使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the first magnitude of change of the first UI element may be determined based on at least one of the following associated with the first UI element: a size of the first UI element, a size of the first reference point of the first UI element The position, the range of the amplitude that the first UI element can change, the position of the pressing, the duration of the pressing, and the predetermined pressing force. In this way, the first magnitude of the change of the first UI element can be determined intuitively, reasonably and flexibly based on various factors associated with the first UI element, thereby making the animation effect of the UI more in line with the user's usage habits , thereby significantly improving the user experience.
在一些实现方式中,使第二UI元素发生变化可以包括:基于距离确定一个延迟时间;以及响应于按压发生后经过了延迟时间,使第二UI元素发生变化。以此方式,可以在视觉上呈现联动变化随距离进行传播,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, changing the second UI element may include: determining a delay time based on the distance; and changing the second UI element in response to the delay time elapsed after the pressing occurs. In this way, it is possible to visually show that the linkage change propagates with the distance, so that the animation effect of the UI is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,使第二UI元素发生变化可以包括:基于幅度随时间变化的预定义曲线,来确定第二UI元素响应于按压而发生变化的速度。以此方式,可以基于幅度随时间变化的预定义曲线来方便地控制第一UI元素的变化,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, causing the second UI element to change may include determining a speed at which the second UI element changes in response to the press based on a predefined curve of magnitude versus time. In this way, the change of the first UI element can be conveniently controlled based on a predefined curve whose amplitude varies with time, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,预定义曲线可以为贝塞尔曲线或弹性力曲线。以此方式,可以基于贝塞尔曲线或弹性力曲线来方便地控制第一UI元素的变化,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the predefined curve may be a Bezier curve or an elastic force curve. In this way, the change of the first UI element can be conveniently controlled based on the Bezier curve or the elastic force curve, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,方法还可以包括:将变化后的第二UI元素恢复为第二UI元素。以此方式,可以使UI元素在松手后恢复,使得UI的动画效果更符合用户的使用习惯,从而显著提高用户体验。In some implementations, the method may further include: restoring the changed second UI element to the second UI element. In this way, the UI element can be restored after being released, so that the UI animation effect is more in line with the user's usage habits, thereby significantly improving the user experience.
在一些实现方式中,方法可以通过AAR格式文件、JAR格式文件和系统接口中的至少一者来实现。以此方式,可以简单和方便地实现具有联动变化的图形界面显示。In some implementations, the method may be implemented by at least one of an AAR format file, a JAR format file, and a system interface. In this way, a graphical interface display with linked changes can be realized simply and conveniently.
在本公开的第二方面,提供了一种电子设备。电子设备包括处理器以及存储有指令的存储器,其中指令在被处理器执行时使得电子设备执行根据第一方面及其实现方式的任一方法。In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes a processor and a memory storing instructions, wherein the instructions, when executed by the processor, cause the electronic device to perform any of the methods according to the first aspect and implementations thereof.
在本公开的第三方面,提供了一种计算机可读存储介质。计算机可读存储介质存储有指令,其中指令在被处理器执行时使得电子设备执行根据第一方面及其实现方式的任一方法。In a third aspect of the present disclosure, a computer-readable storage medium is provided. A computer-readable storage medium stores instructions, wherein the instructions, when executed by a processor, cause an electronic device to perform any of the methods according to the first aspect and implementations thereof.
在本公开的第四方面,提供了一种计算机程序产品。计算机程序产品包括指令,其中指令在被处理器执行时使得电子设备执行根据第一方面及其实现方式的任一方法。In a fourth aspect of the present disclosure, a computer program product is provided. The computer program product comprises instructions, wherein the instructions, when executed by a processor, cause an electronic device to perform any of the methods according to the first aspect and implementations thereof.
应当理解,发明内容部分中所描述的内容并非旨在限定本公开的实施例的关键或重要特征,亦非用于限制本公开的范围。本公开的其它特征将通过以下的描述变得容易理解。It should be understood that the matters described in this Summary are not intended to limit key or critical features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
附图说明Description of drawings
结合附图并参考以下详细说明,本公开各实现方式的特征、优点及其他方面将变得更加明显。在此以示例性而非限制性的方式示出了本公开的若干实现方式,在附图中:The features, advantages, and other aspects of various implementations of the present disclosure will become more apparent when taken in conjunction with the accompanying drawings and with reference to the following detailed description. Several implementations of the present disclosure are shown herein by way of example and not by way of limitation, in the accompanying drawings:
图1A至1B示出了可以实施本公开的实施例的一种电子设备的硬件结构和软件结构的示意图。1A to 1B show schematic diagrams of the hardware structure and the software structure of an electronic device that can implement embodiments of the present disclosure.
图2示出了可以实施本公开的实施例的另一种电子设备的框图。2 shows a block diagram of another electronic device that may implement embodiments of the present disclosure.
图3A-3C分别示出了根据本公开的一些实施例的示例UI的示意图。3A-3C respectively illustrate schematic diagrams of example UIs according to some embodiments of the present disclosure.
图4示出了根据本公开的一些实施例的示例拖拽联动的示意图。4 shows a schematic diagram of an example drag linkage in accordance with some embodiments of the present disclosure.
图5A和5B分别示出了根据本公开的一些实施例的摩擦力模型的示例速度时间曲线和示例位移时间曲线的示意图。5A and 5B show schematic diagrams, respectively, of an example velocity time curve and an example displacement time curve of a friction model according to some embodiments of the present disclosure.
图6示出了根据本公开的一些实施例的移动位置受限和非受限的示例的示意图。6 shows a schematic diagram of examples of restricted and non-restricted mobile locations in accordance with some embodiments of the present disclosure.
图7A-7C分别示出了根据本公开的一些实施例的临界阻尼状态、欠阻尼状态和过阻尼状态下的弹簧形变量x随时间t的曲线的示例的示意图。7A-7C show schematic diagrams of examples of curves of spring deflection x versus time t for critically damped, under-damped, and over-damped states, respectively, according to some embodiments of the present disclosure.
图8示出了根据本公开的实施例的图形界面显示方法的流程图。FIG. 8 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
图9示出了根据本公开的实施例的UI元素的影响区域的示例的示意图。9 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
图10示出了根据本公开的实施例的距离的确定的示例的示意图。FIG. 10 shows a schematic diagram of an example of the determination of a distance according to an embodiment of the present disclosure.
图11A-11C示出了根据本公开的实施例的距离的确定的示例的示意图。11A-11C illustrate schematic diagrams of examples of distance determinations according to embodiments of the present disclosure.
图12示出了根据本公开的实施例的距离的确定的示例的示意图。FIG. 12 shows a schematic diagram of an example of distance determination according to an embodiment of the present disclosure.
图13示出了根据本公开的实施例的距离的确定的示例的示意图。FIG. 13 shows a schematic diagram of an example of the determination of distance according to an embodiment of the present disclosure.
图14A和14B示出了根据本公开的实施例的距离的确定的示例的示意图。14A and 14B illustrate schematic diagrams of examples of distance determination according to embodiments of the present disclosure.
图15示出了根据本公开的实施例的延迟时间的示例的示意图。FIG. 15 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
图16A示出了根据本公开的实施例的UI元素完全跟手移动的场景的示例的示意图。16A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
图16B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线的示例的示意图。16B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with a hand according to an embodiment of the present disclosure.
图17A示出了根据本公开的实施例的UI元素不完全跟手移动的场景的示例的示意图。17A shows a schematic diagram of an example of a scenario in which UI elements do not completely follow the hand, according to an embodiment of the present disclosure.
图17B示出了根据本公开的实施例的UI元素不完全跟手移动的场景的位移时间曲线的示例的示意图。17B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element does not completely move with the hand, according to an embodiment of the present disclosure.
图18A示出了根据本公开的实施例的UI元素完全跟手移动的场景的示例的示意图。18A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
图18B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线的示例的示意图。18B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with a hand according to an embodiment of the present disclosure.
图19A示出了根据本公开的实施例的UI元素完全跟手移动的场景的示例的示意图。19A shows a schematic diagram of an example of a scene in which a UI element moves completely with the hand, according to an embodiment of the present disclosure.
图19B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线的示 例的示意图。19B shows a schematic diagram of an example of a displacement time curve of a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
图20示出了根据本公开的一些实施例的UI元素在被按压时的变化的示例的示意图。20 shows a schematic diagram of an example of a UI element changing when pressed, according to some embodiments of the present disclosure.
图21示出了根据本公开的一些实施例的UI元素在不同位置处被按压时的变化的示例的示意图。21 shows a schematic diagram of an example of a UI element changing when pressed at different locations, according to some embodiments of the present disclosure.
图22示出了根据本公开的一些实施例的UI元素在不同按压力时的变化的示例的示意图。FIG. 22 shows a schematic diagram of an example of UI element changes at different pressing forces according to some embodiments of the present disclosure.
图23示出了根据本公开的一些实施例的UI元素在不同按压持续时间时的变化的示例的示意图。23 shows a schematic diagram of an example of UI element changes at different press durations, according to some embodiments of the present disclosure.
图24示出了根据本公开的一些实施例的UI元素在不同尺寸时的变化的示例的示意图。24 shows a schematic diagram of an example of UI elements changing at different sizes, according to some embodiments of the present disclosure.
图25示出了根据本公开的实施例的图形界面显示方法的流程图。FIG. 25 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
图26示出了根据本公开的实施例的N个UI元素的深度联动的示例的示意图。FIG. 26 shows a schematic diagram of an example of deep linkage of N UI elements according to an embodiment of the present disclosure.
图27示出了根据本公开的实施例的UI元素的影响区域的示例的示意图。27 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
图28示出了根据本公开的实施例的基于距离的UI元素的缩放的示例的示意图。28 shows a schematic diagram of an example of distance-based scaling of UI elements, according to an embodiment of the present disclosure.
图29示出了根据本公开的实施例的延迟时间的示例的示意图。FIG. 29 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
图30示出了根据本公开的具有延迟时间的UI元素的缩放的示例的示意图。30 shows a schematic diagram of an example of scaling of UI elements with a delay time in accordance with the present disclosure.
图31示出了根据本公开的实施例的UI元素的移动的位移的示例的示意图。31 shows a schematic diagram of an example of displacement of movement of UI elements according to an embodiment of the present disclosure.
图32A-32B分别示出了根据本公开的实施例的没有位移的UI元素的恢复和具有位移的UI元素的恢复的示例的示意图。32A-32B illustrate schematic diagrams of examples of restoration of UI elements without displacement and restoration of UI elements with displacement, respectively, according to embodiments of the present disclosure.
图33A-33B分别示出了根据本公开的实施例的具有回弹效果的UI元素的恢复的尺寸时间曲线和位移时间曲线的示例的示意图,并且图33C-33D分别示出了根据本公开的实施例的具有回弹幅度减小的多次回弹的回弹效果的UI元素的恢复的尺寸时间曲线和位移时间曲线的示例的示意图。FIGS. 33A-33B respectively show schematic diagrams of an example of a restored size time curve and a displacement time curve of a UI element with a springback effect according to an embodiment of the present disclosure, and FIGS. 33C-33D respectively show a A schematic diagram of an example of the restored size time curve and displacement time curve of a UI element with the rebound effect of multiple rebounds with reduced rebound amplitudes of an embodiment.
图34示出了根据本公开的一些实施例的作为刚体的UI元素在被按压时的变化的示例的示意图。34 shows a schematic diagram of an example of a UI element that is a rigid body changing when pressed, according to some embodiments of the present disclosure.
图35示出了根据本公开的一些实施例的模拟UI元素的按压的弹簧的按压和拉伸的示例的示意图。35 shows a schematic diagram of an example of pressing and stretching of a spring that simulates pressing of a UI element, according to some embodiments of the present disclosure.
图36示出了根据本公开的一些实施例的作为非刚体的UI元素在被按压时的变化的示例的示意图。36 shows a schematic diagram of an example of a UI element that is a non-rigid body when pressed, according to some embodiments of the present disclosure.
图37示出了根据本公开的一些实施例的UI元素在不同按压力时的变化的示例的示意图。Figure 37 shows a schematic diagram of an example of UI element changes at different pressing forces, according to some embodiments of the present disclosure.
图38示出了根据本公开的一些实施例的UI元素在不同按压持续时间时的变化的示例的示意图。38 shows a schematic diagram of an example of UI element changes at different press durations, according to some embodiments of the present disclosure.
图39示出了根据本公开的一些实施例的UI元素在不同尺寸时的变化的示例的示意图。39 shows a schematic diagram of an example of UI elements changing at different sizes in accordance with some embodiments of the present disclosure.
图40示出了根据本公开的实施例的图形界面显示方法的流程图。FIG. 40 shows a flowchart of a graphical interface display method according to an embodiment of the present disclosure.
图41示出了根据本公开的实施例的N个UI元素的压力联动的示例的示意图。41 shows a schematic diagram of an example of pressure linkage of N UI elements according to an embodiment of the present disclosure.
图42示出了根据本公开的实施例的N个UI元素的压力联动的另一示例的示意图。42 shows a schematic diagram of another example of pressure linkage of N UI elements according to an embodiment of the present disclosure.
图43示出了根据本公开的实施例的UI元素的影响区域的示例的示意图。43 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure.
图44示出了根据本公开的实施例的基于距离的UI元素的变化的示例的示意图。44 shows a schematic diagram of an example of a distance-based UI element change according to an embodiment of the present disclosure.
图45示出了根据本公开的实施例的延迟时间的示例的示意图。FIG. 45 shows a schematic diagram of an example of a delay time according to an embodiment of the present disclosure.
图46A示出了根据本公开的实施例的UI元素的恢复的示例的示意图。46A shows a schematic diagram of an example of restoration of UI elements according to an embodiment of the present disclosure.
图46B示出了根据本公开的实施例的具有回弹效果的UI元素的恢复的角度时间曲线的 示例的示意图。46B shows a schematic diagram of an example of an angle-time curve of recovery of a UI element with a bouncing effect, according to an embodiment of the present disclosure.
图46C示出了根据本公开的实施例的具有回弹幅度减小的多次回弹的回弹效果的UI元素的恢复的角度时间曲线的示例的示意图。46C shows a schematic diagram of an example of an angle-time curve of recovery of a UI element with a rebound effect of multiple rebounds with reduced rebound amplitudes, according to an embodiment of the present disclosure.
图47示出了根据本公开的实施例的动画实现原理图。FIG. 47 shows a schematic diagram of animation implementation according to an embodiment of the present disclosure.
图48示出了根据本公开的实施例的用于实现“联动”动画效果能力或功能的系统框架的示意图。Figure 48 shows a schematic diagram of a system framework for implementing "linkage" animation effect capabilities or functions according to an embodiment of the present disclosure.
图49示出了根据本公开的实施例的“联动”动画效果能力或功能所涉及到的应用侧和UI框架侧之间的关系的示意图。FIG. 49 shows a schematic diagram of the relationship between the application side and the UI framework side involved in the "linkage" animation effect capability or function according to an embodiment of the present disclosure.
图50示出了根据本公开的实施例的“联动”动画效果能力或功能实现的三种方式的具体说明的示意图。FIG. 50 shows a schematic diagram of a specific description of three ways of implementing the “linkage” animation effect capability or function according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for the purpose of A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
下面将参照附图更详细地描述本公开的一些示例实现。虽然附图中显示了本公开的一些示例实现,然而,应该理解,可以以各种形式实现本公开而不应被这里阐述的示例实现所限制。相反,提供这些实现是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。Some example implementations of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some example implementations of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited by the example implementations set forth herein. Rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
在本文中使用的术语“包括”及其变形表示开放性包括,即“包括但不限于”。除非特别申明,术语“或”表示“和/或”。术语“基于”表示“至少部分地基于”。术语“实施例”和“一些实施例”表示“至少一些实施例”。术语“第一”、“第二”等描述,是用于区分不同的对象等,其不代表先后顺序,也不限定“第一”和“第二”是不同的类型。As used herein, the term "including" and variations thereof mean open-ended inclusion, ie, "including but not limited to". The term "or" means "and/or" unless specifically stated otherwise. The term "based on" means "based at least in part on". The terms "embodiments" and "some embodiments" mean "at least some embodiments." The terms "first", "second", etc. are used for description to distinguish different objects, etc., and do not represent the order of precedence, nor do they limit the "first" and "second" to be different types.
在本文中使用的术语“UI”表示用户与应用程序或操作系统进行交互和信息交换的接口,它实现信息的内部形式与用户可以接受形式之间的转换。例如,应用程序的UI是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,UI源代码在电子设备上经过解析,渲染,最终呈现为用户可以识别的内容,比如图片、文字、按钮等UI元素。As used herein, the term "UI" refers to the interface through which the user interacts with the application or operating system and exchanges information, which enables the conversion between the internal form of the information and the form acceptable to the user. For example, the UI of an application is source code written in a specific computer language such as java, extensible markup language (XML), etc. The UI source code is parsed and rendered on the electronic device, and finally presented as content that the user can recognize , such as images, text, buttons and other UI elements.
在某些实施例中,UI中的UI元素的属性和内容是通过标签或者节点来定义的,比如XML通过<Textview>、<ImgView>、<VideoView>等节点来规定UI所包含的UI元素。一个节点对应UI中一个UI元素或属性,节点经过解析和渲染之后呈现为用户可视的内容。此外,很多应用程序,比如混合应用(hybrid application)的UI中通常还包含有网页。网页可以理解为内嵌在应用程序UI中的一个特殊的UI元素,网页是通过特定计算机语言编写的源代码,例如超文本标记语言(hyper text markup language,HTML),层叠样式表(cascading style sheets,CSS),java脚本(JavaScript,JS)等,网页源代码可以由浏览器或与浏览器功能类似的网页显示组件加载和显示为用户可识别的内容。网页所包含的具体内容也是通过网页源代码中的标签或者节点来定义的,比如HTML通过<p>、<img>、<video>、<canvas>来定义网页的元素和属性。In some embodiments, the attributes and content of UI elements in the UI are defined by tags or nodes. For example, in XML, the UI elements contained in the UI are specified by nodes such as <Textview>, <ImgView>, and <VideoView>. A node corresponds to a UI element or attribute in the UI. After parsing and rendering, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, often contain web pages in their UI. A web page can be understood as a special UI element embedded in the UI of an application. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (cascading style sheets) , CSS), java script (JavaScript, JS), etc., the web page source code can be loaded and displayed as user-identifiable content by a browser or a web page display component similar in function to a browser. The specific content contained in a web page is also defined by tags or nodes in the source code of the web page. For example, HTML defines the elements and attributes of web pages through <p>, <img>, <video>, and <canvas>.
在本文中使用的术语“UI元素”包括但不限于:窗口(window)、滚动条(scrollbar)、表格视图(tableview)、按钮(button)、菜单栏(menu bar)、文本框(text box)、导航栏、工具栏(toolbar)、图像(image)、静态文本(tatictext)、部件(Widget)等可视的UI元素。The term "UI element" as used herein includes, but is not limited to: window, scrollbar, tableview, button, menu bar, text box , Navigation bar, toolbar (toolbar), image (image), static text (tatictext), widget (Widget) and other visual UI elements.
在本公开的实施例中描述的一些流程中,包含了按照特定顺序出现的多个操作或步骤,但是应该理解,这些操作或步骤可以不按照其在本公开的实施例中出现的顺序来执行或并行执行,操作的序号仅用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作或步骤可以按顺序执行或并行执行,并且这些操作或步骤可以进行组合。In some processes described in the embodiments of the present disclosure, multiple operations or steps appear in a specific order, but it should be understood that these operations or steps may not be performed in accordance with the order in which they appear in the embodiments of the present disclosure Or in parallel, the sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. Additionally, the flows may include more or fewer operations, and the operations or steps may be performed sequentially or in parallel, and the operations or steps may be combined.
在诸如Android和iOS的移动操作系统中,动画本质上是基于刷新率实时显示用户界面UI或UI元素。由于人类的视觉暂留原理,使得用户感觉画面是运动的。动画从动画的初态在经过动画时间之后变换为动画的终态。在这个变换过程中,动画可以由动画类型和动画变换形式进行控制。例如,动画类型可以包括位移动画、旋转动画、缩放动画和透明动画等。而动画变换形式可以由插值器和估值器等控制器进行控制。这样的控制器可以用于在动画时间期间控制对动画进行变换的速度。In mobile operating systems such as Android and iOS, animations are essentially real-time display of user interface UI or UI elements based on refresh rate. Due to the human vision persistence principle, the user feels that the picture is moving. The animation transitions from the initial state of the animation to the final state of the animation after the animation time has elapsed. During this transformation, the animation can be controlled by the animation type and animation transformation form. For example, animation types may include displacement animations, rotation animations, scale animations, and transparency animations, among others. The animation transformation form can be controlled by controllers such as interpolators and estimators. Such a controller can be used to control the speed at which the animation is transformed during animation time.
然而,传统上,动画仅仅是简单的动画效果的组合,使得动画效果单一,不符合物理规律,并且没有考虑真实使用场景和用户使用习惯等。However, traditionally, animation is only a combination of simple animation effects, which makes the animation effect single, does not conform to the laws of physics, and does not consider real usage scenarios and user usage habits.
为此,本公开的实施例提出了一种图形界面显示的新方案。本公开的实施例涉及UI中的UI元素在动画效果上的联动,包括拖拽联动、深度联动和压力联动。在联动中,被操作的目标UI元素可以影响没有被操作的其他UI元素。具体地,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果。To this end, an embodiment of the present disclosure proposes a new solution for displaying a graphical interface. The embodiments of the present disclosure relate to the linkage of UI elements in the UI on animation effects, including drag linkage, depth linkage, and pressure linkage. In linkage, the manipulated target UI element can affect other UI elements that are not manipulated. Specifically, triggering the animation effect of the target UI element may jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI.
由此,可以加强不同UI元素的动画效果之间的联系,并且突出各个独立UI元素之间的关系。相比于动画效果单一、每个UI元素都是独立的且无联系的传统动画,本公开的实施例能够使得动画效果更符合物理规律,并且考虑到了真实使用场景和用户使用习惯,从而可以显著提高用户体验。Thereby, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted. Compared with the traditional animation in which the animation effect is single and each UI element is independent and unrelated, the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
以下将参考附图1A至图46描述了本公开的一些示例实施例。Some example embodiments of the present disclosure will be described below with reference to FIGS. 1A through 46 .
图1A示出了可以实施本公开的实施例的一种电子设备100的硬件结构的示意图。如图1所示,电子设备100可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、按键190、马达191、指示器192、摄像头193、显示屏194、以及用户标识模块(subscriber identification module,SIM)卡接口195等。传感器模块180可以包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、磁传感器180D、加速度传感器180E、距离传感器180F、接近光传感器180G、指纹传感器180H、温度传感器180J、触摸传感器180K、环境光传感器180L、骨传导传感器180M等。FIG. 1A shows a schematic diagram of a hardware structure of an electronic device 100 that can implement embodiments of the present disclosure. As shown in FIG. 1 , the electronic device 100 may include a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charging management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193 , a display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195 and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L, bone conduction sensor 180M, etc.
应当理解,本公开的实施例所示意的结构并不构成对电子设备100的具体限定。在本公开的另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It should be understood that the structures shown in the embodiments of the present disclosure do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present disclosure, the electronic device 100 may include more or fewer components than shown, or combine some components, or separate some components, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器 (application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口、集成电路内置音频(inter-integrated circuit sound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、通用输入输出(general-purpose input/output,GPIO)接口、用户标识模块(subscriber identity module,SIM)接口、和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K、充电器、闪光灯、摄像头193等。例如,处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces. For example, the processor 110 can couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the electronic device 100 .
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 . In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样、量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communications, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如,处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160 . For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194、摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI)、显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 . MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc. In some embodiments, the processor 110 communicates with the camera 193 through a CSI interface, so as to realize the photographing function of the electronic device 100 . The processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the electronic device 100 .
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信 号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193、显示屏194、无线通信模块160、音频模块170、传感器模块180等。GPIO接口还可以被配置为I2C接口、I2S接口、UART接口、MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口、Micro USB接口、USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本公开的实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本公开的另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present disclosure is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present disclosure, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。The charging management module 140 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger through the USB interface 130 . In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , the electronic device 100 can also be powered by the power management module 141 .
电源管理模块141用于连接电池142、充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、显示屏194、摄像头193、和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如,可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like. Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G/6G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G/6G etc. applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A、受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或 其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络)、蓝牙(Bluetooth,BT)、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 may provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR). The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址接入(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、时分码分多址(time-division codedivision multiple access,TD-SCDMA)、长期演进(long term evolution,LTE)、5G以及后续演进标准、BT、GNSS、WLAN、NFC、FM、和/或IR技术等。其中GNSS可以包括全球卫星定位系统(global positioning system,GPS)、全球导航卫星系统(global navigation satellite system,GLONASS)、北斗卫星导航系统(beidou navigation satellite system,BDS)、准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), 5G and subsequent evolution standards, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi- zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
电子设备100通过GPU、显示屏194、以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可以包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。ISP用于处理摄像头193反馈的数据。例如,在拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like. The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变 换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point, and the like.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如,动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3、MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos of various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如图像识别、人脸识别、语音识别、文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information, and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save files such as music, video, etc. in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令、和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。 Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like. The storage data area may store data (such as audio data, phone book, etc.) created during the use of the electronic device 100 and the like. In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡、Micro SIM卡、SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 . The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 100 employs an eSIM, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本公开的实施例以分层架构的一种移动操作系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present disclosure take a mobile operating system with a layered architecture as an example to illustrate the software structure of the electronic device 100 as an example.
图1B是本公开的实施例的电子设备100的软件结构的示意图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,可以将操作系统分为四层,从上至下分别为应用程序层、应用程序框架层、操作系统运行时(runtime)和系统库、以及内核层。FIG. 1B is a schematic diagram of a software structure of the electronic device 100 according to an embodiment of the present disclosure. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system may be divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an operating system runtime and system library, and a kernel layer.
应用程序层可以包括一系列应用程序包。如图1B所示,应用程序包可以包括相机、图库、日历、通话、地图、导航、WLAN、蓝牙、音乐、视频、短信息等应用程序。The application layer can include a series of application packages. As shown in FIG. 1B , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图1B所示,应用程序框架层可以包括窗口管理器、内容提供器、视图系统、电话管理器、资源管理器、通知管理器等。窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频、图像、音频、拨打和接听的电话、浏览历史和书签、电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图像的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图像的视图。电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串、图标、图像、布局文件、视频文件等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。As shown in FIG. 1B, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like. A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc. Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, and the like. The view system includes visual controls, such as controls that display text, controls that display images, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface that includes an icon for an SMS notification may include a view for displaying text and a view for displaying images. The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
继续参考图1B,操作系统运行时包括核心库和虚拟机。操作系统运行时负责操作系统的调度和管理。核心库包含两部分,一部分是Java语言需要调用的功能函数,另一部分是操作系统的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的Java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理、堆栈管理、线程管理、安全和异常的管理、以及垃圾回收等功能。系统库可以包括多个功能模块。例如,表面管理器(surface manager)、媒体库(Media Libraries)、三维图形处理库(例如OpenGL ES)、2D图形引擎(例如:SGL)等。With continued reference to FIG. 1B , the operating system runtime includes core libraries and virtual machines. The operating system runtime is responsible for the scheduling and management of the operating system. The core library consists of two parts, one is the function functions that the Java language needs to call, and the other is the core library of the operating system. The application layer and the application framework layer run in virtual machines. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection. A system library can include multiple functional modules. For example, surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg OpenGL ES), 2D graphics engine (eg: SGL) and so on.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如,MPEG4、H.264、MP3、AAC、AMR、JPG、PNG等。三维图形处理库用于实现三维图形绘图、图像渲染、合成、和图层处理等。2D图形引擎是2D绘图的绘图引擎。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动、摄像头驱动、音频驱动、传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers.
图2示出了可以实施本公开的实施例的另一种电子设备200的框图。如图2所示,电子设备200可以是通用计算设备的形式。电子设备200的组件可以包括但不限于一个或多个处理器或处理单元210、存储器220、存储设备230、一个或多个通信单元240、一个或多个输入设备250以及一个或多个输出设备260。处理单元210可以是实际或虚拟处理器并且能够根据存储器220中存储的程序来执行各种处理。在多处理器系统中,多个处理单元并行执行计算机可执行指令,以提高电子设备200的并行处理能力。FIG. 2 shows a block diagram of another electronic device 200 in which embodiments of the present disclosure may be implemented. As shown in FIG. 2, electronic device 200 may be in the form of a general-purpose computing device. Components of electronic device 200 may include, but are not limited to, one or more processors or processing units 210, memory 220, storage devices 230, one or more communication units 240, one or more input devices 250, and one or more output devices 260. The processing unit 210 may be an actual or virtual processor and can perform various processes according to programs stored in the memory 220 . In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to increase the parallel processing capability of the electronic device 200 .
电子设备200通常包括多个计算机存储介质。这样的介质可以是电子设备200可访问的任何可以获得的介质,包括但不限于易失性和非易失性介质、可拆卸和不可拆卸介质。存储器220可以是易失性存储器(例如寄存器、高速缓存、随机访问存储器(RAM))、非易失性存储器(例如,只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、闪存)或它们的某种组合。存储设备230可以是可拆卸或不可拆卸的介质,并且可以包括机器可读介质, 诸如闪存驱动、磁盘或者任何其他介质,其可以能够用于存储信息和/或数据(例如用于训练的训练数据)并且可以在电子设备200内被访问。 Electronic device 200 typically includes multiple computer storage media. Such media can be any available media that can be accessed by electronic device 200, including but not limited to volatile and nonvolatile media, removable and non-removable media. Memory 220 may be volatile memory (eg, registers, cache, random access memory (RAM)), non-volatile memory (eg, read only memory (ROM), electrically erasable programmable read only memory (EEPROM) , Flash) or some combination of them. Storage device 230 may be removable or non-removable media, and may include machine-readable media, such as flash drives, magnetic disks, or any other media that may be capable of storing information and/or data (eg, training data for training). ) and can be accessed within the electronic device 200.
电子设备200可以进一步包括另外的可拆卸/不可拆卸、易失性/非易失性存储介质。尽管未在图2中示出,可以提供用于从可拆卸、非易失性磁盘(例如“软盘”)进行读取或写入的磁盘驱动和用于从可拆卸、非易失性光盘进行读取或写入的光盘驱动。在这些情况中,每个驱动可以由一个或多个数据介质接口被连接至总线(未示出)。存储器220可以包括计算机程序产品225,其具有一个或多个程序模块,这些程序模块被配置为执行本公开的实施例的对象编辑方法或过程。The electronic device 200 may further include additional removable/non-removable, volatile/non-volatile storage media. Although not shown in Figure 2, disk drives may be provided for reading or writing from removable, non-volatile magnetic disks (eg, "floppy disks") and for reading or writing from removable, non-volatile optical disks CD-ROM drive for reading or writing. In these cases, each drive may be connected to a bus (not shown) by one or more data media interfaces. The memory 220 may include a computer program product 225 having one or more program modules configured to perform the object editing methods or processes of embodiments of the present disclosure.
通信单元240实现通过通信介质与其他计算设备进行通信。附加地,电子设备200的组件的功能可以以单个计算集群或多个计算机器来实现,这些计算机器能够通过通信连接进行通信。因此,电子设备200可以使用与一个或多个其他服务器、网络个人计算机(PC)或者另一个网络节点的逻辑连接来在联网环境中进行操作。The communication unit 240 enables communication with other computing devices through a communication medium. Additionally, the functions of the components of the electronic device 200 may be implemented in a single computing cluster or multiple computing machines capable of communicating through a communication link. Accordingly, electronic device 200 may operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
输入设备250可以是一个或多个输入设备,例如鼠标、键盘、追踪球等。输出设备260可以是一个或多个输出设备,例如显示器、扬声器、打印机等。在本公开的实施例中,输出设备260可以包括具有触摸传感器的触摸屏,其可以接收用户的触摸输入。电子设备200还可以根据需要通过通信单元240与一个或多个外部设备(未示出)进行通信,外部设备诸如存储设备、显示设备等,与一个或多个使得用户与电子设备200交互的设备进行通信,或者与使得电子设备200与一个或多个其他计算设备通信的任何设备(例如,网卡、调制解调器等)进行通信。这样的通信可以经由输入/输出(I/O)接口(未示出)来执行。 Input device 250 may be one or more input devices, such as a mouse, keyboard, trackball, and the like. Output device 260 may be one or more output devices, such as a display, speakers, printer, and the like. In an embodiment of the present disclosure, the output device 260 may include a touch screen with a touch sensor, which may receive a user's touch input. The electronic device 200 may also communicate with one or more external devices (not shown) through the communication unit 240 as needed, such as a storage device, a display device, etc., with one or more devices that allow a user to interact with the electronic device 200 communicate, or with any device (eg, network card, modem, etc.) that enables electronic device 200 to communicate with one or more other computing devices. Such communication may be performed via an input/output (I/O) interface (not shown).
应当理解,上文图1所示出的电子设备100和图2所示出的电子设备200仅仅是能够实施本公开的一个或多个实施例的两种示例电子设备,其不应当构成对本文所描述的实施例的功能和范围的任何限制。It should be understood that the electronic device 100 shown in FIG. 1 and the electronic device 200 shown in FIG. 2 above are merely two example electronic devices capable of implementing one or more embodiments of the present disclosure, and should not constitute a any limitations on the functionality and scope of the described embodiments.
拖拽联动Drag linkage
当前,为了更多和更好地显示的信息,电子设备的屏幕越来越大,屏幕上的UI的布局越来越复杂,并且UI元素在尺寸和形状上的差异也越来越大。在这种情况下,UI中存在以各种不规则布局排列的各种不规则UI元素。例如,在智能电话的负一屏、控制中心、应用市场、图库等中存在各种不规则的控件、卡片、图片以及封面等UI元素。Currently, for more and better displayed information, the screens of electronic devices are getting larger and larger, the layout of UI on the screen is getting more and more complex, and UI elements are more and more different in size and shape. In this case, there are various irregular UI elements arranged in various irregular layouts in the UI. For example, there are various irregular UI elements such as controls, cards, pictures, and covers in the negative screen, control center, application market, and gallery of a smartphone.
传统上,各种不规则的UI元素之间不存在动画效果的联动。也就是说,触发目标UI元素的动画效果并不会联合地触发一个或多个其他UI元素的动画效果。每个UI元素的动画效果都是独立的且无联系的。因此,传统的动画效果单一且死板,无法体现UI元素之间的关系。Traditionally, there is no linkage of animation effects between various irregular UI elements. That is, triggering an animation of a target UI element does not jointly trigger an animation of one or more other UI elements. The animation effects of each UI element are independent and unconnected. Therefore, the traditional animation effects are single and rigid, and cannot reflect the relationship between UI elements.
本公开的实施例涉及UI中的UI元素在拖拽时的动画效果的联动,也被称为拖拽联动。在拖拽联动中,被拖拽的目标UI元素可以影响没有被拖拽的其他UI元素。具体地,在拖拽联动中,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果。例如,在拖拽联动中,在拖拽目标UI元素时,除了该目标UI元素随着拖拽以一动画效果移动之外,其他UI元素也可以以相应动画效果移动,从而在视觉上呈现联动地拖拽。The embodiments of the present disclosure relate to the linkage of animation effects of UI elements in the UI when dragging, which is also referred to as drag linkage. In drag linkage, the dragged target UI element can affect other UI elements that are not dragged. Specifically, in the drag linkage, triggering the animation effect of the target UI element may jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI. For example, in drag linkage, when dragging a target UI element, in addition to the target UI element moving with an animation effect along with the drag, other UI elements can also move with a corresponding animation effect, thereby visually presenting the linkage drag.
由此,可以加强不同UI元素的动画效果之间的联系,并且突出各个独立UI元素之间的关系。相比于动画效果单一、每个UI元素都是独立的且无联系的传统动画,本公开的实施例 能够使得动画效果更符合物理规律,并且考虑到了真实使用场景和用户使用习惯,从而可以显著提高用户体验。Thereby, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted. Compared with the traditional animation in which the animation effect is single and each UI element is independent and unrelated, the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
以下将参考附图3A至图19B描述拖拽联动的一些示例实施例。Some example embodiments of drag linkage will be described below with reference to FIGS. 3A-19B .
图3A-3C示出了根据本公开的一些实施例的示例UI 300A至300C的示意图。在某些实施例中,UI元素可以具有不规则的尺寸和形状。例如,如图3A所示,UI 300A可以包括多个UI元素,例如UI元素1-13,其中UI元素1、2、4和5具有不同的尺寸和形状。进一步地,UI也可以具有不规则的局部。例如,如图3B所示,UI 300B中的UI元素16和18右侧空缺,即不存在UI元素。然而,本公开的实施例同样适用于规则的布局、尺寸和形状。例如,如图3C所示,UI 300C具有规则的布局,并且UI 300C中的UI元素25-40都具有相同的尺寸和形状。应当理解,本公开的实施例适用于任何适当的规则或不规则的布局、尺寸和形状。3A-3C show schematic diagrams of example UIs 300A-300C in accordance with some embodiments of the present disclosure. In some embodiments, UI elements may have irregular sizes and shapes. For example, as shown in FIG. 3A, UI 300A may include multiple UI elements, such as UI elements 1-13, where UI elements 1, 2, 4, and 5 have different sizes and shapes. Further, the UI may also have irregular parts. For example, as shown in FIG. 3B , the right side of UI elements 16 and 18 in UI 300B is vacant, that is, there is no UI element. However, the embodiments of the present disclosure are equally applicable to regular layouts, sizes and shapes. For example, as shown in Figure 3C, UI 300C has a regular layout, and UI elements 25-40 in UI 300C all have the same size and shape. It should be understood that the embodiments of the present disclosure are applicable to any suitable regular or irregular layout, size and shape.
UI中的UI元素可以被拖拽。例如,在用户期望移动UI元素时,用户可以拖拽UI元素。作为示例,在用户期望改变UI元素在UI中的位置、将UI元素与另一UI元素合并、或者将UI元素放入工具栏或垃圾箱等时,用户可以拖拽UI元素。在检测到UI元素处的拖拽的情况下,UI元素可以以一动画效果移动,以在视觉上呈现拖拽动作。如上所述,在拖拽联动中,被拖拽的目标UI元素可以影响没有被拖拽的其他UI元素。具体地,在拖拽目标UI元素时,除了该目标UI元素随着拖拽以一动画效果移动之外,其他UI元素也可以以相应动画效果移动,从而在视觉上呈现联动地拖拽。UI elements in the UI can be dragged. For example, the user may drag the UI element when the user desires to move the UI element. As an example, a user may drag a UI element when the user desires to change the position of the UI element in the UI, merge the UI element with another UI element, put the UI element into a toolbar or trash, or the like. In the event that a drag at the UI element is detected, the UI element can be moved with an animation effect to visually present the drag action. As mentioned above, in drag linkage, the dragged target UI element can affect other UI elements that are not dragged. Specifically, when the target UI element is dragged, in addition to the target UI element moving with an animation effect along with the drag, other UI elements can also move with a corresponding animation effect, thereby visually presenting a linked drag.
图4示出了根据本公开的一些实施例的示例拖拽联动400的示意图。如图4所示,在检测到UI元素3处的拖拽的情况下,UI元素3可以以一动画效果移动,以在视觉上呈现拖拽动作。除了UI元素3随着拖拽以一动画效果移动之外,其他UI元素2和4也可以以相应动画效果移动,从而在视觉上呈现联动地拖拽。为了清楚,图4仅示出了UI元素2-3的联动移动。应当理解,联动移动可以发生在任何UI中的任何至少两个UI元素处,例如,UI 300A-300C中的任何至少两个UI元素处。FIG. 4 shows a schematic diagram of an example drag linkage 400 in accordance with some embodiments of the present disclosure. As shown in FIG. 4 , in the event that a drag at UI element 3 is detected, UI element 3 may move with an animation effect to visually present the drag action. In addition to UI element 3 moving with an animation effect along with the drag, other UI elements 2 and 4 can also move with a corresponding animation effect, thereby visually presenting a linked drag. For clarity, Figure 4 only shows the coordinated movement of UI elements 2-3. It should be understood that linked movement can occur at any at least two UI elements in any UI, for example, at any at least two UI elements in UIs 300A-300C.
具体地,在时间T01检测到UI元素3处的拖拽,使UI元素3以及其他UI元素2和4移动。在时间T02,UI元素3与位于拖拽方向上的UI元素4的间距变小。间距可以表示两个UI元素的相应基准点之间的距离。在某些实施例中,UI元素的中心点可以被确定为UI元素的基准点。备选地,间距可以表示两个UI元素的相邻边界之间的距离。如图4所示,在某些实施例中,UI元素3甚至可以覆盖UI元素4的至少一部分。而UI元素3与位于拖拽方向相反方向上的UI元素2的间距变大。这意味着UI元素3的移动的速度大于UI元素2和4的速度。在时间T03,UI元素3与位于拖拽方向上的UI元素4的间距变大,而与位于拖拽方向相反方向上的UI元素2的间距变小。这意味着UI元素3的移动的速度小于UI元素2和4的速度。在时间T04,UI元素3以及其他元素2和4移动到预定距离,从而停止移动。在某些实施例中,预定距离可以基于摩擦力模型确定。在下文中,将详细描述基于摩擦力模型确定距离的方式,因此在此省略其描述。Specifically, a drag at UI element 3 is detected at time T01, causing UI element 3 and other UI elements 2 and 4 to move. At time T02, the distance between UI element 3 and UI element 4 located in the dragging direction becomes smaller. Spacing may represent the distance between corresponding reference points of two UI elements. In some embodiments, the center point of the UI element may be determined as the fiducial point of the UI element. Alternatively, the spacing may represent the distance between adjacent boundaries of two UI elements. As shown in FIG. 4 , in some embodiments, UI element 3 may even cover at least a portion of UI element 4 . On the other hand, the distance between UI element 3 and UI element 2 located in the opposite direction of the dragging direction becomes larger. This means that UI element 3 is moving faster than UI elements 2 and 4. At time T03, the distance between UI element 3 and UI element 4 located in the drag direction becomes larger, and the distance from UI element 2 located in the opposite direction to the drag direction becomes smaller. This means that UI element 3 moves at a lower speed than UI elements 2 and 4. At time T04, UI element 3 and other elements 2 and 4 move to a predetermined distance, thereby stopping the movement. In some embodiments, the predetermined distance may be determined based on a friction force model. Hereinafter, the manner of determining the distance based on the friction force model will be described in detail, and thus the description thereof is omitted here.
以上描述了UI元素联动移动的示例,在下文中将描述UI元素移动的原理。The example of the linkage movement of the UI elements has been described above, and the principle of the movement of the UI elements will be described below.
UI元素的移动可以受到如下因素的控制:摩擦力因素、联动因素、跟手因素、跟手比率因素、松手回弹因素、和/或惯性回弹因素。例如,摩擦力因素可以控制UI元素停止移动。联动因素可以控制其他UI元素的动画效果。跟手因素可以控制UI元素的跟手移动,例如在未过界拖拽时UI元素的跟手移动。跟手比率因素可以控制UI元素的跟手移动的比率,例如 在过界后拖拽时UI元素的位移与手的位移的比率。松手回弹因素可以控制松手后UI元素的复位,例如在过界拖拽松手后UI元素的复位。惯性回弹因素可以控制UI元素在过界后的回弹。例如,在UI元素移动过界时,摩擦力因素可能无法使UI元素停止移动。在这种情况下,惯性回弹因素可以控制UI元素在过界后的回弹。Movement of UI elements may be controlled by friction factors, linkage factors, catch-hand factors, catch-hand ratio factors, release rebound factors, and/or inertial rebound factors. For example, the friction factor can control UI elements to stop moving. Linkage factors can control the animation of other UI elements. The follow factor can control the follow movement of UI elements, such as the follow movement of UI elements when dragging without crossing the boundary. The follow-to-hand ratio factor can control the ratio of the follow-hand movement of the UI element, such as the ratio of the UI element's displacement to the hand's displacement when dragging after crossing the bounds. The release rebound factor can control the reset of UI elements after letting go, for example, the reset of UI elements after dragging and letting go. The inertial rebound factor can control the rebound of UI elements after crossing the boundary. For example, friction factors may not stop the UI element from moving when it moves out of bounds. In this case, the inertial springback factor can control the springback of UI elements after they cross the bounds.
在下文中,将详细描述与摩擦力因素相关联的摩擦力模型和与联动因素相关联的弹性力模型。总体上,可以利用摩擦力模型确定UI元素将要移动的距离,从而确定UI元素的移动的源位置和目的地位置。此外,可以基于被拖拽的UI元素的弹簧参数(例如弹性系数、阻尼系数),利用将在下文中详细描述的传导方式,确定联动移动的其他UI元素的弹簧参数,从而在被拖拽的UI元素和联动移动的UI元素的移动过程中,基于每个UI元素各自的弹簧参数控制每个UI元素进行遵循弹性力模型的移动。Hereinafter, the friction force model associated with the friction force factor and the elastic force model associated with the linkage factor will be described in detail. In general, the friction model can be used to determine the distance that the UI element will move, thereby determining the source and destination locations of the UI element's movement. In addition, the spring parameters of other UI elements that are moved in linkage can be determined based on the spring parameters (eg, elasticity coefficient, damping coefficient) of the dragged UI element, using a conduction method that will be described in detail below, so that the dragged UI can During the movement of the elements and the UI elements that are moved in linkage, each UI element is controlled to move according to the elastic force model based on the respective spring parameters of each UI element.
摩擦力模型可以用于确定UI元素将要移动的距离,例如在松手或抛滑后UI元素将要移动的距离。该距离可以通过如下等式(1)和(2)确定:The friction model can be used to determine how far a UI element will move, such as how far a UI element will move after letting go or slipping. This distance can be determined by equations (1) and (2) as follows:
Figure PCTCN2022087751-appb-000001
Figure PCTCN2022087751-appb-000001
Figure PCTCN2022087751-appb-000002
Figure PCTCN2022087751-appb-000002
其中f friction表示摩擦力,其是电子设备或用户可配置的;t表示移动的时间;V 0表示初速度,其是电子设备或用户可配置的,或者检测用户的拖拽的速度得到的;V(t)表示最终速度,由于UI元素的移动最终将停止,因此V(t)为0;e表示自然常数;S(t)表示UI元素将要移动的距离。应当理解,以上等式中的常数仅是示例,其是电子设备或用户可设置的。 where f friction is the friction force, which is configurable by the electronic device or user; t is the moving time; V 0 is the initial velocity, which is configurable by the electronic device or the user, or obtained by detecting the speed of the user's dragging; V(t) represents the final velocity, since the movement of the UI element will eventually stop, so V(t) is 0; e represents the natural constant; S(t) represents the distance the UI element will move. It should be understood that the constants in the above equations are merely examples, which are electronically or user-settable.
由以上等式可知,通过等式(1)可以确定移动的时间t。由此,可以进一步地通过等式(2)确定距离S(t)。以此方式,可以容易地确定UI元素将要移动的距离。此外,由于等式中的各种参数(例如,摩擦力、初速度等)是可配置的,因此可以通过配置这些参数来影响UI元素将要移动的距离,从而提高动画效果的灵活性和用户体验。From the above equation, the time t of the movement can be determined by equation (1). Thus, the distance S(t) can be further determined by equation (2). In this way, the distance that the UI element is to be moved can be easily determined. In addition, since various parameters in the equation (eg, friction, initial velocity, etc.) are configurable, it is possible to configure these parameters to affect the distance that UI elements will move, improving animation flexibility and user experience .
符合摩擦力模型的UI元素的移动将满足摩擦力模型的速度时间曲线和位移时间曲线。图5A和5B分别示出了根据本公开的一些实施例的摩擦力模型的示例速度时间曲线500A和示例位移时间曲线500B的示意图。如图5A和5B所示,在仅受到摩擦力的情况下,UI元素的移动速度随时间减小为0,并且UI元素的移动距离随时间增大直至移动停止。Movement of UI elements that conform to the friction model will satisfy the friction model's velocity-time and displacement-time curves. 5A and 5B show schematic diagrams of an example velocity time curve 500A and an example displacement time curve 500B, respectively, of a friction force model according to some embodiments of the present disclosure. As shown in FIGS. 5A and 5B , under the condition of only friction force, the moving speed of the UI element decreases to 0 with time, and the moving distance of the UI element increases with time until the movement stops.
在上文中,描述了摩擦力因素如何控制UI元素停止移动。此外,UI元素能够被移动到的位置是否受到限制也可以控制UI元素在何处停止移动。Above, it was described how the friction factor controls UI elements to stop moving. In addition, whether there are restrictions on where UI elements can be moved can also control where UI elements stop moving.
具体地,在某些实施例中,UI元素能够被移动到的位置是不受限制的。在这种情况下,基于摩擦力模型确定的距离即为UI元素将要移动的距离。然而,在某些实施例中,UI元素能够被移动到的位置是受限制的。换句话说,UI元素只能被移动到的预定位置。在这种情况下,虽然可以基于摩擦力模型确定UI元素将要移动的距离,但是如果UI元素在移动了该距离之后,并不位于预定位置处,则需要调整UI元素将要移动的距离,使得UI元素能够被移动到预定位置处。例如,可以将UI元素移动到与基于摩擦力模型确定的停止位置最近的预定位置处。由此,UI元素将要移动的距离可以基于摩擦力模型和预定位置两者共同确定。Specifically, in some embodiments, the positions to which UI elements can be moved are not limited. In this case, the distance determined based on the friction model is the distance the UI element will move. However, in some embodiments, the positions to which UI elements can be moved are limited. In other words, UI elements can only be moved to predetermined positions. In this case, although the distance that the UI element will move can be determined based on the friction force model, if the UI element is not located at the predetermined position after moving the distance, the distance that the UI element will move needs to be adjusted so that the UI Elements can be moved to predetermined positions. For example, the UI element can be moved to a predetermined position closest to the stop position determined based on the friction model. Thus, the distance that the UI element is to be moved can be jointly determined based on both the friction model and the predetermined position.
图6示出了根据本公开的一些实施例的移动位置受限和非受限的示例600的示意图。如图6所示,在UI元素能够被移动到的位置是受限制的情况下,UI元素只能从屏幕610上的源位置620被移动到预定位置630。作为对照,在UI元素能够被移动到的位置不受限制的情 况下,UI元素能够从屏幕610上的源位置620被移动到任意位置640。FIG. 6 shows a schematic diagram of an example 600 of restricted and unrestricted mobile locations in accordance with some embodiments of the present disclosure. As shown in FIG. 6 , in the case where the position to which the UI element can be moved is limited, the UI element can only be moved from the source position 620 on the screen 610 to the predetermined position 630 . In contrast, UI elements can be moved from source position 620 on screen 610 to any position 640 without limitation to the position to which the UI element can be moved.
进一步地,在某些实施例中,还可以对UI元素能够移动的范围进行限制。移动超过该范围的UI元素将被视为过界。该范围可以是任何适当范围。例如,该范围可以为与屏幕边界的距离小于屏幕尺寸的预定比例或预定像素(诸如10%或1000像素)的范围,或者从UI元素的源位置到目的地位置的距离小于屏幕尺寸的预定比例或预定像素(诸如50%或10000像素)的范围。由此,UI元素将要移动的距离还可以基于该范围来确定。Further, in some embodiments, the moving range of the UI element may also be limited. UI elements that move beyond this range will be considered out of bounds. The range can be any suitable range. For example, the range may be a distance from the screen boundary that is less than a predetermined proportion of the screen size or a range of predetermined pixels (such as 10% or 1000 pixels), or the distance from the source location of the UI element to the destination location is less than a predetermined proportion of the screen size. or a range of predetermined pixels (such as 50% or 10000 pixels). Thus, the distance that the UI element is to be moved can also be determined based on the range.
以上详细描述了摩擦力模型,在下文中将进一步描述弹性力模型。The friction force model is described in detail above, and the elastic force model is further described below.
UI元素的移动的位移随时间变化的曲线可以是符合弹性力模型的弹性力曲线。由于位移和时间可以确定速度,因此UI元素的移动的速度也遵循弹性力模型。为此,可以认为UI元素的移动可以模拟弹簧的运动规律。应当理解,这里为了描述弹性力模型,将UI元素的移动的位移随时间变化的曲线描述为弹性力曲线。然而,UI元素的移动的位移随时间变化的曲线也可以是任何适当预定义曲线,例如贝塞尔曲线。The displacement versus time curve of the movement of the UI element may be an elastic force curve conforming to an elastic force model. Since displacement and time can determine velocity, the velocity of UI elements' movement also follows the elastic force model. For this reason, it can be considered that the movement of UI elements can simulate the motion law of springs. It should be understood that, in order to describe the elastic force model here, a curve of the displacement of the UI element moving with time is described as an elastic force curve. However, the displacement versus time curve of the movement of the UI element may also be any suitable predefined curve, such as a Bezier curve.
弹性力模型可以基于胡克定律下的阻尼振动等式(3)和(4):The elastic force model can be based on the damped vibration equations (3) and (4) under Hooke's law:
f=ma    (3),f = ma (3),
Figure PCTCN2022087751-appb-000003
Figure PCTCN2022087751-appb-000003
其中f表示弹簧在振动过程中(即移动中)受到的力,其可以是电子设备或用户可配置的;a表示移动的加速度;t表示移动的时间;k表示弹簧的弹性系数;x表示弹簧的形变量;g表示弹簧的阻尼系数;m表示UI元素的质量,在此可以将UI元素的尺寸等价于UI元素的质量。where f represents the force on the spring during vibration (ie, moving), which can be electronically or user-configurable; a represents the acceleration of the movement; t represents the time of movement; k represents the spring coefficient of the spring; x represents the spring The deformation value of ; g represents the damping coefficient of the spring; m represents the mass of the UI element, where the size of the UI element can be equivalent to the mass of the UI element.
弹性系数是弹簧单位形变量所需力的大小。弹性系数k越大,弹簧从最大振幅回到平衡位置的时间越短,反之越长。弹性系数k是电子设备或用户可配置的。在一些实施例中,弹性系数k的取值范围可以为1-999,弹性系数k的建议取值范围可以为150-400。The coefficient of elasticity is the amount of force required for a unit of deformation of the spring. The larger the elastic coefficient k, the shorter the time for the spring to return from the maximum amplitude to the equilibrium position, and vice versa. The elasticity coefficient k is electronically or user configurable. In some embodiments, the value range of the elastic coefficient k may be 1-999, and the suggested value range of the elastic coefficient k may be 150-400.
阻尼系数是弹簧在振动过程中的减震力(例如流体阻力、摩擦力等)的量化表征,上述减震力可以使得弹簧振幅逐渐减小直至停止在平衡位置。阻尼系数越大,弹簧越容易停在平衡位置,反之越不容易。阻尼系数g是电子设备或用户可配置的。在一些实施例中,阻尼系数g的取值范围可以为1-99。The damping coefficient is a quantitative representation of the damping force (such as fluid resistance, friction, etc.) of the spring during the vibration process. The above damping force can gradually reduce the amplitude of the spring until it stops at the equilibrium position. The larger the damping coefficient, the easier it is for the spring to stop at the equilibrium position, and vice versa. The damping coefficient g is electronically or user configurable. In some embodiments, the value range of the damping coefficient g may be 1-99.
此外,应当理解,如上所述,基于摩擦力模型可以确定UI元素将要移动的距离S(t)。在UI元素移动距离S(t)的情况下,S(t)可以被视为弹簧的形变量。因此,S(t)等于x。Furthermore, it should be understood that the distance S(t) that the UI element is to be moved can be determined based on the friction force model, as described above. In the case where the UI element moves a distance S(t), S(t) can be regarded as the amount of deformation of the spring. Therefore, S(t) is equal to x.
弹性力模型具有三种阻尼状态,即临界阻尼状态、欠阻尼状态和过阻尼状态。临界阻尼符合如下等式(5):The elastic force model has three damping states, namely critical damping state, under damping state and over damping state. The critical damping conforms to the following equation (5):
g 2=4×m×k    (5), g 2 =4×m×k (5),
其中g表示弹簧的阻尼系数;m表示UI元素的尺寸;k表示弹簧的弹性系数。Where g is the damping coefficient of the spring; m is the size of the UI element; k is the spring's elastic coefficient.
以临界阻尼为基准,如果阻尼大于临界阻尼,就是过阻尼状态,如果阻尼小于临界阻尼,就是欠阻尼状态。Taking the critical damping as the benchmark, if the damping is greater than the critical damping, it is an over-damped state, and if the damping is less than the critical damping, it is an under-damping state.
不同的阻尼状态下,UI元素的位移时间曲线不同。图7A-7C分别示出了根据本公开的一些实施例的临界阻尼状态、欠阻尼状态和过阻尼状态下的弹簧形变量x随时间t的曲线700A-700C的示例的示意图。如图7A所示,临界阻尼状态下,弹簧以最平稳的速度在最短时间回到平衡位置后停止运动,不再振荡。如图7B所示,欠阻尼状态下,弹簧缓慢的经由多次振荡逐渐减小振幅,最后回到平衡位置。如图7C所示,过阻尼状态下,弹簧几乎没有 振动,振幅逐渐减小,达到平衡位置。Under different damping states, the displacement time curves of UI elements are different. 7A-7C show schematic diagrams of examples of plots 700A-700C of spring deflection amount x versus time t for a critically damped state, an under-damped state, and an over-damped state, respectively, according to some embodiments of the present disclosure. As shown in Fig. 7A, in the critical damping state, the spring stops moving after returning to the equilibrium position with the smoothest speed and the shortest time, and no longer oscillates. As shown in Fig. 7B, in the under-damped state, the spring slowly reduces the amplitude gradually through multiple oscillations, and finally returns to the equilibrium position. As shown in Fig. 7C, in the overdamped state, the spring hardly vibrates, and the amplitude gradually decreases, reaching the equilibrium position.
如上所述,UI元素的移动的位移随时间变化的曲线可以是符合弹性力模型的弹性力曲线。为此,可以认为UI元素的移动可以模拟弹簧的运动规律,即UI元素的位移的变化规律可以模拟弹簧形变量的变化规律。通过调整阻尼系数和/或弹性系数,可以调整UI元素的位移的变化规律,使得UI元素模拟临界阻尼状态、过阻尼或欠阻尼状态的弹簧的运动规律。As described above, the displacement versus time curve of the movement of the UI element may be an elastic force curve conforming to an elastic force model. Therefore, it can be considered that the movement of the UI element can simulate the motion law of the spring, that is, the change law of the displacement of the UI element can simulate the change law of the spring deformation. By adjusting the damping coefficient and/or the elastic coefficient, the change law of the displacement of the UI element can be adjusted, so that the UI element simulates the motion law of the spring in a critical damping state, over damping or under damping state.
进一步地,如上所述,可以基于被拖拽的UI元素的弹簧参数(例如弹性系数、阻尼系数),利用将在下文中详细描述的传导方式,确定联动移动的其他UI元素的弹簧参数,从而在被拖拽的UI元素和联动移动的UI元素的移动过程中,基于每个UI元素各自的弹簧参数控制每个UI元素进行遵循弹性力模型的移动。由此,可以使得被拖拽的UI元素和联动移动的UI元素能够模拟具有不同弹簧参数的弹簧的运动规律,从而呈现拖拽方向上的UI元素间的间隔先减小后恢复(类似于弹簧先压缩后恢复),而拖拽方向相反方向上的UI元素间的间隔先增大后恢复(类似于弹簧先拉伸后恢复)的动画效果,增加了对用户的拖拽动作的动态反馈。Further, as described above, the spring parameters of other UI elements that are moved in linkage can be determined based on the spring parameters (such as elasticity coefficient, damping coefficient) of the dragged UI element, using a conduction method that will be described in detail below, so as to During the movement of the dragged UI element and the UI element that is moved in linkage, each UI element is controlled to move according to the elastic force model based on its respective spring parameters. In this way, the dragged UI elements and the UI elements that are moved in linkage can simulate the motion law of springs with different spring parameters, so that the interval between UI elements in the drag direction decreases first and then recovers (similar to a spring First compress and then restore), and the interval between UI elements in the opposite direction of the dragging direction first increases and then restores (similar to the animation effect of a spring stretching and then restoring), which increases the dynamic feedback to the user's dragging action.
某个联动移动的UI元素的动画效果是基于被拖拽的UI元素移动的动画效果以及被拖拽的UI元素与该联动移动的UI元素之间的距离确定的。由于联动移动的UI元素移动的动画效果随距离而变化,因此也可以认为其移动的动画效果随距离而传导。在某些实施例中,传导可以是非线性传导。备选地,传导也可以是线性传导。The animation effect of a UI element that is moved in linkage is determined based on the animation effect of the dragged UI element moving and the distance between the dragged UI element and the UI element that is moved in linkage. Since the animation effect of the UI element moving in linkage changes with the distance, it can also be considered that the animation effect of its movement is conducted with the distance. In some embodiments, the conduction may be non-linear conduction. Alternatively, the conduction can also be linear conduction.
例如,在非线性传导的情况下,联动移动的UI元素移动的动画效果可以通过如下等式(6)确定:For example, in the case of non-linear conduction, the animation effect of the movement of UI elements that move in conjunction can be determined by the following equation (6):
x n=x×(n+1) -0.18×g    (6), x n =x×(n+1) -0.18×g (6),
其中x n表示联动移动的UI元素移动的动画效果;x表示被拖拽的UI元素移动的动画效果;n表示被拖拽的UI元素与联动移动的UI元素之间的距离;g表示传导系数,当传导系数为0时,联动移动的UI元素移动的动画效果与被拖拽的UI元素移动的动画效果相同;等式(6)中的常数仅为示例,其为电子设备或用户可配置的。 where x n represents the animation effect of the UI element moving in linkage; x represents the animation effect of the UI element being dragged; n represents the distance between the UI element being dragged and the UI element that is moved in linkage; g represents the conduction coefficient , when the conduction coefficient is 0, the animation effect of the UI element moving in linkage is the same as the animation effect of the UI element being dragged; the constant in equation (6) is only an example, which is configurable by the electronic device or user of.
在UI元素的移动的位移随时间变化的曲线为弹性力曲线的情况下,移动的动画效果可以由阻尼系数和/或弹性系数来控制。因此x可以是基于阻尼系数和弹性系数中的至少一者来确定的。In the case that the time-varying curve of the movement of the UI element is an elastic force curve, the animation effect of the movement may be controlled by a damping coefficient and/or an elastic coefficient. Thus x may be determined based on at least one of a damping coefficient and a spring coefficient.
例如,x可以是被拖拽的UI元素的弹性系数与阻尼系数的比值。在这种情况下,被拖拽的UI元素的弹性系数与阻尼系数的比值基于距离n传导至联动移动的UI元素,从而得到联动移动的UI元素的弹性系数与阻尼系数的比值x n。由此,可以将被拖拽的UI元素移动的动画效果基于距离传导至联动移动的UI元素。弹性系数与阻尼系数的比值越大,UI元素的移动之间的关联越弱,UI元素之间的弹簧特性和移动差异越大,可以被认为是弹簧“偏软”。反之,弹性系数与阻尼系数的比值越小,UI元素的移动之间的关联越强,UI元素之间的弹簧特性和移动差异越小,可以被认为是弹簧“偏硬”。 For example, x can be the ratio of the elastic coefficient to the damping coefficient of the UI element being dragged. In this case, the ratio of the elastic coefficient to the damping coefficient of the dragged UI element is transmitted to the UI element that moves in conjunction with the distance n, thereby obtaining the ratio x n of the elastic coefficient to the damping coefficient of the UI element that moves in conjunction. Thereby, the animation effect of the dragged UI element moving can be transferred to the UI element that is moved in conjunction based on the distance. The larger the ratio of elastic coefficient to damping coefficient, the weaker the correlation between the movement of UI elements, the greater the difference in spring characteristics and movement between UI elements, which can be considered as "softer" springs. Conversely, the smaller the ratio of the elastic coefficient to the damping coefficient, the stronger the correlation between the movement of UI elements, and the smaller the difference in spring characteristics and movement between UI elements, which can be considered as a “harder” spring.
应当理解,x表示被拖拽的UI元素的弹性系数与阻尼系数的比值仅是示例。x可以是任何适当因素。作为另一示例,x可以是被拖拽的UI元素的弹性系数。作为再一示例,x也可以是被拖拽的UI元素的阻尼系数。It should be understood that the ratio of the elastic coefficient to the damping coefficient of the UI element being dragged by x is merely an example. x can be any suitable factor. As another example, x may be the elasticity coefficient of the UI element being dragged. As yet another example, x may also be the damping coefficient of the UI element being dragged.
此外,虽然在上文中详细描述了弹性力曲线,但是UI元素移动的动画效果可以遵循任何适当预定曲线,例如贝塞尔曲线。取决于贝塞尔曲线的阶数,贝塞尔曲线可以具有对应于阶数的控制点。例如,在二阶贝塞尔曲线的情况下,贝塞尔曲线可以具有两个控制点。类似地, 在一阶贝塞尔曲线的情况下,贝塞尔曲线可以具有一个控制点,而在三阶贝塞尔曲线的情况下,贝塞尔曲线可以具有三个控制点,以此类推。在UI元素的移动的位移随时间变化的曲线为贝塞尔曲线的情况下,可以通过贝塞尔曲线的至少一个控制点中的至少一者的坐标,来控制移动的动画效果。例如,在二阶贝塞尔曲线的情况下,可以通过二阶贝塞尔曲线的两个控制点中之一或两者,来控制移动的动画效果。因此,x可以是基于至少一个控制点中的至少一者的坐标来确定的。Furthermore, although the elastic force curve is described in detail above, the animation effect of UI element movement may follow any suitable predetermined curve, such as a Bezier curve. Depending on the order of the Bezier curve, the Bezier curve may have control points corresponding to the order. For example, in the case of a second-order Bezier curve, the Bezier curve can have two control points. Similarly, in the case of a first-order Bezier curve, the Bezier curve can have one control point, and in the case of a third-order Bezier curve, the Bezier curve can have three control points, and so on . In the case where the time-varying curve of the movement of the UI element is a Bezier curve, the animation effect of the movement can be controlled by the coordinates of at least one of at least one control point of the Bezier curve. For example, in the case of a second-order bezier curve, the animation of the movement can be controlled by one or both of the two control points of the second-order bezier curve. Thus, x may be determined based on the coordinates of at least one of the at least one control point.
以上详细描述了非线性传导,在线性传导的情况下,联动移动的UI元素移动的动画效果可以通过如下等式(7)确定:The nonlinear conduction is described in detail above. In the case of linear conduction, the animation effect of the UI element moving in linkage can be determined by the following equation (7):
x n=x-g×n     (7), xn=xg× n (7),
其中x n表示联动移动的UI元素移动的动画效果;x表示被拖拽的UI元素移动的动画效果;n表示被拖拽的UI元素与联动移动的UI元素之间的距离;g表示传导系数,当传导系数为0时,联动移动的UI元素移动的动画效果与被拖拽的UI元素移动的动画效果相同。 where x n represents the animation effect of the UI element moving in linkage; x represents the animation effect of the UI element being dragged; n represents the distance between the UI element being dragged and the UI element that is moved in linkage; g represents the conduction coefficient , when the conduction coefficient is 0, the animation effect of the UI element moving in linkage is the same as the animation effect of the UI element being dragged.
类似于非线性传导,在UI元素的移动的位移随时间变化的曲线为弹性力曲线的情况下,移动的动画效果可以由阻尼系数和/或弹性系数来控制。因此x可以是基于阻尼系数和弹性系数中的至少一者来确定的。在UI元素的移动的位移随时间变化的曲线为贝塞尔曲线的情况下,可以通过贝塞尔曲线至少一个控制点中的至少一者的坐标,来控制移动的动画效果。因此,x可以是基于至少一个控制点中的至少一者的坐标来确定的。Similar to nonlinear conduction, in the case where the time-varying displacement curve of the UI element is an elastic force curve, the animation effect of the movement can be controlled by a damping coefficient and/or an elastic coefficient. Thus x may be determined based on at least one of a damping coefficient and a spring coefficient. In the case where the time-varying curve of the movement of the UI element is a Bezier curve, the animation effect of the movement can be controlled by the coordinates of at least one of at least one control point of the Bezier curve. Thus, x may be determined based on the coordinates of at least one of the at least one control point.
在上文中,详细描述了拖拽联动的原理。在下文中,将进一步描述利用该拖拽联动的原理控制UI元素进行联动移动的过程。In the above, the principle of drag linkage is described in detail. In the following, the process of controlling UI elements to perform linked movement using the drag linkage principle will be further described.
图8示出了根据本公开的实施例的图形界面显示方法800的流程图。应当理解,方法800可以由以上参考图1所描述的电子设备100或者参考图2所描述的电子设备200来执行。在此参考图3A的UI 300A描述方法800。然而,应当理解,UI 300A仅是示例,方法800可以适用于任何适当界面,包括但不限于UI 300B-300C。FIG. 8 shows a flowchart of a graphical interface display method 800 according to an embodiment of the present disclosure. It should be understood that the method 800 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 800 is described herein with reference to UI 300A of Figure 3A. It should be understood, however, that UI 300A is merely an example, and method 800 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
在框810,在电子设备的屏幕上显示M个用户界面UI元素。M为大于1的正整数。例如,参见图9,M个UI元素可以是UI元素1至13。At block 810, the M user interface UI elements are displayed on the screen of the electronic device. M is a positive integer greater than 1. For example, referring to FIG. 9 , the M UI elements may be UI elements 1 to 13 .
在框820,检测到作用于M个UI元素中的第一UI元素处的拖拽。例如,第一UI元素可以是UI元素5。作用于第一UI元素的拖拽将使得第一UI元素以一动画效果移动,以呈现拖拽效果。At block 820, a drag at a first UI element of the M UI elements is detected. For example, the first UI element may be UI element 5 . The drag on the first UI element will cause the first UI element to move with an animation effect to present the drag effect.
在框830,响应于作用于第一UI元素的拖拽,使屏幕上的N个UI元素中的每个UI元素以相应动画效果移动。N为1与M-1之间的正整数。由此,从视觉上指示联动地拖拽。At block 830, in response to the drag on the first UI element, each of the N UI elements on the screen is moved with a corresponding animation effect. N is a positive integer between 1 and M-1. Thereby, interlocking drag is visually instructed.
在某些实施例中,拖拽联动可以作用于屏幕上的所有UI元素。在这种情况下,可以将M个UI元素中除第一UI元素以外的M-1个UI元素确定为N个UI元素。备选地,拖拽联动可以仅作用于屏幕上的部分UI元素。在这种情况下,可以基于第一UI元素的尺寸来确定第一UI元素的影响区域,以及将M个UI元素中在影响区域内的UI元素确定为N个UI元素。例如,第一UI元素的尺寸越大,其影响区域可以越大。备选地,影响区域也可以随着尺寸缩小,本公开在此不受限制。例如,影响区域可以是以第一UI元素的基准点为中心、具有预定半径的圆。应当理解,影响区域可以是具有任何形状的任何适当区域,例如具有预定尺寸的矩形、菱形等。影响区域可以是由电子设备和用户可配置的,本公开在此不受限制。In some embodiments, the drag linkage can act on all UI elements on the screen. In this case, M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements. Alternatively, the drag linkage may only act on some UI elements on the screen. In this case, the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein. For example, the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
此外,在某些实施例中,与影响区域相交的UI元素可以被认为在影响区域内。备选地,在影响区域为具有预定半径的圆的情况下,如果UI元素与第一UI元素的距离小于影响区域的预定半径,该UI元素可以被认为在影响区域内。Additionally, in some embodiments, UI elements that intersect the area of influence may be considered to be within the area of influence. Alternatively, where the area of influence is a circle with a predetermined radius, the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
图9示出了根据本公开的实施例的UI元素的影响区域的示例的示意图。如图9所示,由于UI元素3、4、7、8在UI元素5的影响区域910内,因此UI元素3、4、7、8将随着UI元素5联动移动。此外,由于UI元素1、2、6、9-13不在UI元素5的影响区域910内,因此UI元素1、2、6、9-13不会随着UI元素5联动移动。9 shows a schematic diagram of an example of an area of influence of a UI element according to an embodiment of the present disclosure. As shown in FIG. 9 , since UI elements 3 , 4 , 7 , and 8 are within the influence area 910 of UI element 5 , UI elements 3 , 4 , 7 , and 8 will move in conjunction with UI element 5 . In addition, since UI elements 1, 2, 6, 9-13 are not within the influence area 910 of UI element 5, UI elements 1, 2, 6, 9-13 will not move in conjunction with UI element 5.
返回参考图8,为了使N个UI元素以相应动画效果移动,可以确定第一UI元素与N个UI元素中的每个UI元素之间的距离。在下文中,将描述如何确定第一UI元素与N个UI元素中的第二UI元素之间的距离。Referring back to FIG. 8, in order to move the N UI elements with a corresponding animation effect, the distance between the first UI element and each of the N UI elements may be determined. Hereinafter, how to determine the distance between the first UI element and the second UI element among the N UI elements will be described.
在某些实施例中,可以根据距离所处于的范围,将距离划分为多个距离等级。例如被操作的UI元素本身可以处于距离等级0、联动的UI元素中的可以根据其与被操作的UI元素的相应距离而处于距离等级1、2、3……处于相同距离等级的UI元素可以被视为距离相同。由此,通过使用距离等级,可以简化UI元素的联动,使得处于相同距离等级的UI元素以相同方式联动,从而提高联动的统一性和协调性。然而,应当理解,在联动中,也可以使用距离本身,从而使得UI元素更精确地联动。在下文中,距离等级可互换地被称为距离。In some embodiments, the distances may be divided into a plurality of distance classes according to the range in which the distances lie. For example, the operated UI element itself may be at distance level 0, and the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element... UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage. However, it should be understood that in linkage, the distance itself may also be used, thereby allowing UI elements to be more precisely linked. In the following, distance classes are referred to interchangeably as distances.
图10示出了根据本公开的实施例的距离的确定的示例1000的示意图。如图10所示,在某些实施例中,可以确定第一UI元素(例如,UI元素5)的第一基准点和第二UI元素(例如,UI元素2)的第二基准点。在图10中,每个UI元素的基准点由“+”所示。在某些实施例中,UI元素的中心点可以被确定为UI元素的基准点。备选地,UI元素的基准点可以是电子设备或用户可配置的,从而基准点的位置可以是任何适当位置,本公开在此不受限制。由此,可以确定第一基准点与第二基准点之间的距离作为第一UI元素与第二UI元素之间的距离。FIG. 10 shows a schematic diagram of an example 1000 of distance determination according to an embodiment of the present disclosure. As shown in FIG. 10, in some embodiments, a first fiducial point for a first UI element (eg, UI element 5) and a second fiducial point for a second UI element (eg, UI element 2) may be determined. In Figure 10, the reference point of each UI element is indicated by "+". In some embodiments, the center point of the UI element may be determined as the fiducial point of the UI element. Alternatively, the fiducial point of the UI element may be electronically or user-configurable, so that the location of the fiducial point may be any suitable location, and the present disclosure is not limited herein. Thus, the distance between the first reference point and the second reference point can be determined as the distance between the first UI element and the second UI element.
例如,假设第一基准点在屏幕上的位置坐标为(x0,y0),而第二基准点在屏幕上的位置坐标为(x1,y1)。在这种情况下,距离可以通过如下等式(8)确定:For example, it is assumed that the position coordinates of the first reference point on the screen are (x0, y0), and the position coordinates of the second reference point on the screen are (x1, y1). In this case, the distance can be determined by the following equation (8):
Figure PCTCN2022087751-appb-000004
Figure PCTCN2022087751-appb-000004
其中n表示距离,x0表示第一基准点的横坐标,y0表示第一基准点的纵坐标,x1表示第二基准点的横坐标,y1表示第二基准点的纵坐标。Where n represents the distance, x0 represents the abscissa of the first reference point, y0 represents the ordinate of the first reference point, x1 represents the abscissa of the second reference point, and y1 represents the ordinate of the second reference point.
如图10所示,以上述方式确定的UI元素5与其它UI元素之间的距离如下:UI元素5与其本身的距离为0,与UI元素3、7、8之间的距离为1,与UI元素2、4、6、9之间的距离为2,并且与UI元素1、10-13之间的距离为3。As shown in Figure 10, the distances between UI element 5 and other UI elements determined in the above manner are as follows: the distance between UI element 5 and itself is 0, the distance between UI element 5 and UI elements 3, 7, and 8 is 1, and the distance between UI element 5 and itself is 0. The distance between UI elements 2, 4, 6, 9 is 2, and the distance from UI elements 1, 10-13 is 3.
图11A-11C示出了根据本公开的实施例的距离的确定的示例1100A-1100C的示意图。如图11A所示,在某些实施例中,可以确定第一UI元素的第一基准点。可以从第一基准点为圆心,确定具有各自半径的多个圆,例如圆1110A-1130A。应当理解,除了圆之外,还可以以第一基准点为中心,确定具有各自尺寸的任何其他适当形状,例如矩形、菱形等,本公开在此不受限制。11A-11C show schematic diagrams of examples 1100A-1100C of distance determination according to embodiments of the present disclosure. As shown in FIG. 11A, in some embodiments, a first reference point for the first UI element may be determined. A plurality of circles having respective radii, such as circles 1110A-1130A, may be determined from the first reference point as the center of the circle. It should be understood that, in addition to a circle, any other suitable shapes with respective sizes can also be determined with the first reference point as the center, such as rectangles, diamonds, etc., and the present disclosure is not limited herein.
例如,如图11B所示,在某些实施例中,可以确定第一UI元素的第一基准点。可以从第一基准点为中心,确定具有各自尺寸的多个矩形,例如矩形1110B-1120B。此外,如图11C所示,在某些实施例中,可以确定第一UI元素的第一基准点。可以从第一基准点为中心,确 定具有各自尺寸的多个菱形,例如矩形1110C-1140C。For example, as shown in FIG. 11B, in some embodiments, a first reference point for the first UI element may be determined. A plurality of rectangles having respective dimensions, eg, rectangles 1110B-1120B, may be determined from the first reference point as the center. Additionally, as shown in FIG. 11C, in some embodiments, a first reference point for the first UI element may be determined. A plurality of diamonds having respective dimensions, such as rectangles 1110C-1140C, may be determined from the first reference point as the center.
在某些实施例中,多个圆的半径可以以预定大小或比例增大。备选地,多个圆的半径可以是电子设备或用户可配置的,本公开在此不受限制。In some embodiments, the radii of the plurality of circles may increase by a predetermined size or ratio. Alternatively, the radii of the plurality of circles may be electronically or user configurable, and the present disclosure is not limited herein.
由此,可以从多个圆中,确定与第二UI元素相交的圆。由此,可以将相交的圆的半径确定为距离。在某些实施例中,如果存在多于一个圆与第二UI元素相交,则可以从这些圆中,确定与第二UI元素相交并且半径最小的目标圆。进一步地,在某些实施例中,如果没有圆与第二UI元素相交,则可以将与第二UI元素最接近的圆作为目标圆,由此,可以将目标圆的半径确定为距离。Thus, from among the plurality of circles, the circle intersecting the second UI element can be determined. From this, the radius of the intersecting circles can be determined as the distance. In some embodiments, if there is more than one circle that intersects the second UI element, from these circles, a target circle that intersects the second UI element and has the smallest radius can be determined. Further, in some embodiments, if no circle intersects the second UI element, the circle closest to the second UI element may be used as the target circle, whereby the radius of the target circle may be determined as the distance.
如图11所示,以上述方式确定的UI元素5与其它UI元素之间的距离如下:UI元素5与其本身的距离为0。由于与UI元素3、4、7、8相交的半径最小的圆为圆1110,因此UI元素3、4、7、8与UI元素5之间的距离为1。由于圆1120与UI元素2、6、9相交,因此UI元素2、6、9与UI元素5之间的距离为2。此外,由于圆1130与UI元素1、10-13相交,因此UI元素1、10-13之间的距离为3。As shown in FIG. 11 , the distance between UI element 5 and other UI elements determined in the above manner is as follows: the distance between UI element 5 and itself is 0. Since the circle with the smallest radius that intersects UI elements 3, 4, 7, 8 is circle 1110, the distance between UI elements 3, 4, 7, 8 and UI element 5 is 1. Since circle 1120 intersects UI elements 2, 6, 9, the distance between UI elements 2, 6, 9 and UI element 5 is 2. Also, since circle 1130 intersects UI elements 1, 10-13, the distance between UI elements 1, 10-13 is 3.
图12示出了根据本公开的实施例的距离的确定的示例1200的示意图。如图12所示,在某些实施例中,可以确定第一UI元素与第二UI元素之间的横向间距,和/或确定第一UI元素与第二UI元素之间的纵向间距。在某些实施例中,横向间距可以表示第一UI元素与第二UI元素之间的一个或多个横向间隔的长度之和。横向间隔可以表示屏幕上的两个UI元素的纵向边界之间的间隔。类似于横向间距,纵向间距可以表示第一UI元素与第二UI元素之间的一个或多个纵向间隔的长度之和。纵向间隔可以表示屏幕上的两个UI元素的横向边界之间的间隔。在不规则布局的情况下,UI元素之间的横向间隔和纵向间隔的长度可以是不规则的。此外,UI元素之间的横向间隔和纵向间隔的长度可以是电子设备或用户可配置的。FIG. 12 shows a schematic diagram of an example 1200 of distance determination according to an embodiment of the present disclosure. As shown in FIG. 12, in some embodiments, the horizontal spacing between the first UI element and the second UI element may be determined, and/or the vertical spacing between the first UI element and the second UI element may be determined. In some embodiments, the lateral spacing may represent the sum of the lengths of one or more lateral spacings between the first UI element and the second UI element. Horizontal spacing may represent the spacing between the vertical boundaries of two UI elements on the screen. Similar to horizontal spacing, vertical spacing may represent the sum of the lengths of one or more vertical spacings between the first UI element and the second UI element. Vertical spacing may represent the spacing between the horizontal boundaries of two UI elements on the screen. In the case of an irregular layout, the lengths of the horizontal and vertical spaces between UI elements can be irregular. Furthermore, the lengths of the horizontal and vertical spaces between UI elements may be electronically device or user configurable.
由此,可以基于横向间距和/或纵向间距,来确定距离。例如,UI元素5与UI元素13之间存在两个纵向间隔。因此,UI元素5与UI元素13之间的距离可以是这两个纵向间隔的长度之和。作为另一示例,UI元素12与UI元素13之间存在一个横向间隔。因此,UI元素12与UI元素13之间的距离可以是该横向间隔的长度。Thus, the distance may be determined based on the lateral spacing and/or the longitudinal spacing. For example, there are two vertical spaces between UI element 5 and UI element 13. Thus, the distance between UI element 5 and UI element 13 may be the sum of the lengths of these two longitudinal intervals. As another example, there is a lateral space between UI element 12 and UI element 13 . Thus, the distance between UI element 12 and UI element 13 may be the length of this lateral separation.
如图12所示,以上述方式确定的UI元素5与其它UI元素之间的距离如下:UI元素5与其本身的距离为0,与UI元素2-4和UI元素6-9之间的距离为1,并且与UI元素1、10-13之间的距离为2。As shown in FIG. 12 , the distances between UI element 5 and other UI elements determined in the above manner are as follows: UI element 5 has a distance of 0 from itself, and distances from UI elements 2-4 and UI elements 6-9. is 1, and the distance from UI elements 1, 10-13 is 2.
图13示出了根据本公开的实施例的距离的确定的示例1300的示意图。在某些实施例中,不同于图12仅将UI元素之间的中间间隔(例如,横向间隔、纵向间隔)考虑到横向间距和纵向间隔中,还可以将UI元素之间的中间UI元素的尺寸考虑到横向间距和纵向间隔中。如图13所示,横向间距可以表示第一UI元素与第二UI元素之间的一个或多个横向间隔的长度以及一个或多个中间UI元素的宽度之和。纵向间距可以表示第一UI元素与第二UI元素之间的一个或多个纵向间隔的长度以及一个或多个中间UI元素的高度之和。FIG. 13 shows a schematic diagram of an example 1300 of distance determination according to an embodiment of the present disclosure. In some embodiments, instead of only taking the intermediate spacing (eg, horizontal spacing, vertical spacing) between UI elements into account in the horizontal spacing and vertical spacing, as shown in FIG. Dimensions take into account horizontal spacing and vertical spacing. As shown in FIG. 13, the horizontal spacing may represent the sum of the lengths of one or more horizontal spacings between the first UI element and the second UI element and the width of one or more intermediate UI elements. The vertical spacing may represent the sum of the lengths of one or more vertical gaps between the first UI element and the second UI element and the height of one or more intermediate UI elements.
由此,可以基于横向间距和/或纵向间距,来确定距离。例如,UI元素5与UI元素13之间存在两个纵向间隔和一个中间UI元素9。因此,UI元素5与UI元素13的距离可以是这两个纵向间隔的长度以及UI元素9的高度之和。作为另一示例,UI元素11与UI元素13之间存在一个横向间隔和一个中间UI元素12。因此,UI元素11与UI元素13的距离可以是该横向间隔的长度以及UI元素12的宽度之和。此外,UI元素3与UI元素5之间存在一个 纵向间隔。因此UI元素3与UI元素5之间距离是该纵向间隔的长度。UI元素3与UI元素11之间存在三个纵向间隔和两个中间UI元素5和7。因此,UI元素3与UI元素11之间距离是该三个纵向间隔的长度和两个中间UI元素5和7的高度之和。UI元素3与UI元素2之间存在一个横向间隔。因此UI元素3与UI元素2之间的距离是该横向间隔的长度。Thus, the distance may be determined based on the lateral spacing and/or the longitudinal spacing. For example, there are two vertical spaces and an intermediate UI element 9 between UI element 5 and UI element 13 . Thus, the distance of UI element 5 from UI element 13 may be the sum of the lengths of these two longitudinal intervals and the height of UI element 9 . As another example, there is one lateral space and one intermediate UI element 12 between UI element 11 and UI element 13 . Thus, the distance of UI element 11 from UI element 13 may be the sum of the length of this lateral separation and the width of UI element 12 . Additionally, there is a vertical space between UI element 3 and UI element 5. Thus the distance between UI element 3 and UI element 5 is the length of this longitudinal interval. There are three vertical spaces and two intermediate UI elements 5 and 7 between UI element 3 and UI element 11 . Therefore, the distance between UI element 3 and UI element 11 is the sum of the length of the three longitudinal intervals and the height of the two intermediate UI elements 5 and 7 . There is a horizontal space between UI element 3 and UI element 2. So the distance between UI element 3 and UI element 2 is the length of this horizontal separation.
如图13所示,以上述方式确定的UI元素5与其它UI元素之间的距离如下:UI元素5与其本身的距离为0,与UI元素2-4和UI元素6-9之间的距离为1,并且与UI元素1、10-13与UI元素5之间的距离为2。As shown in Figure 13, the distances between UI element 5 and other UI elements determined in the above manner are as follows: the distance between UI element 5 and itself is 0, and the distance between UI elements 2-4 and UI elements 6-9 is 1 and the distance to UI element 1, 10-13 and UI element 5 is 2.
图14A和14B示出了根据本公开的实施例的距离的确定的示例1400A和1400B的示意图。在某些实施例中,除了考虑横向间隔和纵向间隔的长度以及中间UI元素的宽度和高度之外,还可以将操作方向考虑到横向间距和纵向间隔中。例如,在拖拽第一UI元素的情况下,操作方向可以是拖拽第一UI元素的方向。此外,虽然这里描述的是拖拽联动场景,然而如下文将要描述的,还存在深度联动场景和压力联动场景。在深度联动场景和压力联动场景中,也可以使用考虑操作方向的距离确定方式。具体地,在深度联动场景和压力联动场景中,UI元素可以被按压。在按压第一UI元素的情况下,虽然不存在操作方向,但是可以将是从第二UI元素指向第一UI元素的方向(诸如从第二基准点指向第一基准点的方向)视为操作方向,从而将操作方向考虑到横向间距和纵向间隔中。14A and 14B illustrate schematic diagrams of examples 1400A and 1400B of distance determinations in accordance with embodiments of the present disclosure. In some embodiments, in addition to considering the lengths of the horizontal and vertical spacing and the width and height of the intervening UI elements, the operation direction may also be taken into account in the horizontal and vertical spacing. For example, in the case of dragging the first UI element, the operation direction may be the direction of dragging the first UI element. In addition, although the drag linkage scenario is described here, as will be described below, there are also deep linkage scenarios and pressure linkage scenarios. In the depth linkage scene and the pressure linkage scene, the distance determination method considering the operation direction can also be used. Specifically, in the depth linkage scene and the pressure linkage scene, UI elements can be pressed. In the case of pressing the first UI element, although there is no operation direction, the direction from the second UI element to the first UI element (such as the direction from the second reference point to the first reference point) can be regarded as an operation direction, so that the direction of operation is taken into account in the horizontal and vertical spacing.
在这种情况下,可以首先利用参考图12和13描述的距离的确定方式来确定横向间距和/或纵向间距。然后,可以确定操作方向与水平方向和/或竖直方向的夹角。由此,可以利用三角函数原理,确定在操作方向上的距离。In this case, the lateral spacing and/or the longitudinal spacing may first be determined using the manner of determining the distance described with reference to FIGS. 12 and 13 . Then, the angle between the operation direction and the horizontal direction and/or the vertical direction can be determined. Thus, the distance in the operation direction can be determined using the principle of trigonometric functions.
在某些实施例中,如图14A所示,由于横向间距、纵向间距、以及操作方向1410A与水平方向或竖直方向的夹角已知,因此可以利用三角函数原理,确定操作方向1410A上的距离。In some embodiments, as shown in FIG. 14A , since the horizontal distance, the vertical distance, and the included angle between the operation direction 1410A and the horizontal direction or the vertical direction are known, the trigonometric function principle can be used to determine the distance between the operation direction 1410A and the horizontal direction. distance.
备选地,还可以根据操作方向与水平方向和竖直方向的夹角,选择水平方向和竖直方向中更接近操作方向的一者作为参考方向来确定操作方向上的距离。例如,如图14B所示,由于操作方向1430B更接近竖直方向,则可以选择竖直方向作为参考方向,并且基于纵向间距以及操作方向1430B与竖直方向的夹角,利用三角函数原理来确定操作方向1430B上的距离。作为另一示例,由于操作方向1420B更接近水平方向,则可以选择水平基于横向间距以及操作方向1420B与水平方向的夹角,利用三角函数原理来确定操作方向1420B上的距离。此外,参考方向可以是电子设备或用户可配置的,本公开在此不受限制。例如,参考方向可以被设置为水平方向、竖直方向或任何其他适当方向。Alternatively, the distance in the operation direction may be determined by selecting one of the horizontal direction and the vertical direction that is closer to the operation direction as the reference direction according to the included angle between the operation direction and the horizontal direction and the vertical direction. For example, as shown in FIG. 14B , since the operation direction 1430B is closer to the vertical direction, the vertical direction can be selected as the reference direction, and based on the longitudinal distance and the angle between the operation direction 1430B and the vertical direction, the principle of trigonometric function is used to determine Distance in operating direction 1430B. As another example, since the operation direction 1420B is closer to the horizontal direction, the horizontal distance in the operation direction 1420B can be determined based on the horizontal spacing and the angle between the operation direction 1420B and the horizontal direction, using the principle of trigonometric functions. Furthermore, the reference direction may be electronically or user-configurable, and the present disclosure is not limited herein. For example, the reference direction may be set to a horizontal direction, a vertical direction or any other suitable direction.
以上利用横向间距和纵向间距来确定操作方向上的距离。然而,如上所述,横向间距和纵向间距可以是通过中间间隔和中间UI元素的尺寸确定的。因此,操作方向上的距离也可以针对每个中间间隔和中间UI元素来分段确定。具体地,对于每个中间间隔和中间UI元素,都可以确定该中间间隔或该中间UI元素的尺寸、以及操作方向与水平方向或竖直方向的夹角。由此,可以利用三角函数原理,确定操作方向上的距离。然后,可以对针对每个中间间隔和中间UI元素确定的操作方向上的距离求和,以确定操作方向上的总距离。In the above, the distance in the operation direction is determined by using the horizontal distance and the vertical distance. However, as discussed above, the horizontal and vertical spacing may be determined by the size of the intermediate spacing and intermediate UI elements. Therefore, the distance in the manipulation direction can also be determined piecewise for each intermediate interval and intermediate UI element. Specifically, for each intermediate interval and intermediate UI element, the size of the intermediate interval or the intermediate UI element, and the included angle between the operation direction and the horizontal direction or the vertical direction can be determined. Thus, the distance in the operation direction can be determined by using the principle of trigonometric functions. The distances in the manipulation direction determined for each intermediate interval and intermediate UI element may then be summed to determine the total distance in the manipulation direction.
返回参考图8,在确定了第一UI元素与第二UI元素之间的距离之后,可以基于距离,来确定移动第二UI元素的动画效果。为此,在某些实施例中,可以确定第一UI元素响应于拖拽而移动的第一动画效果。如上所述,在某些实施例中,第一UI元素移动的第一动画效果可以由位移随时间变化的预定义曲线来控制。例如,预定义曲线可以为贝塞尔曲线或弹性力 曲线。Referring back to FIG. 8 , after the distance between the first UI element and the second UI element is determined, an animation effect of moving the second UI element may be determined based on the distance. To this end, in some embodiments, a first animation effect of the movement of the first UI element in response to the drag may be determined. As described above, in some embodiments, the first animation effect of the movement of the first UI element may be controlled by a predefined curve of displacement over time. For example, the predefined curve can be a Bezier curve or an elastic force curve.
由此,可以基于第一动画效果和第一UI元素与第二UI元素之间的距离来确定第二UI元素响应于拖拽而移动的动画效果。在某些实施例中,在第一UI元素移动的第一动画效果由位移随时间变化的预定义曲线来控制的情况下,可以基于第一UI元素的位移随时间变化的预定义曲线,来确定第二UI元素的位移随时间变化的曲线。例如,在弹性力曲线的情况下,可以基于距离传导弹簧的阻尼系数和/或弹性系数。在贝塞尔曲线的情况下,可以基于距离来传导贝塞尔曲线的至少一个控制点中的至少一者的坐标。如何将第一UI元素的动画效果传导到第二UI元素,从而得到第二UI元素的动画效果可以利用上文中详细描述的传导方式实现。因此,在此省略其描述。Thus, the animation effect of the movement of the second UI element in response to the drag may be determined based on the first animation effect and the distance between the first UI element and the second UI element. In some embodiments, in the case where the first animation effect of the movement of the first UI element is controlled by a predefined curve of the displacement of the first UI element over time, it may be based on the predefined curve of the displacement of the first UI element over time. A plot of the displacement of the second UI element versus time is determined. For example, in the case of an elastic force curve, the damping coefficient and/or the spring coefficient of the distance conduction spring can be based. In the case of a Bezier curve, the coordinates of at least one of the at least one control point of the Bezier curve may be conducted based on distance. How to transmit the animation effect of the first UI element to the second UI element, so as to obtain the animation effect of the second UI element, can be realized by using the transmission method described in detail above. Therefore, its description is omitted here.
以此方式,由于移动第二UI元素的动画效果由移动第一UI元素的动画效果以及第二UI元素与第一UI元素之间的距离来确定,因此可以实现直观、自然且符合用户的使用习惯的拖拽联动。In this way, since the animation effect of moving the second UI element is determined by the animation effect of moving the first UI element and the distance between the second UI element and the first UI element, an intuitive, natural and user-friendly use can be achieved Habitual drag linkage.
此外,在某些实施例中,第二UI元素的尺寸也可以影响其移动的动画效果。在这种情况下,第二UI元素的尺寸也可以被考虑以确定第二UI元素的动画效果。例如,第二UI元素尺寸越大,其可能受到联动的影响越小,因此第二UI元素移动的动画效果可以与其尺寸成反比。为此,在某些实施例中,可以基于第一幅度、距离以及第二UI元素的尺寸,来确定移动第二UI元素的动画效果。In addition, in some embodiments, the size of the second UI element can also affect the animation effect of its movement. In this case, the size of the second UI element may also be considered to determine the animation effect of the second UI element. For example, the larger the size of the second UI element, the less it may be affected by the linkage, so the animation effect of the movement of the second UI element can be inversely proportional to its size. To this end, in some embodiments, the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, and the size of the second UI element.
另外,在某些实施例中,第一UI元素的尺寸也可以影响第二UI元素移动的动画效果。在这种情况下,第一UI元素的尺寸也可以被考虑以确定第二UI元素的动画效果。例如,第一UI元素的尺寸越大,其可能产生的联动影响越大,因此第二UI元素移动的动画效果可以与第一UI元素的尺寸成正比。为此,在某些实施例中,可以基于第一幅度、距离以及第一UI元素的尺寸,来确定移动第二UI元素的动画效果。In addition, in some embodiments, the size of the first UI element may also affect the animation effect of the movement of the second UI element. In this case, the size of the first UI element may also be considered to determine the animation effect of the second UI element. For example, the larger the size of the first UI element, the greater the possible linkage effect, so the animation effect of the movement of the second UI element can be proportional to the size of the first UI element. To this end, in some embodiments, the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, and the size of the first UI element.
进一步地,如上所述,第一UI元素的尺寸和第二UI元素的尺寸都可能影响移动第二UI元素的动画效果。因此,在某些实施例中,可以基于第一幅度、距离、第一UI元素的尺寸和第二UI元素的尺寸,来确定移动第二UI元素的动画效果。Further, as described above, both the size of the first UI element and the size of the second UI element may affect the animation effect of moving the second UI element. Therefore, in some embodiments, the animation effect of moving the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
返回参考图8,在确定了移动第二UI元素的动画效果之后,可以使第二UI元素以该动画效果移动,以从视觉上指示第二UI元素随着第一UI元素移动。对于N个UI元素,都可以使其以各自的动画效果移动,以在整个屏幕上或者屏幕的部分区域上从视觉上指示拖拽,从而呈现拖拽联动。Referring back to FIG. 8, after the animation effect of moving the second UI element is determined, the second UI element may be moved with the animation effect to visually indicate that the second UI element moves with the first UI element. For N UI elements, they can all be moved with respective animation effects to visually indicate dragging on the entire screen or a partial area of the screen, thereby presenting a dragging linkage.
在某些实施例中,联动移动的UI元素的移动方向可以与拖拽方向相关联,从而在视觉上指示拖拽动作。为此,在某些实施例中,可以确定拖拽的方向,以及使第二UI元素与所确定的方向相关联地、以动画效果移动。In some embodiments, the movement direction of a UI element that moves in conjunction can be associated with the drag direction, thereby visually indicating the drag action. To this end, in some embodiments, the direction of the drag may be determined, and the second UI element may be animated to move in association with the determined direction.
此外,在某些实施例中,为了更好地呈现动画效果的传导,并且改善用户体验,第一UI元素和第二UI元素并非同时开始移动。例如,第一UI元素可以在拖拽发生时开始移动,而第二UI元素可以在拖拽发生一段时间之后开始移动。为此,在某些实施例中,可以基于第一UI元素与第二UI元素之间的距离确定一个延迟时间,以及响应于拖拽发生后经过了延迟时间,使第二UI元素移动。进一步地,在某些实施例中,可以确定延迟系数,并且基于距离和延迟系数来确定延迟时间。例如,延迟时间可以是距离除以延迟系数的商。延迟系数可以是电子设备和用户可配置的。Furthermore, in some embodiments, in order to better present the conduction of the animation effect and improve the user experience, the first UI element and the second UI element do not start to move at the same time. For example, a first UI element may start moving when the drag occurs, while a second UI element may start moving some time after the drag occurs. To this end, in some embodiments, a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is moved in response to the delay time elapsed after the drag occurs. Further, in some embodiments, a delay factor may be determined, and the delay time is determined based on the distance and the delay factor. For example, the delay time may be the quotient of the distance divided by the delay factor. The delay factor may be electronically and user configurable.
图15示出了根据本公开的实施例的延迟时间1500的示例的示意图。如图15所示,第一UI元素(例如,UI元素5)在拖拽发生时开始移动,距离为1的UI元素(例如,UI元素3、4、7、8)的移动晚于第一UI元素,距离为2的UI元素(例如,UI元素2、6、9)的移动晚于距离为1的UI元素,并且距离为3的UI元素(例如,UI元素1、10-13)的移动晚于距离为2的UI元素。FIG. 15 shows a schematic diagram of an example of a delay time 1500 according to an embodiment of the present disclosure. As shown in Figure 15, the first UI element (eg, UI element 5) starts to move when the drag occurs, and the UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) move later than the first UI elements, UI elements with distance 2 (eg, UI elements 2, 6, 9) move later than UI elements with distance 1, and UI elements with distance 3 (eg, UI elements 1, 10-13) Move later than UI elements with a distance of 2.
以此方式,可以加强不同UI元素的动画效果之间的联系,并且突出各个独立UI元素之间的关系。相比于动画效果单一、每个UI元素都是独立的且无联系的传统动画,本公开的实施例能够使得动画效果更符合物理规律,并且考虑到了真实使用场景和用户使用习惯,从而可以显著提高用户体验。In this way, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted. Compared with the traditional animation in which the animation effect is single and each UI element is independent and unrelated, the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
在上文中,对实现拖拽联动的过程进行了详细描述,以下将进一步描述不同场景下的拖拽联动。这些场景包括:UI元素完全跟手移动的场景、UI元素不完全跟手移动的场景、UI元素在松手或抛滑后继续移动的场景、UI元素在松手或抛滑后继续移动并且回弹的场景。应当理解,这些场景可以相互组合,以合成更丰富的动画效果。例如,UI元素可以不完全跟手移动,并且在松手或抛滑后继续移动。作为另一示例,UI元素可以不完全跟手移动,并且在松手或抛滑后继续移动并且回弹。在下文中,将以UI元素5被拖拽并且UI元素2-4和6-9联动移动为例进行描述。In the above, the process of realizing the drag linkage is described in detail, and the drag linkage in different scenarios will be further described below. These scenarios include: scenarios where UI elements move completely with the hand, scenarios where UI elements do not completely move with hands, scenarios where UI elements continue to move after letting go or slip, and scenarios where UI elements continue to move and rebound after letting go or slip Scenes. It should be understood that these scenes can be combined with each other to synthesize richer animation effects. For example, UI elements may not fully follow the hand and continue to move after letting go or slipping. As another example, UI elements may not move completely with the hand, and continue to move and bounce back after letting go or slipping. In the following, description will be given by taking an example that the UI element 5 is dragged and the UI elements 2-4 and 6-9 are moved in conjunction.
图16A示出了根据本公开的实施例的UI元素完全跟手移动的场景1600A的示例的示意图。图16B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线1600B的示例的示意图。FIG. 16A shows a schematic diagram of an example of a scene 1600A in which UI elements move completely with the hand, according to an embodiment of the present disclosure. 16B shows a schematic diagram of an example of a displacement time curve 1600B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
如图16A和16B所示,在T11,UI元素5被拖拽。在T11a,UI元素5开始跟随手指的拖拽移动。在某些实施例中,如果UI元素5在拖拽发生时开始移动,则T11a可以等于T11。备选地,如果UI元素5在拖拽发生后开始移动,则T11a可以大于T11。此外,除了被拖拽的UI元素5以外,其他UI元素(例如,UI元素2-4和6-9)也联动移动。应当理解,为了清楚,其他UI元素被示出为与UI元素5同时开始移动。然而,如上所述,其他UI元素可以在各自延迟时间之后开始移动。As shown in FIGS. 16A and 16B, at T11, UI element 5 is dragged. At T11a, UI element 5 starts to move following the drag of the finger. In some embodiments, T11a may be equal to T11 if UI element 5 begins to move when the drag occurs. Alternatively, T11a may be greater than T11 if UI element 5 begins to move after the drag occurs. Furthermore, in addition to the dragged UI element 5, other UI elements (eg, UI elements 2-4 and 6-9) also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
在T12,用户松手或抛滑,在这种情况下,结束拖拽UI元素5。在T12a,UI元素5停止移动。在某些实施例中,如果UI元素5在松手或抛滑时停止移动,T12a可以等于T12。备选地,如果UI元素5在松手或抛滑后停止移动,则T12a可以大于T12。此时,UI元素5在拖拽方向上的位移为S10。距离为1的UI元素3、4、7、8在拖拽方向上的位移为S11。距离为2的UI元素2、6、9在拖拽方向上的位移为S12。位移S10大于位移S11,并且位移S11大于位移S12。此时,UI元素5停止移动,而距离为1的UI元素3、4、7、8和距离为2的UI元素2、6、9继续以预定义曲线(例如,弹性力曲线)控制的动画效果移动。At T12, the user releases or slips, in which case the dragging of UI element 5 ends. At T12a, UI element 5 stops moving. In some embodiments, T12a may be equal to T12 if UI element 5 stops moving when released or slipped. Alternatively, T12a may be greater than T12 if UI element 5 stops moving after being released or slipped. At this time, the displacement of the UI element 5 in the dragging direction is S10. The displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is S11. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S12. Displacement S10 is greater than displacement S11, and displacement S11 is greater than displacement S12. At this point, UI element 5 stops moving, while UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 continue the animation controlled with a predefined curve (eg, an elastic force curve) The effect moves.
在T13,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。另外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T13, the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 decreases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the distance in the drag direction increases between UI elements 3, 4, 7, and 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction.
在T14,UI元素5在拖拽方向上的位移保持为S10。距离为1的UI元素3、4、7、8在拖拽方向上移动位移S10,并且停止移动。距离为2的UI元素2、6、9在拖拽方向上的位移尚未达到S10,并且继续以预定义曲线控制的动画效果移动。与T13相比,距离为1的UI 元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距增大。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距减小。At T14, the displacement of the UI element 5 in the drag direction remains at S10. The UI elements 3, 4, 7, and 8 with a distance of 1 move by displacement S10 in the drag direction, and stop moving. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction has not yet reached S10, and continues to move with an animation effect controlled by a predefined curve. Compared with T13, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction increases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction is reduced.
在T15,UI元素5以及距离为1的UI元素3、4、7、8在拖拽方向上的位移保持为S10。距离为2的UI元素2、6、9在拖拽方向上移动位移S10,并且停止移动。由此,完成拖拽联动。At T15, the displacements of UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction remain at S10. UI elements 2, 6, 9 with a distance of 2 move a displacement S10 in the drag direction, and stop moving. Thereby, the drag linkage is completed.
图17A示出了根据本公开的实施例的UI元素不完全跟手移动的场景1700A的示例的示意图。图17B示出了根据本公开的实施例的UI元素不完全跟手移动的场景的位移时间曲线1700B的示例的示意图。17A shows a schematic diagram of an example of a scene 1700A in which UI elements do not completely follow the hand, according to an embodiment of the present disclosure. 17B shows a schematic diagram of an example of a displacement time curve 1700B for a scene in which a UI element does not completely follow the hand, according to an embodiment of the present disclosure.
如图17A和17B所示,在T21,UI元素5被拖拽。在T21a,UI元素5开始跟随手指的拖拽移动。在某些实施例中,如果UI元素5在拖拽发生时开始移动,则T21a可以等于T21。备选地,如果UI元素5在拖拽发生后开始移动,则T21a可以大于T21。此外,除了被拖拽的UI元素5以外,其他UI元素(例如,UI元素2-4和6-9)也联动移动。应当理解,为了清楚,其他UI元素被示出为与UI元素5同时开始移动。然而,如上所述,其他UI元素可以在各自延迟时间之后开始移动。As shown in FIGS. 17A and 17B, at T21, UI element 5 is dragged. At T21a, UI element 5 begins to move following the drag of the finger. In some embodiments, T21a may be equal to T21 if UI element 5 begins to move when the drag occurs. Alternatively, T21a may be greater than T21 if UI element 5 starts to move after the dragging occurs. Furthermore, in addition to the dragged UI element 5, other UI elements (eg, UI elements 2-4 and 6-9) also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
在T22,用户松手或抛滑,在这种情况下,结束拖拽UI元素5。在T22a,UI元素5停止移动。在某些实施例中,如果UI元素5在松手或抛滑时停止移动,则T22a可以等于T22。备选地,如果UI元素5在松手或抛滑后停止移动,则T22a可以大于T22。此时,手指在拖拽方向上的位移为SF2。UI元素5在拖拽方向上的位移为S20。距离为1的UI元素3、4、7、8在拖拽方向上的位移为S21。距离为2的UI元素2、6、9在拖拽方向上的位移为S22。位移SF2大于位移S20,位移S20大于位移S21,并且位移S21大于位移S22。此时,UI元素5停止移动,而距离为1的UI元素3、4、7、8和距离为2的UI元素2、6、9继续以预定义曲线(例如,弹性力曲线)控制的动画效果移动。与T21相比,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距增大。距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T22, the user releases or swipes, in which case dragging UI element 5 ends. At T22a, UI element 5 stops moving. In some embodiments, T22a may be equal to T22 if UI element 5 stops moving when released or slipped. Alternatively, T22a may be greater than T22 if the UI element 5 stops moving after being released or slipped. At this time, the displacement of the finger in the dragging direction is SF2. The displacement of the UI element 5 in the dragging direction is S20. The displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S21. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S22. Displacement SF2 is greater than displacement S20, displacement S20 is greater than displacement S21, and displacement S21 is greater than displacement S22. At this point, UI element 5 stops moving, while UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 continue the animation controlled with a predefined curve (eg, an elastic force curve) The effect moves. Compared with T21, the distance between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is increased. The spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
在T23,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。另外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T23, the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 decreases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the distance in the drag direction increases between UI elements 3, 4, 7, and 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction.
在T24,UI元素5在拖拽方向上的位移保持为S20。距离为1的UI元素3、4、7、8在拖拽方向上移动位移S20,并且停止移动。距离为2的UI元素2、6、9在拖拽方向上的位移尚未达到S20,并且继续以预定义曲线控制的动画效果移动。与T23相比,距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距增大。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距减小。At T24, the displacement of the UI element 5 in the drag direction remains at S20. The UI elements 3, 4, 7, and 8 with a distance of 1 move the displacement S20 in the drag direction, and stop moving. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the dragging direction has not yet reached S20, and continues to move with an animation effect controlled by a predefined curve. Compared with T23, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction increases. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction is reduced.
在T25,UI元素5以及距离为1的UI元素3、4、7、8在拖拽方向上的位移保持为S20。距离为2的UI元素2、6、9在拖拽方向上移动位移S20,并且停止移动。由此,完成拖拽联 动。At T25, the displacements of UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction remain at S20. UI elements 2, 6, 9 with a distance of 2 move in the drag direction by displacement S20, and stop moving. Thereby, the drag linkage is completed.
在参考图16A-17B描述的场景中,在停止拖拽之后,UI元素5都停止移动。然而,UI元素5还可以在停止拖拽之后,继续移动一段距离。在某些实施例中,该距离可以如上所述基于摩擦力模型确定。UI元素5在停止拖拽之后是否继续移动是电子设备和用户可配置的。例如,如果电子设备被配置为允许松手或抛滑后继续移动,则UI元素5可以继续移动。反之,UI元素5将随着拖拽停止而停止移动。In the scenario described with reference to Figures 16A-17B, UI elements 5 all stop moving after stopping the dragging. However, the UI element 5 may also continue to move a certain distance after stopping the dragging. In some embodiments, the distance may be determined based on a friction force model as described above. Whether the UI element 5 continues to move after stopping the drag is electronically device and user configurable. For example, if the electronic device is configured to allow continued movement after a release or slip, UI element 5 may continue to move. Conversely, UI element 5 will stop moving as the dragging stops.
图18A示出了根据本公开的实施例的UI元素完全跟手移动的场景1800A的示例的示意图。图18B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线1800B的示例的示意图。FIG. 18A shows a schematic diagram of an example of a scene 1800A in which UI elements move completely with the hand, according to an embodiment of the present disclosure. 18B shows a schematic diagram of an example of a displacement time curve 1800B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
如图18A和18B所示,在T31,UI元素5被拖拽。在T11a,UI元素5开始跟随手指的拖拽移动。在某些实施例中,如果UI元素5在拖拽发生时开始移动,则T31a可以等于T31。备选地,如果UI元素5在拖拽发生后开始移动,则T31a可以大于T31。此外,除了被拖拽的UI元素5以外,其他UI元素(例如,UI元素2-4和6-9)也联动移动。应当理解,为了清楚,其他UI元素被示出为与UI元素5同时开始移动。然而,如上所述,其他UI元素可以在各自延迟时间之后开始移动。As shown in FIGS. 18A and 18B, at T31, UI element 5 is dragged. At T11a, UI element 5 starts to move following the drag of the finger. In some embodiments, T31a may be equal to T31 if UI element 5 begins to move when the drag occurs. Alternatively, T31a may be greater than T31 if UI element 5 begins to move after the drag occurs. Furthermore, in addition to the dragged UI element 5, other UI elements (eg, UI elements 2-4 and 6-9) also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
在T32,用户松手或抛滑,在这种情况下,结束拖拽UI元素5。在T32a,UI元素5继续以预定义曲线(例如,弹性力曲线)控制的动画效果移动。在某些实施例中,如果在结束拖拽时,UI元素5以预定义曲线控制的动画效果移动,则T32a可以等于T32。备选地,如果在结束拖拽之后,UI元素5以预定义曲线控制的动画效果移动,则T32a可以大于T32。此时,UI元素5在拖拽方向上的位移为SF3。距离为1的UI元素3、4、7、8在拖拽方向上的位移为S31。距离为2的UI元素2、6、9在拖拽方向上的位移为S32。位移SF3大于位移S31,并且位移S31大于位移S32。此外,距离为1的UI元素3、4、7、8和距离为2的UI元素2、6、9也继续以预定义曲线的动画效果移动。与T31相比,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距增大。距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T32, the user releases or swipes, in which case dragging UI element 5 ends. At T32a, UI element 5 continues to move with an animation effect controlled by a predefined curve (eg, an elastic force curve). In some embodiments, T32a may be equal to T32 if the UI element 5 moves with an animation controlled by a predefined curve when the drag is ended. Alternatively, T32a may be greater than T32 if the UI element 5 is moved with an animation effect controlled by a predefined curve after the end of the drag. At this time, the displacement of the UI element 5 in the drag direction is SF3. The displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S31. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the drag direction is S32. The displacement SF3 is greater than the displacement S31, and the displacement S31 is greater than the displacement S32. In addition, UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 also continue to move with the animation effect of the predefined curve. Compared with T31, the distance in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 is increased. The spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
在T33,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距增大。距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T33, the spacing in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 increases. The spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
在T34,全部UI元素继续以预定义曲线控制的动画效果移动。与T33相比,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距减小。距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距增大。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距减小。At T34, all UI elements continue to move with the animation controlled by the predefined curve. Compared with T33, the distance in the drag direction between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 is reduced. The spacing in the drag direction increases between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction. Furthermore, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction is reduced.
在T35,全部UI元素在拖拽方向上移动位移S30,并且停止移动。停止移动的位置处的位移S30与松手或抛滑的位置处的位移SF3之间的、在拖拽方向上的距离可以如上所述基于摩擦力模型确定。由此,完成拖拽联动。At T35, all UI elements move in the drag direction by displacement S30, and stop moving. The distance in the drag direction between the displacement S30 at the position where the movement is stopped and the displacement SF3 at the position where the hand is released or slipped can be determined based on the friction force model as described above. Thereby, the drag linkage is completed.
进一步地,在某些实施例中,在停止拖拽之后UI元素继续移动的情况下,UI元素可以回弹一段距离。如上所述,在欠阻尼状态下,弹簧的位移随时间在正负值之间震荡。因此,可以利用欠阻尼状态的弹性力曲线来控制UI元素的回弹。Further, in some embodiments, if the UI element continues to move after the drag is stopped, the UI element can bounce back a certain distance. As mentioned above, in the underdamped state, the displacement of the spring oscillates between positive and negative values over time. Therefore, the spring force curve of the underdamped state can be used to control the springback of UI elements.
应当理解,在图18A-18B中,UI元素被示出为允许彼此重叠,例如在时间T32-T34,UI元素8与UI元素9重叠。然而,可以不允许UI元素彼此重叠。是否允许重叠是电子设备或用户可配置的。在允许重叠的情况下,UI元素的移动遵循欠阻尼状态的弹性力曲线。在不允许重叠的情况下,UI元素的移动遵循过阻尼状态的弹性力曲线。进一步地,任何两个UI元素是否重叠还可以取决于这两个UI元素的相对移动幅度。例如,在两个UI元素的相对移动幅度小的情况下,UI元素通常不会重叠。而在两个UI元素的相对移动幅度大的情况下,UI元素可能重叠。It should be appreciated that in Figures 18A-18B UI elements are shown to be allowed to overlap each other, eg UI element 8 overlaps UI element 9 at times T32-T34. However, UI elements may not be allowed to overlap each other. Whether overlapping is allowed is electronically device or user configurable. Movement of UI elements follows the elastic force curve of the underdamped state, with overlap allowed. The movement of UI elements follows the elastic force curve of the overdamped state without allowing overlap. Further, whether any two UI elements overlap may also depend on the relative movement magnitudes of the two UI elements. For example, where the relative movement of the two UI elements is small, the UI elements generally do not overlap. In the case of a large relative movement of the two UI elements, the UI elements may overlap.
图19A示出了根据本公开的实施例的UI元素完全跟手移动的场景1900A的示例的示意图。图19B示出了根据本公开的实施例的UI元素完全跟手移动的场景的位移时间曲线1900B的示例的示意图。FIG. 19A shows a schematic diagram of an example of a scene 1900A in which UI elements move completely with the hand, according to an embodiment of the present disclosure. 19B shows a schematic diagram of an example of a displacement time curve 1900B for a scene in which a UI element completely moves with the hand, according to an embodiment of the present disclosure.
如图19A和19B所示,在T41,UI元素5被拖拽。在T41a,UI元素5开始跟随手指的拖拽移动。在某些实施例中,如果UI元素5在拖拽发生时开始移动,则T41a可以等于T41。备选地,如果UI元素5在拖拽发生后开始移动,则T41a可以大于T41。此外,除了被拖拽的UI元素5以外,其他UI元素(例如,UI元素2-4和6-9)也联动移动。应当理解,为了清楚,其他UI元素被示出为与UI元素5同时开始移动。然而,如上所述,其他UI元素可以在各自延迟时间之后开始移动。As shown in FIGS. 19A and 19B, at T41, UI element 5 is dragged. At T41a, UI element 5 begins to move following the drag of the finger. In some embodiments, T41a may be equal to T41 if UI element 5 begins to move when the drag occurs. Alternatively, T41a may be greater than T41 if UI element 5 begins to move after the drag occurs. Furthermore, in addition to the dragged UI element 5, other UI elements (eg, UI elements 2-4 and 6-9) also move in conjunction. It should be understood that other UI elements are shown as starting to move at the same time as UI element 5 for clarity. However, as mentioned above, other UI elements may start moving after their respective delay times.
在T42,用户松手或抛滑,在这种情况下,结束拖拽UI元素5。在T42a,UI元素5继续以预定义曲线(例如,弹性力曲线)控制的动画效果移动。在某些实施例中,如果在结束拖拽时,UI元素5以预定义曲线控制的动画效果移动,则T42a可以等于T42。备选地,如果在结束拖拽之后,UI元素5以预定义曲线控制的动画效果移动,则T42a可以大于T42。此时,UI元素5在拖拽方向上的位移为SF4。距离为1的UI元素3、4、7、8在拖拽方向上的位移为S41。距离为2的UI元素2、6、9在拖拽方向上的位移为S42。位移SF4大于位移S41,并且位移S41大于位移S42。此外,距离为1的UI元素3、4、7、8和距离为2的UI元素2、6、9也继续以预定义曲线的动画效果移动。与T41相比,UI元素5与距离为1的UI元素3、4、7、8之间的、在拖拽方向上的间距增大。距离为1的UI元素3、4、7、8与在拖拽方向上的距离为2的UI元素9之间的、在拖拽方向上的间距减小。此外,距离为1的UI元素3、4、7、8与在拖拽方向相反方向上的距离为2的UI元素2、6之间的、在拖拽方向上的间距增大。At T42, the user releases or swipes, in which case dragging UI element 5 ends. At T42a, UI element 5 continues to move with an animation effect controlled by a predefined curve (eg, an elastic force curve). In some embodiments, T42a may be equal to T42 if the UI element 5 moves with an animation controlled by a predefined curve when the drag is ended. Alternatively, T42a may be greater than T42 if the UI element 5 is moved with an animation effect controlled by a predefined curve after ending the drag. At this time, the displacement of the UI element 5 in the drag direction is SF4. The displacement of UI elements 3, 4, 7, and 8 with a distance of 1 in the dragging direction is S41. The displacement of UI elements 2, 6, and 9 with a distance of 2 in the dragging direction is S42. The displacement SF4 is greater than the displacement S41, and the displacement S41 is greater than the displacement S42. In addition, UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6, and 9 with a distance of 2 also continue to move with the animation effect of the predefined curve. Compared with T41, the distance between UI element 5 and UI elements 3, 4, 7, and 8 with a distance of 1 in the drag direction is increased. The spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI element 9 with a distance of 2 in the drag direction decreases. In addition, the spacing in the drag direction between UI elements 3, 4, 7, 8 with a distance of 1 and UI elements 2, 6 with a distance of 2 in the opposite direction to the drag direction increases.
在T43,UI元素5在拖拽方向上移动位移S40,并且开始回弹。在某些实施例中,回弹的位置处在拖拽方向上的位移S40与松手或抛滑的位置处在拖拽方向上的位移SF4之间的距离可以如上所述基于摩擦力模型确定。At T43, the UI element 5 moves the displacement S40 in the drag direction, and starts to spring back. In some embodiments, the distance between the displacement S40 in the drag direction at the position of the rebound and the displacement SF4 in the drag direction at the position of the release or slip may be determined based on the friction force model as described above.
在T44,距离为2的UI元素9在拖拽方向上移动位移S40,并且也开始回弹。At T44, the UI element 9 with a distance of 2 moves a displacement S40 in the drag direction, and also starts to spring back.
在T45,全部UI元素在拖拽方向上回弹回位移SF4,并且停止移动。由此,完成拖拽联动。At T45, all UI elements bounce back to displacement SF4 in the drag direction, and stop moving. Thereby, the drag linkage is completed.
应当理解,虽然UI元素5被示出为先于距离为1的UI元素3、4、7、8回弹,并且距离为1的UI元素3、4、7、8被示出为先于距离为2的UI元素2、6、9回弹,但是全部UI元 素可以一起回弹。例如,UI元素5可以停止移动以等待其他UI元素移动位移S40,然后开始一起回弹。此外,虽然全部UI元素被示出为回弹到松手或抛滑的位置,但是全部UI元素可以更大幅度的回弹或者更小幅度的回弹,本公开的实施例不受此限制。It should be understood that while UI element 5 is shown to bounce ahead of UI elements 3, 4, 7, 8 with distance 1, and UI elements 3, 4, 7, 8 with distance 1 are shown to precede distance UI elements 2, 6, and 9 for 2 bounce back, but all UI elements can bounce together. For example, UI element 5 may stop moving to wait for other UI elements to move by displacement S40, and then start bouncing back together. In addition, although all UI elements are shown as rebounding to the position of letting go or slipping, all UI elements may rebound more or less, and the embodiments of the present disclosure are not limited thereto.
深度联动Deep linkage
本公开的实施例涉及UI中的UI元素在深度方向上的联动,也被称为深度联动。深度方向是指与电子设备的屏幕垂直的方向。在深度联动中,被按压的目标UI元素可以影响没有被按压的其他UI元素。具体地,在深度联动中,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果,使得其他UI元素都受到目标UI元素的影响。例如,在深度联动中,在一持续时间期间按压目标UI元素时,除了该目标UI元素随时间缩放之外,其他UI元素也可以以相应幅度缩放,从而在视觉上呈现联动地缩放。The embodiments of the present disclosure relate to the linkage of UI elements in the UI in the depth direction, which is also referred to as depth linkage. The depth direction refers to a direction perpendicular to the screen of the electronic device. In deep linkage, the pressed target UI element can affect other UI elements that are not pressed. Specifically, in deep linkage, triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element . For example, in deep linkage, when a target UI element is pressed during a duration, in addition to the scale of the target UI element over time, other UI elements can also be scaled by a corresponding magnitude, thereby visually showing a linked scaling.
由此,可以加强不同UI元素的动画效果之间的联系,并且突出各个独立UI元素之间的关系。相比于动画效果单一、每个UI元素都是独立的且无联系的传统动画,本公开的实施例能够使得动画效果更符合物理规律,并且考虑到了真实使用场景和用户使用习惯,从而可以显著提高用户体验。Thereby, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted. Compared with the traditional animation in which the animation effect is single and each UI element is independent and unrelated, the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
以下将参考附图20至图33描述深度联动的一些示例实施例。Some example embodiments of deep linkage will be described below with reference to FIGS. 20 to 33 .
深度联动可以发生在具有任何适当的规则或不规则的布局的UI中,并且该UI中的UI元素可以具有任何适当的尺寸和形状。例如,深度联动可以发生在如图3A-3C所示的UI300A-300C中。Deep linkage can occur in a UI with any suitable regular or irregular layout, and UI elements in the UI can have any suitable size and shape. For example, deep linkage can occur in UIs 300A-300C as shown in Figures 3A-3C.
UI中的UI元素可以被按压。例如,在用户期望执行与UI元素相关联的操作时,用户可以按压UI元素。作为示例,在用户期望进入UI元素所表示的应用程序、打开与UI元素相关联的菜单等时,用户可以按压UI元素。在检测到UI元素处的按压的情况下,UI元素可以发生变化,例如UI元素可以缩放,以在深度方向上呈现按压动作。例如,UI元素可以缩小,以在深度方向上呈现远离。备选地,UI元素可以放大,以在深度方向上呈现靠近。在下文中,将以UI元素缩小为例来描述缩放。然而,应当理解,缩放也可以是放大UI元素。UI elements in the UI can be pressed. For example, a user may press a UI element when the user desires to perform an operation associated with the UI element. As an example, a user may press a UI element when the user desires to enter an application represented by the UI element, open a menu associated with the UI element, and the like. In the event that a press at the UI element is detected, the UI element may change, eg, the UI element may be scaled to render the press action in the depth direction. For example, UI elements can be scaled down to render away in the depth direction. Alternatively, UI elements can be enlarged to render close in depth direction. Hereinafter, zooming will be described taking UI element zooming out as an example. However, it should be understood that zooming may also be enlarging UI elements.
图20示出了根据本公开的一些实施例的UI元素在被按压时的变化2000的示例的示意图。如图20所示,在检测到UI元素处的按压的情况下,UI元素可以缩小,以在深度方向上呈现远离。20 shows a schematic diagram of an example of a UI element changing 2000 when pressed, according to some embodiments of the present disclosure. As shown in FIG. 20, upon detection of a press at the UI element, the UI element can be zoomed out to appear away in the depth direction.
UI元素的变化可以符合面压力模型。在面压力模型中,UI元素中的每个部分(例如,每个像素点或以任何其他适当方式划分的每个部分)处的压力相同。也就是说,无论按压在UI元素的哪个部分(例如,无论按压在UI元素中心还是按压在UI元素边缘),对于UI元素的所有部分,压力都相同。因此,无论按压在UI元素的哪个部分,UI元素的变化将是相同的。Changes in UI elements can conform to the surface pressure model. In a face pressure model, the pressure is the same at every part of the UI element (eg, every pixel or every part divided in any other suitable way). That is, the pressure is the same for all parts of the UI element, regardless of which part of the UI element is pressed (eg, whether the center of the UI element is pressed or the edge of the UI element). So no matter which part of the UI element is pressed, the UI element changes will be the same.
图21示出了根据本公开的一些实施例的UI元素在不同位置处被按压时的变化2100的示例的示意图。如图21所示,无论在UI元素中心还是UI元素边缘处检测到按压,UI元素都可以以相同幅度缩小,以在深度方向上呈现远离。21 shows a schematic diagram of an example of a change 2100 of a UI element as it is pressed at different locations, according to some embodiments of the present disclosure. As shown in Figure 21, whether a press is detected at the center of the UI element or the edge of the UI element, the UI element can be shrunk by the same amount to appear away in the depth direction.
此外,如图21所示,在UI元素缩小之后,按压的位置可能不再处于缩小后的UI元素的范围内。在这种情况下,由于按压的位置仍然处于缩小前的UI元素的范围内,或者任何其他适当范围内,按压可以继续被检测为针对UI元素的按压。备选地,由于按压的位置不再处于 缩小后的UI元素的范围内,按压将不被检测为针对UI元素的按压。在这种情况下,可以认为按压结束。Furthermore, as shown in FIG. 21 , after the UI element is shrunk, the pressed position may no longer be within the range of the shrunk UI element. In this case, since the location of the press is still within the range of the UI element before zooming out, or any other suitable range, the press can continue to be detected as a press on the UI element. Alternatively, since the location of the press is no longer within the scope of the reduced UI element, the press will not be detected as a press on the UI element. In this case, the compression can be considered to be over.
此外,在某些实施例中,为了使得UI元素的变化符合自然规律和用户使用习惯,变化的幅度可以取决于按压的力的大小。在真实世界中,力的大小通常是指真实的力的大小。在这种情况下,按压的力越大,在深度方向上的变化越大。在某些实施例中,按压的力可以是电子设备检测到的用户施加的按压的力。备选地,按压的力也可以是由电子设备或者用户设置预定按压力。In addition, in some embodiments, in order to make the changes of UI elements conform to natural laws and user usage habits, the magnitude of the changes may depend on the magnitude of the pressing force. In the real world, the magnitude of the force usually refers to the actual magnitude of the force. In this case, the greater the pressing force, the greater the change in the depth direction. In some embodiments, the force of the pressing may be the force of the pressing applied by the user detected by the electronic device. Alternatively, the pressing force may also be a predetermined pressing force set by the electronic device or the user.
图22示出了根据本公开的一些实施例的UI元素在不同按压力时的变化2200的示例的示意图。如图22所示,在按压力大的情况下,UI元素可以以更大幅度缩小,以在深度方向上呈现更大程度的远离。在某些实施例中,UI元素甚至可以缩小到从UI中消失,即缩小到尺寸为0,从而在深度方向上呈现最大程度的远离。作为对照,在按压力小的情况下,UI元素可以以更小幅度缩小,以在深度方向上呈现更小程度的远离。FIG. 22 shows a schematic diagram of an example of a UI element changing 2200 at different pressing forces in accordance with some embodiments of the present disclosure. As shown in Figure 22, in the case of a large pressing force, the UI elements can be shrunk by a larger margin to present a greater degree of distance in the depth direction. In some embodiments, UI elements may even shrink to disappear from the UI, ie, to a size of 0, so as to appear as far away as possible in the depth direction. In contrast, in the case of a small pressing force, the UI elements can be shrunk by a smaller amount to present a smaller degree of separation in the depth direction.
然而,本公开的实施例不限于此。UI元素响应于不同按压力的缩放方式是电子设备或用户可配置的。例如,在按压力大的情况下,UI元素可以以更小幅度缩小,而在按压力小的情况下,UI元素可以以更大幅度缩小。However, embodiments of the present disclosure are not limited thereto. How UI elements scale in response to different pressing forces is electronically device or user configurable. For example, UI elements can shrink in smaller increments when the pressing force is high, and can shrink by a larger amount when the pressing force is small.
进一步地,在电子设备中,完全基于真实的按压的力进行深度方向上的变化可能对用户要求较高,并且可能需要电子设备配备相关硬件。因此,在某些实施例中,可以用按压的时间来模拟或替换按压的力。例如,如果按压的时间越长,则可以认为按压的力越大,由此在深度方向上的变化越大。Further, in an electronic device, the change in the depth direction based entirely on the real pressing force may have high requirements on the user, and may require the electronic device to be equipped with relevant hardware. Thus, in some embodiments, the time of the compression may be used to simulate or replace the force of the compression. For example, if the pressing time is longer, it can be considered that the pressing force is larger, and thus the change in the depth direction is larger.
图23示出了根据本公开的一些实施例的UI元素在不同按压持续时间时的变化2300的示例的示意图。如图23所示,在按压的持续时间长的情况下,UI元素可以以更大幅度缩小,以在深度方向上呈现更大程度的远离。在某些实施例中,UI元素甚至可以缩小到从UI中消失,即缩小到尺寸为0,从而在深度方向上呈现最大程度的远离。作为对照,在按压的持续时间短的情况下,UI元素可以以更小幅度缩小,以在深度方向上呈现更小程度的远离。23 shows a schematic diagram of an example of a change 2300 of UI elements at different press durations, according to some embodiments of the present disclosure. As shown in FIG. 23 , in the case where the duration of the pressing is long, the UI element can be shrunk by a larger amount to present a greater degree of distance in the depth direction. In some embodiments, UI elements may even shrink to disappear from the UI, ie, to a size of 0, so as to appear as far away as possible in the depth direction. In contrast, where the duration of the press is short, the UI element may shrink by a smaller amount to present a smaller degree of separation in the depth direction.
然而,本公开的实施例不限于此。UI元素响应于不同按压持续时间的缩放方式是电子设备或用户可配置的。例如,在按压的持续时间长的情况下,UI元素可以以更小幅度缩小,而在按压的持续时间短的情况下,UI元素可以以更大幅度缩小。However, embodiments of the present disclosure are not limited thereto. How UI elements scale in response to different press durations is electronically device or user configurable. For example, where the duration of the press is long, the UI element may shrink by a smaller amount, and when the duration of the press is short, the UI element may shrink by a larger amount.
此外,在某些实施例中,为了进一步使得UI元素的变化符合自然规律和用户使用习惯,变化的幅度可以取决于UI元素的尺寸。例如,直观上,相同的按压可能难以按下较大的UI元素,而可以较轻松地按下较小的UI元素。在这种情况下,较大的UI元素受按压的影响可以较小,而较小的UI元素受按压的影响可以较大。In addition, in some embodiments, in order to further make the changes of UI elements conform to natural laws and user usage habits, the magnitude of changes may depend on the sizes of UI elements. For example, intuitively, the same press may be difficult to press on a larger UI element, while it may be easier to press on a smaller UI element. In this case, larger UI elements may be less affected by presses, while smaller UI elements may be more affected by presses.
图24示出了根据本公开的一些实施例的UI元素在不同尺寸时的变化2400的示例的示意图。如图24所示,在UI元素的尺寸大的情况下,UI元素可以以更大幅度缩小,以在深度方向上呈现更大程度的远离。作为对照,在UI元素的尺寸小的情况下,UI元素可以以更小幅度缩小,以在深度方向上呈现更小程度的远离。24 shows a schematic diagram of an example of a UI element changing 2400 at different sizes, according to some embodiments of the present disclosure. As shown in FIG. 24 , in the case where the size of the UI element is large, the UI element can be shrunk by a larger magnitude to present a greater degree of distance in the depth direction. In contrast, in the case where the size of the UI element is small, the UI element can be reduced by a smaller amount to present a smaller degree of separation in the depth direction.
然而,本公开的实施例不限于此。UI元素在不同尺寸时的缩放方式是电子设备或用户可配置的。例如,为了使得缩放后的UI元素的尺寸更为均衡,较大的UI元素受按压的影响可以较大,而较小的UI元素受按压的影响可以较小。为此,在UI元素的尺寸大的情况下,UI元素可以以更小幅度缩小,而在UI元素的尺寸小的情况下,UI元素可以以更大缩放幅度缩 小,以在深度方向上呈现更小程度的远离。However, embodiments of the present disclosure are not limited thereto. How UI elements scale at different sizes is electronically device or user configurable. For example, in order to make the size of the scaled UI elements more balanced, larger UI elements may be more affected by presses, while smaller UI elements may be less affected by presses. To this end, in the case of a large size of the UI element, the UI element can be scaled down by a smaller amount, and in the case of a small size of the UI element, the UI element can be scaled down by a larger scale to render more depthwise A small distance away.
此外,在某些实施例中,为了改善用户体验,可以对UI元素能够缩放的幅度进行限制,使得UI元素只能在被允许的幅度范围内进行缩放。例如,幅度范围可以是任何适当范围,诸如UI元素的尺寸的10%-90%、100像素-10,000像素、或者屏幕占比的2%-50%等。作为示例,假设幅度范围为UI元素的尺寸的10%-90%。在这种情况下,无论按压力多大、按压的持续时间多长,被按压的UI元素至多只能缩小到原尺寸的10%,而不可能从屏幕上消失。In addition, in some embodiments, in order to improve the user experience, the range that the UI element can be zoomed may be limited, so that the UI element can only be zoomed within the allowed range. For example, the magnitude range may be any suitable range, such as 10%-90% of the size of the UI element, 100 pixels-10,000 pixels, or 2%-50% of the screen-to-body ratio, or the like. As an example, assume the magnitude range is 10%-90% of the size of the UI element. In this case, no matter how hard the pressing force is or how long the pressing duration is, the pressed UI element can only be reduced to at most 10% of its original size, and it is impossible to disappear from the screen.
在上文中,详细描述了被按压的UI元素的缩放。如上所述,在深度联动中,被按压的目标UI元素可以影响没有被按压的其他UI元素。具体地,在深度联动中,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果,使得其他UI元素都受到目标UI元素的影响。例如,在深度联动中,在一持续时间期间按压目标UI元素时,除了该目标UI元素随时间缩放之外,其他UI元素也可以以相应幅度缩放,从而在视觉上呈现联动地缩放。因此,在下文中,将参考图25至图33详细描述深度联动。In the above, scaling of the pressed UI element is described in detail. As mentioned above, in deep linkage, the pressed target UI element can affect other UI elements that are not pressed. Specifically, in deep linkage, triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element . For example, in deep linkage, when a target UI element is pressed during a duration, in addition to the scale of the target UI element over time, other UI elements can also be scaled by a corresponding magnitude, thereby visually showing a linked scaling. Therefore, hereinafter, the depth linkage will be described in detail with reference to FIGS. 25 to 33 .
图25示出了根据本公开的实施例的图形界面显示方法2500的流程图。应当理解,方法2500可以由以上参考图1所描述的电子设备100或者参考图2所描述的电子设备200来执行。在此参考图3A的UI 300A描述方法2500。然而,应当理解,UI 300A仅是示例,方法2500可以适用于任何适当界面,包括但不限于UI 300B-300C。FIG. 25 shows a flowchart of a graphical interface display method 2500 according to an embodiment of the present disclosure. It should be understood that the method 2500 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 2500 is described herein with reference to UI 300A of Figure 3A. However, it should be understood that UI 300A is merely an example, and method 2500 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
在框2510,在电子设备的屏幕上显示M个用户界面UI元素。M为大于1的正整数。例如,M个UI元素可以是UI元素1至13。At block 2510, the M user interface UI elements are displayed on the screen of the electronic device. M is a positive integer greater than 1. For example, the M UI elements may be UI elements 1-13.
在框2520,检测M个UI元素中的第一UI元素处、保持一持续时间的按压。例如,第一UI元素可以是UI元素5。如上所述,在第一UI元素处的保持一持续时间的按压将使得第一UI元素随时间缩放,以在深度方向上呈现按压效果。At block 2520, a press is detected for a duration at a first UI element of the M UI elements. For example, the first UI element may be UI element 5 . As described above, a press at the first UI element for a duration will cause the first UI element to scale over time to present the effect of the press in the depth direction.
在框2530,响应于检测到第一UI元素处的、保持一持续时间的按压,使屏幕上的N个UI元素中的每个UI元素缩放。N为1与M-1之间的正整数。由此,从视觉上指示联动地按压。At block 2530, in response to detecting a press at the first UI element for a duration, each of the N UI elements on the screen is scaled. N is a positive integer between 1 and M-1. Thereby, interlocking pressing is visually indicated.
图26示出了根据本公开的实施例的N个UI元素的深度联动2600的示例的示意图。如图26所示,UI元素5在一持续时间期间被按压,使得UI元素5随时间缩放,以在深度方向上呈现按压效果。此外,屏幕上的其他UI元素(例如,UI元素1至4、和6至13)也响应于按压随时间以不同幅度缩放,以在深度方向上呈现按压效果。由此,在视觉上呈现联动地按压。为了清楚,图26仅示出了UI 300A中的UI元素1-13的深度联动。应当理解,深度联动可以发生在任何UI中的任何至少两个UI元素处,例如,UI 300A-300C中的任何至少两个UI元素处。FIG. 26 shows a schematic diagram of an example of a depth linkage 2600 of N UI elements according to an embodiment of the present disclosure. As shown in Figure 26, UI element 5 is pressed during a duration, so that UI element 5 is scaled over time to present a pressing effect in the depth direction. In addition, other UI elements on the screen (eg, UI elements 1 to 4, and 6 to 13) are also scaled by different magnitudes over time in response to the pressing to present the pressing effect in the depth direction. Thereby, interlocking pressing is visually presented. For clarity, FIG. 26 only shows the depth linkage of UI elements 1-13 in UI 300A. It should be understood that deep linkage can occur at any at least two UI elements in any UI, for example, at any at least two UI elements in UIs 300A-300C.
在某些实施例中,深度联动可以作用于屏幕上的所有UI元素。在这种情况下,可以将M个UI元素中除第一UI元素以外的M-1个UI元素确定为N个UI元素。备选地,深度联动可以仅作用于屏幕上的部分UI元素。在这种情况下,可以基于第一UI元素的尺寸来确定第一UI元素的影响区域,以及将M个UI元素中在影响区域内的UI元素确定为N个UI元素。例如,第一UI元素的尺寸越大,其影响区域可以越大。备选地,影响区域也可以随着尺寸缩小,本公开在此不受限制。例如,影响区域可以是以第一UI元素的基准点为中心、具有预定半径的圆。应当理解,影响区域可以是具有任何形状的任何适当区域,例如具有预定尺寸的 矩形、菱形等。影响区域可以是由电子设备和用户可配置的,本公开在此不受限制。In some embodiments, deep linkage can work on all UI elements on the screen. In this case, M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements. Alternatively, deep linkage can only act on some UI elements on the screen. In this case, the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein. For example, the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
此外,在某些实施例中,与影响区域相交的UI元素可以被认为在影响区域内。备选地,在影响区域为具有预定半径的圆的情况下,如果UI元素与第一UI元素的距离小于影响区域的预定半径,该UI元素可以被认为在影响区域内。Additionally, in some embodiments, UI elements that intersect the area of influence may be considered to be within the area of influence. Alternatively, where the area of influence is a circle with a predetermined radius, the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
图27示出了根据本公开的实施例的UI元素的影响区域2700的示例的示意图。如图27所示,由于UI元素3、4、7、8在UI元素5的影响区域2710内,因此UI元素3、4、7、8将随着UI元素5联动缩放。此外,由于UI元素1、2、6、9-13不在UI元素5的影响区域2710内,因此UI元素1、6、9-13不会随着UI元素5联动缩放。27 shows a schematic diagram of an example of a UI element's area of influence 2700 according to an embodiment of the present disclosure. As shown in FIG. 27 , since UI elements 3, 4, 7, and 8 are within the influence area 2710 of UI element 5, UI elements 3, 4, 7, and 8 will be scaled in conjunction with UI element 5. In addition, since UI elements 1, 2, 6, 9-13 are not within the influence area 2710 of UI element 5, UI elements 1, 6, 9-13 will not be scaled in conjunction with UI element 5.
返回参考图25,为了使N个UI元素以相应幅度缩放,可以确定第一UI元素与N个UI元素中的每个UI元素之间的距离。如上所述,在某些实施例中,可以根据距离所处于的范围,将距离划分为多个距离等级。例如被操作的UI元素本身可以处于距离等级0、联动的UI元素中的可以根据其与被操作的UI元素的相应距离而处于距离等级1、2、3……处于相同距离等级的UI元素可以被视为距离相同。由此,通过使用距离等级,可以简化UI元素的联动,使得处于相同距离等级的UI元素以相同方式联动,从而提高联动的统一性和协调性。然而,应当理解,在联动中,也可以使用距离本身,从而使得UI元素更精确地联动。在下文中,距离等级可互换地被称为距离。Referring back to FIG. 25 , in order to scale the N UI elements by corresponding magnitudes, the distance between the first UI element and each of the N UI elements may be determined. As mentioned above, in some embodiments, distances may be divided into a plurality of distance levels according to the range in which the distances lie. For example, the operated UI element itself may be at distance level 0, and the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element... UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage. However, it should be understood that in linkage, the distance itself may also be used, thereby allowing UI elements to be more precisely linked. In the following, distance classes are referred to interchangeably as distances.
在上文中,已经参考图10-14B描述了第一UI元素与N个UI元素中的第二UI元素之间的距离的确定方式,因此在此省略其描述。In the above, the manner of determining the distance between the first UI element and the second UI element among the N UI elements has been described with reference to FIGS. 10-14B , and thus the description thereof is omitted here.
返回参考图25,在确定了第一UI元素与第二UI元素之间的距离之后,可以基于距离,来确定缩放第二UI元素的幅度。例如,如果第一UI元素与第二UI元素之间的距离越大,则缩放第二UI元素的幅度可以越小,从而在视觉上指示按压对远处的UI元素的影响变小。备选地,如果第一UI元素与第二UI元素之间的距离越大,则缩放第二UI元素的幅度也可以越大,从而在视觉上指示按压对远处的UI元素的影响变大。Referring back to FIG. 25 , after the distance between the first UI element and the second UI element is determined, the magnitude of scaling the second UI element may be determined based on the distance. For example, if the distance between the first UI element and the second UI element is greater, the second UI element may be scaled less, thereby visually indicating that the press has less impact on the distant UI element. Alternatively, if the distance between the first UI element and the second UI element is larger, the magnitude of the zooming of the second UI element may also be larger, thereby visually indicating that the impact of the press on the distant UI element becomes larger .
在某些实施例中,为了确定缩放第二UI元素的幅度,可以确定第一UI元素响应于按压而缩放的第一幅度。在某些实施例中,第一UI元素的缩放的第一幅度可以基于与第一UI元素相关联的各种因素来确定。这些因素可以包括但不限于第一UI元素的尺寸、第一UI元素能够发生变化的幅度范围、按压的持续时间和预定按压力。在上文中,详细描述了这些因素分别对UI元素的缩放幅度的影响,因此在此省略其描述。In some embodiments, to determine the magnitude by which the second UI element is scaled, a first magnitude by which the first UI element is scaled in response to the press may be determined. In some embodiments, the first magnitude of scaling of the first UI element may be determined based on various factors associated with the first UI element. These factors may include, but are not limited to, the size of the first UI element, the range of magnitudes within which the first UI element can vary, the duration of the pressing, and the predetermined pressing force. In the above, the effects of these factors on the zooming amplitude of the UI elements are described in detail, so the descriptions thereof are omitted here.
然后,可以基于第一幅度和第一UI元素与第二UI元素之间的距离,来确定第二UI元素响应于按压而缩放的幅度。如何将缩放第一UI元素的幅度传导到第二UI元素,从而得到缩放第二UI元素的幅度可以利用上文中详细描述的传导方式实现。区别在于,在深度联动中,传导等式(7)和(8)中的x n表示联动缩放的UI元素(例如,第二UI元素)的缩放幅度,而x表示被按压的UI元素(例如,第一UI元素)的缩放幅度。因此,在此省略其描述。 The magnitude by which the second UI element scales in response to the press can then be determined based on the first magnitude and the distance between the first UI element and the second UI element. How to transmit the magnitude of scaling the first UI element to the second UI element, so as to obtain the magnitude of scaling the second UI element, can be implemented using the conducting manner described in detail above. The difference is that in deep linkage, x n in conduction equations (7) and (8) represents the zoom magnitude of the linked-zoomed UI element (eg, the second UI element), while x represents the pressed UI element (eg. , the zoom range of the first UI element). Therefore, its description is omitted here.
由此,由于第二UI元素的缩放的幅度由第一UI元素的缩放的幅度以及第二UI元素与第一UI元素之间的距离来确定,因此可以实现直观、自然且符合用户的使用习惯的深度联动。In this way, since the zooming amplitude of the second UI element is determined by the zooming amplitude of the first UI element and the distance between the second UI element and the first UI element, it can be intuitive, natural, and conform to the user's usage habits. deep linkage.
此外,在某些实施例中,第二UI元素的尺寸也可以影响缩放第二UI元素的幅度。在这种情况下,第二UI元素的尺寸也可以被考虑以确定缩放第二UI元素的幅度。例如,如果第 二UI元素越大,则缩放第二UI元素的幅度可以越大,使得屏幕上缩放后的UI元素的尺寸更为相近,从而在视觉上更为协调。备选地,如果第二UI元素越大,则缩放第二UI元素的幅度可以越小,使得屏幕上缩放后的UI元素的尺寸差异更大。为此,在某些实施例中,可以基于第一幅度、距离以及第二UI元素的尺寸,来确定第二UI元素响应于按压而缩放的幅度。Furthermore, in some embodiments, the size of the second UI element may also affect the magnitude of the scaling of the second UI element. In this case, the size of the second UI element may also be considered to determine the magnitude by which to scale the second UI element. For example, if the second UI element is larger, the range of scaling the second UI element may be larger, so that the sizes of the scaled UI elements on the screen are more similar and thus more visually coordinated. Alternatively, if the second UI element is larger, the magnitude of scaling the second UI element may be smaller, so that the size difference of the scaled UI element on the screen is larger. To this end, in some embodiments, the magnitude by which the second UI element scales in response to the press may be determined based on the first magnitude, the distance, and the size of the second UI element.
另外,在某些实施例中,第一UI元素的尺寸也可以影响缩放第二UI元素的幅度。在这种情况下,第一UI元素的尺寸也可以被考虑以确定缩放第二UI元素的幅度。例如,第一UI元素的尺寸越大,其可能产生的联动影响越大,因此缩放第二UI元素的动画效果可以与第一UI元素的尺寸成正比。为此,在某些实施例中,可以基于第一幅度、距离以及第一UI元素的尺寸,来确定缩放第二UI元素的幅度。Additionally, in some embodiments, the size of the first UI element may also affect the magnitude of the scaling of the second UI element. In this case, the size of the first UI element may also be considered to determine the magnitude by which the second UI element is scaled. For example, the larger the size of the first UI element, the greater the possible linkage effect, so the animation effect of scaling the second UI element can be proportional to the size of the first UI element. To this end, in some embodiments, the magnitude by which the second UI element is scaled may be determined based on the first magnitude, the distance, and the size of the first UI element.
进一步地,如上所述,第一UI元素的尺寸和第二UI元素的尺寸都可能影响缩放第二UI元素的幅度。因此,在某些实施例中,可以基于第一幅度、距离、第一UI元素的尺寸和第二UI元素的尺寸,来确定缩放第二UI元素的幅度。Further, as described above, both the size of the first UI element and the size of the second UI element may affect the magnitude of the scaling of the second UI element. Thus, in some embodiments, the magnitude of scaling the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
返回参考图25,在确定了缩放第二UI元素的幅度之后,可以使第二UI元素以该幅度缩放,以从视觉上指示第二UI元素随着第一UI元素被按压而缩放。对于N个UI元素,都可以使其以各自的幅度缩放,以在整个屏幕上或者屏幕的部分区域上从视觉上指示按压,从而呈现按压联动。Referring back to FIG. 25 , after determining the magnitude by which the second UI element is scaled, the second UI element can be scaled by the magnitude to visually indicate that the second UI element scales as the first UI element is pressed. For N UI elements, they can all be scaled with respective amplitudes to visually indicate pressing on the entire screen or a partial area of the screen, thereby presenting a pressing linkage.
图28示出了根据本公开的实施例的基于距离的UI元素的缩放2800的示例的示意图。如图2800所示,距离为0的UI元素(例如,UI元素5本身)的缩放幅度大于距离为1的UI元素(例如,UI元素3、4、7、8),距离为1的UI元素的缩放幅度大于距离为2的UI元素(例如,UI元素2、6、9),并且距离为2的UI元素的缩放幅度大于距离为3的UI元素(例如,UI元素1、10-13)。28 shows a schematic diagram of an example of distance-based scaling of UI elements 2800 in accordance with an embodiment of the present disclosure. As shown in diagram 2800, UI elements with a distance of 0 (eg, UI element 5 itself) are scaled more than UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8), and UI elements with a distance of 1 is zoomed more than UI elements with a distance of 2 (eg, UI elements 2, 6, 9), and UI elements with a distance of 2 are zoomed more than UI elements with a distance of 3 (eg, UI elements 1, 10-13) .
此外,在某些实施例中,为了更好地呈现动画效果的传导,并且改善用户体验,第一UI元素和第二UI元素并非同时开始缩放。例如,第一UI元素可以在按压发生时开始缩放,而第二UI元素可以在按压发生一段时间之后开始缩放。为此,在某些实施例中,可以基于第一UI元素与第二UI元素之间的距离确定一个延迟时间,以及响应于按压发生后经过了延迟时间,使第二UI元素缩放。进一步地,在某些实施例中,可以确定延迟系数,并且基于距离和延迟系数来确定延迟时间。例如,延迟时间可以是距离除以延迟系数的商。延迟系数可以是电子设备和用户可配置的。Furthermore, in some embodiments, in order to better present the conduction of the animation effect and improve the user experience, the first UI element and the second UI element do not start scaling at the same time. For example, a first UI element may start scaling when a press occurs, while a second UI element may start scaling some time after the press occurs. To this end, in some embodiments, a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is scaled in response to the delay time elapsed after the press occurs. Further, in some embodiments, a delay factor may be determined, and the delay time is determined based on the distance and the delay factor. For example, the delay time may be the quotient of the distance divided by the delay factor. The delay factor may be electronically and user configurable.
图29示出了根据本公开的实施例的延迟时间2900的示例的示意图。如图29所示,距离为0的第一UI元素在按压发生时开始缩放,距离为1的UI元素的缩放晚于第一UI元素,距离为2的UI元素的缩放晚于距离为1的UI元素,并且距离为3的UI元素的缩放晚于距离为2的UI元素。FIG. 29 shows a schematic diagram of an example of a delay time 2900 according to an embodiment of the present disclosure. As shown in Figure 29, the first UI element with a distance of 0 starts scaling when the press occurs, the UI element with a distance of 1 is scaled later than the first UI element, and the UI element with a distance of 2 is scaled later than the UI element with a distance of 1 UI elements, and UI elements with a distance of 3 are scaled later than UI elements with a distance of 2.
图30示出了根据本公开的具有延迟时间的UI元素的缩放3000的示例的示意图。如图30所示,距离为0的UI元素5在按压发生的时间T51开始缩放,距离为1的UI元素3、4、7、8在其后的时间T52开始缩放,距离为2的UI元素2、4、6、9在更晚的时间T53开始缩放,并且距离为3的UI元素1、10-13在最晚的T54开始缩放。30 shows a schematic diagram of an example of scaling 3000 of UI elements with a delay time in accordance with the present disclosure. As shown in Figure 30, UI element 5 with a distance of 0 starts scaling at time T51 when the press occurs, UI elements 3, 4, 7, and 8 with a distance of 1 start scaling at a later time T52, and UI elements with a distance of 2 start scaling at time T52. 2, 4, 6, 9 start scaling at a later time T53, and UI elements 1, 10-13 with a distance of 3 start scaling at the latest T54.
此外,在某些实施例中,UI元素的缩放的速度可以由幅度随时间变化的预定义曲线来控制。例如,预定义曲线可以为贝塞尔曲线或弹性力曲线。在弹性力曲线的情况下,可以通过控制弹簧的阻尼系数和刚性系数来控制缩放的速度。在贝塞尔曲线的情况下,可以通过控制 贝塞尔曲线的至少一个控制点中的至少一者的坐标,来控制缩放的速度。Furthermore, in some embodiments, the speed of zooming of UI elements may be controlled by a predefined curve of amplitude versus time. For example, the predefined curve can be a Bezier curve or an elastic force curve. In the case of elastic force curves, the speed of scaling can be controlled by controlling the damping and stiffness coefficients of the spring. In the case of a Bezier curve, the speed of scaling can be controlled by controlling the coordinates of at least one of the at least one control point of the Bezier curve.
进一步地,在某些实施例中,为了改善用户体验,还可以使联动缩放的UI元素向被按压的UI元素移动。具体地,可以使N个UI元素向第一UI元素移动,以进一步在视觉上突出按压。例如,位移的幅度可以取决于联动缩放的UI元素与被按压的UI元素之间的距离、按压的持续时间、第二UI元素的尺寸和第一UI元素的尺寸中的至少一者。为此,在某些实施例中,可以基于第一UI元素与第二UI元素之间的距离、按压的持续时间、第一UI元素的尺寸和/或第二UI元素的尺寸,来确定移动第二UI元素的位移。Further, in some embodiments, in order to improve the user experience, the UI element that is zoomed in linkage can also be moved toward the pressed UI element. Specifically, the N UI elements may be moved toward the first UI element to further visually highlight the press. For example, the magnitude of the displacement may depend on at least one of the distance between the co-zoomed UI element and the pressed UI element, the duration of the pressing, the size of the second UI element, and the size of the first UI element. To this end, in some embodiments, movement may be determined based on the distance between the first UI element and the second UI element, the duration of the press, the size of the first UI element, and/or the size of the second UI element The displacement of the second UI element.
然后,可以使第二UI元素在从第二UI元素指向第一UI元素的方向上移动该位移。例如,可以使第二UI元素在从第二UI元素的第二基准点指向第一UI元素的第一基准点的方向上移动该位移。这在视觉上的效果为第二UI元素被第一UI元素吸引。应当理解,本公开的实施例不限于此。例如,也可以使第二UI元素在相反的方向(例如,从第一UI元素的第一基准点指向第二UI元素的第二基准点的方向)上移动该位移。这在视觉上的效果为第二UI元素被第一UI元素排斥。The second UI element can then be moved by the displacement in a direction from the second UI element to the first UI element. For example, the second UI element may be moved by the displacement in a direction from the second reference point of the second UI element to the first reference point of the first UI element. The visual effect of this is that the second UI element is attracted to the first UI element. It should be understood that embodiments of the present disclosure are not limited thereto. For example, the displacement can also be made to move the second UI element in the opposite direction (eg, from the first reference point of the first UI element to the second reference point of the second UI element). The visual effect of this is that the second UI element is repelled by the first UI element.
图31示出了根据本公开的实施例的UI元素的移动的位移3100的示例的示意图。如图3100所示,距离为1的UI元素(例如,UI元素3、4、7、8)的位移幅度大于距离为2的UI元素(例如,UI元素2、6、9),并且距离为2的UI元素的位移幅度大于距离为3的UI元素(例如,UI元素1、10-13)FIG. 31 shows a schematic diagram of an example of a displacement 3100 of movement of a UI element according to an embodiment of the present disclosure. As shown in graph 3100, UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) have greater displacement magnitudes than UI elements with a distance of 2 (eg, UI elements 2, 6, 9), and the distance is UI elements with a distance of 2 have a greater displacement magnitude than UI elements with a distance of 3 (e.g. UI elements 1, 10-13)
此外,在某些实施例中,在按压结束之后(例如,在用户将手指抬离屏幕之后),经缩放的UI元素可以恢复。具体地,被按压的UI元素以及联动缩放的N个UI元素都可以恢复。为此,在某些实施例中,可以将经缩放的第二UI元素恢复为缩放前的第二UI元素。恢复过程可以是缩放的逆过程,因此在此省略其详细描述。Furthermore, in some embodiments, the scaled UI element may be restored after the press ends (eg, after the user lifts the finger off the screen). Specifically, both the pressed UI element and the N UI elements that are zoomed together can be restored. To this end, in some embodiments, the scaled second UI element may be restored to the pre-scaled second UI element. The restoration process may be an inverse process of scaling, and thus a detailed description thereof is omitted here.
图32A示出了根据本公开的实施例的UI元素的恢复3200A的示例的示意图。如图32A所示,缩放后的UI元素(例如,UI元素1-13)都恢复为缩放前的初始尺寸。32A shows a schematic diagram of an example of a restoration 3200A of UI elements in accordance with an embodiment of the present disclosure. As shown in Figure 32A, the scaled UI elements (eg, UI elements 1-13) are all restored to their original size before scaling.
进一步地,如上所述,在某些实施例中,UI元素还可能响应于按压而移动。在这种情况下,在按压结束之后,移动后的UI元素可以复位。具体地,向被按压的UI元素移动的N个UI元素都可以复位。为此,在某些实施例中,可以将第二UI元素从移动后的位置恢复为移动前的位置。Further, as described above, in some embodiments, UI elements may also move in response to presses. In this case, the moved UI element can be reset after the press ends. Specifically, all N UI elements moved toward the pressed UI element can be reset. To this end, in some embodiments, the second UI element may be restored from the moved position to the pre-move position.
图32B示出了根据本公开的实施例的具有位移的UI元素的恢复3200B的示例的示意图。如图32B所示,移动并且缩放后的UI元素(例如,UI元素1-13)都恢复为移动前的位置和缩放前的初始尺寸。32B shows a schematic diagram of an example of restoration 3200B of UI elements with a displacement, according to an embodiment of the present disclosure. As shown in Figure 32B, the moved and scaled UI elements (eg, UI elements 1-13) all return to their pre-movement positions and their pre-scaled original dimensions.
在某些实施例中,缩放的恢复或移动的恢复可以存在回弹效果。例如,关于缩放的恢复,在用户松手后,UI元素的尺寸可以先增大到大于初始尺寸,再缩小为初始尺寸。此外,关于移动的恢复,在用户松手后,联动移动的UI元素可以先远离被按压的UI元素移动到比移动前的初始位置更远,再回到初始位置。In some embodiments, the restoration of zooming or the restoration of movement may have a bouncing effect. For example, regarding the recovery of zooming, after the user lets go, the size of the UI element can be first increased to be larger than the initial size, and then reduced to the initial size. In addition, regarding the recovery of movement, after the user releases the hand, the UI element that is moved in linkage can first move away from the pressed UI element to a farther than the initial position before the movement, and then return to the initial position.
图33A-33B分别示出了根据本公开的实施例的具有回弹效果的UI元素的恢复的尺寸时间曲线3300A和位移时间曲线3300B的示例的示意图。33A-33B show schematic diagrams, respectively, of an example of a restored size time curve 3300A and a displacement time curve 3300B of a UI element with a springback effect, according to an embodiment of the present disclosure.
关于缩放回弹,如图33A所示,在T61,UI元素5被按压而缩小。此外,其他UI元素(例如,UI元素1-4、6-13)也联动缩小。With regard to the zoom rebound, as shown in FIG. 33A, at T61, UI element 5 is pressed to zoom out. In addition, other UI elements (eg, UI elements 1-4, 6-13) are also reduced in linkage.
在T62,用户松手。此时,UI元素5缩小为初始尺寸的0.5倍。此外,距离为1的UI 元素(例如,UI元素3、4、7、8)联动缩小,但是缩小幅度小于UI元素5。另外,距离为2的UI元素(例如,UI元素2、6、9)也联动缩小,但是缩小幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)也联动缩小,但是缩小幅度小于距离为2的UI元素。At T62, the user lets go. At this point, UI element 5 is reduced to 0.5 times its original size. In addition, UI elements with a distance of 1 (eg, UI elements 3, 4, 7, and 8) are reduced in linkage, but the reduction rate is smaller than that of UI element 5. In addition, UI elements with a distance of 2 (for example, UI elements 2, 6, and 9) are also reduced in linkage, but the reduction rate is smaller than that of UI elements with a distance of 1. Further, UI elements with a distance of 3 (for example, UI elements 1, 10-13) are also reduced in linkage, but the reduction rate is smaller than that of UI elements with a distance of 2.
在T62和T63期间,UI元素开始缩放回弹。During T62 and T63, UI elements start scaling and bouncing back.
在T63,UI元素5的尺寸增大到初始尺寸的1.2倍。此外,距离为1的UI元素(例如,UI元素3、4、7、8)联动增大,但是增大幅度小于UI元素5。另外,距离为2的UI元素(例如,UI元素2、6、9)也联动增大,但是增大幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)也联动增大,但是增大幅度小于距离为2的UI元素。At T63, the size of UI element 5 is increased to 1.2 times the original size. In addition, UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) increase in linkage, but the increase is smaller than that of UI element 5. In addition, UI elements with a distance of 2 (for example, UI elements 2, 6, and 9) also increase in linkage, but the increase is smaller than that of UI elements with a distance of 1. Further, UI elements with a distance of 3 (for example, UI elements 1, 10-13) also increase in synergy, but the increase is smaller than that of UI elements with a distance of 2.
在T64,全部UI元素的尺寸恢复为初始尺寸。At T64, the size of all UI elements reverts to the original size.
此外,关于移动回弹,如图33B所示,在T71,UI元素5被按压。其他UI元素朝向UI元素5移动。Further, regarding the movement rebound, as shown in FIG. 33B , at T71, UI element 5 is pressed. Other UI elements move towards UI element 5.
在T72,用户松手。此时,距离为1的UI元素(例如,UI元素3、4、7、8)朝向UI元素5移动的位移为-1。另外,距离为2的UI元素(例如,UI元素2、6、9)也朝向UI元素5移动,但是位移幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)也朝向UI元素5移动,但是位移幅度小于距离为2的UI元素。At T72, the user lets go. At this time, the displacement of UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) moving toward UI element 5 is -1. In addition, UI elements with a distance of 2 (eg, UI elements 2, 6, 9) also move towards UI element 5, but the displacement magnitude is smaller than that of the UI elements with a distance of 1. Further, UI elements with a distance of 3 (eg, UI elements 1, 10-13) also move towards UI element 5, but the displacement magnitude is smaller than that of the UI elements with a distance of 2.
在T72和T73期间,UI元素开始移动回弹。During T72 and T73, UI elements start to move and bounce back.
在T73,距离为1的UI元素(例如,UI元素3、4、7、8)的位移超过初始位置,并且为+0.7。另外,距离为2的UI元素(例如,UI元素2、6、9)的位移也超过初始位置,但是位移幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)的位移也超过初始位置,但是位移幅度小于距离为2的UI元素。At T73, the displacement of UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) exceeds the initial position and is +0.7. In addition, UI elements with a distance of 2 (eg, UI elements 2, 6, 9) are also displaced beyond the initial position, but the displacement magnitude is smaller than that of the UI elements with a distance of 1. Further, the displacement of UI elements with a distance of 3 (eg, UI elements 1, 10-13) also exceeds the initial position, but the displacement magnitude is smaller than that of the UI elements with a distance of 2.
在T74,全部UI元素的位置恢复为初始位置。At T74, the positions of all UI elements are restored to their original positions.
应当理解,图33A-33B中的缩放尺寸(例如,0.5倍、1.2倍)和移动位移(例如,位移-1、位移0.7)仅是示例,UI元素可以以任何适当尺寸较小缩放或以任何适当位移移动。此外,虽然在图33A-33B中将回弹效果示出为仅回弹一次,但是可以实现具有多次回弹的回弹效果。回弹次数可以是任何适当的回弹次数,本公开在此不受限制。在某些实施例中,多次回弹的回弹幅度可以随时间减小。It should be understood that the scaling dimensions (eg, 0.5x, 1.2x) and movement displacements (eg, displacement-1, displacement 0.7) in Figures 33A-33B are only examples, and UI elements may be scaled smaller at any suitable size or at any Appropriate displacement moves. Furthermore, although the rebound effect is shown as only one rebound in Figures 33A-33B, a rebound effect with multiple rebounds can be achieved. The number of rebounds may be any suitable number of rebounds, and the present disclosure is not limited herein. In certain embodiments, the rebound magnitude of the multiple rebounds may decrease over time.
图33C-33D分别示出了根据本公开的实施例的具有回弹幅度减小的多次回弹的回弹效果的UI元素的恢复的尺寸时间曲线3300C和位移时间曲线3300D的示例的示意图。33C-33D show schematic diagrams, respectively, of an example of a restored size-time curve 3300C and a displacement-time curve 3300D for a UI element with a rebound effect of multiple rebounds with reduced rebound amplitudes, according to embodiments of the present disclosure.
如图33C所示,UI元素经多次回弹后恢复为初始尺寸,其中距离为0的UI元素(例如,UI元素5)的回弹的缩放幅度大于距离为1的UI元素(例如,UI元素3、4、7、8)。距离为1的UI元素的回弹的缩放幅度大于距离为2的UI元素(例如,UI元素2、6、9)。距离为2的UI元素的回弹的缩放幅度大于距离为3的UI元素(例如,UI元素1、10-13)。As shown in FIG. 33C , the UI element is restored to its original size after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) bounces back at a larger scale than the UI element with a distance of 1 (eg, UI element 5 ) 3, 4, 7, 8). A UI element with a distance of 1 will have a larger rebound scale than a UI element with a distance of 2 (eg, UI elements 2, 6, 9). A UI element with a distance of 2 will have a larger rebound scaling than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
类似地,如图33D所示,UI元素经多次回弹后恢复为初始位置,其中距离为0的UI元素(例如,UI元素5)的回弹的位移幅度大于距离为1的UI元素(例如,UI元素3、4、7、8)。距离为1的UI元素的回弹的位移幅度大于距离为2的UI元素(例如,UI元素2、6、9)。距离为2的UI元素的回弹的位移幅度大于距离为3的UI元素(例如,UI元素1、10-13)。Similarly, as shown in FIG. 33D , the UI element recovers to the initial position after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) rebounds with a greater displacement magnitude than the UI element with a distance of 1 (eg, UI element 5 ) , UI elements 3, 4, 7, 8). A UI element with a distance of 1 rebounds with a larger displacement magnitude than a UI element with a distance of 2 (eg, UI elements 2, 6, 9). A UI element with a distance of 2 rebounds with a larger displacement magnitude than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
进一步地,在某些实施例中,回弹效果也可以受预定义曲线(例如,弹性力曲线、贝塞尔曲线等)控制。例如,这些UI元素可以以预定义曲线控制的动画效果缩放回弹或移动回弹。Further, in some embodiments, the springback effect may also be controlled by predefined curves (eg, elastic force curves, Bezier curves, etc.). For example, these UI elements can scale bounce or move bounce in an animated effect controlled by a predefined curve.
压力联动pressure linkage
本公开的实施例涉及UI中的UI元素在按压的动画效果上的联动,也被称为压力联动。在压力联动中,被按压的目标UI元素可以影响没有被按压的其他UI元素。具体地,在压力联动中,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果,使得其他UI元素都受到目标UI元素的影响。例如,在压力联动中,在按压目标UI元素时,除了该目标UI元素以一动画效果呈现按压效果之外,其他UI元素也可以以相应动画效果呈现按压效果,从而在视觉上呈现联动地按压。The embodiments of the present disclosure relate to the linkage of UI elements in the UI on the animation effect of pressing, which is also referred to as pressure linkage. In pressure linkage, the pressed target UI element can affect other UI elements that are not pressed. Specifically, in the pressure linkage, triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element . For example, in the pressure linkage, when the target UI element is pressed, in addition to the target UI element showing the pressing effect with an animation effect, other UI elements can also show the pressing effect with the corresponding animation effect, so as to visually present the linkage pressing .
由此,可以加强不同UI元素的动画效果之间的联系,并且突出各个独立UI元素之间的关系。相比于动画效果单一、每个UI元素都是独立的且无联系的传统动画,本公开的实施例能够使得动画效果更符合物理规律,并且考虑到了真实使用场景和用户使用习惯,从而可以显著提高用户体验。Thereby, the connection between the animation effects of different UI elements can be strengthened, and the relationship between the individual UI elements can be highlighted. Compared with the traditional animation in which the animation effect is single and each UI element is independent and unrelated, the embodiments of the present disclosure can make the animation effect more in line with the laws of physics, and take into account the real usage scenarios and user usage habits, so that it can significantly improve the performance of the animation. Improve user experience.
以下将参考附图34至图46描述压力联动的一些示例实施例。Some example embodiments of pressure linkage will be described below with reference to FIGS. 34-46 .
压力联动可以发生在具有任何适当的规则或不规则的布局的UI中,并且该UI中的UI元素可以具有任何适当的尺寸和形状。例如,压力联动可以发生在如图3A-3C所示的UI300A-300C中。Pressure linkage can occur in a UI with any suitable regular or irregular layout, and UI elements in the UI can have any suitable size and shape. For example, pressure linkage can occur in UIs 300A-300C as shown in Figures 3A-3C.
UI中的UI元素可以被按压。例如,在用户期望执行与UI元素相关联的操作时,用户可以按压UI元素。作为示例,在用户期望进入UI元素所表示的应用程序、打开与UI元素相关联的菜单等时,用户可以按压UI元素。在检测到UI元素处的按压的情况下,UI元素可以以一动画效果发生变化,例如UI元素可以视觉上相对于按压的位置以翘板方式移动位置(在下文中可替换地称为旋转),或视觉上相对于按压的位置凹陷或突出,以呈现按压动作。在这种情况下,UI元素的变化可以符合点压力模型。在点压力模型中,UI元素在按压的位置处的压力大于其他部分的压力。UI elements in the UI can be pressed. For example, a user may press a UI element when the user desires to perform an operation associated with the UI element. As an example, a user may press a UI element when the user desires to enter an application represented by the UI element, open a menu associated with the UI element, and the like. In the event that a press at the UI element is detected, the UI element may change with an animation effect, for example, the UI element may be visually moved in a rocker fashion relative to the position of the press (alternatively referred to hereinafter as a rotation), Or visually concave or protrude relative to the pressed position to present a pressing action. In this case, changes in UI elements can conform to the point pressure model. In the point pressure model, the pressure of the UI element at the pressed position is greater than the pressure of other parts.
在某些实施例中,UI元素可以被视为刚体。在这种情况下,在检测到UI元素处的按压的情况下,UI元素可以在视觉上相对于按压的位置以翘板方式移动位置,以呈现按压效果。In some embodiments, UI elements can be treated as rigid bodies. In this case, upon detection of a press at the UI element, the UI element can be visually moved in a rocker fashion relative to the position of the press to present the press effect.
图34示出了根据本公开的一些实施例的作为刚体的UI元素在被按压时的变化3400的示例的示意图。如图34所示,在检测到UI元素处的按压的情况下,UI元素可以从初始形状3410以一动画效果发生变化,以在视觉上相对于按压的位置以翘板方式移动位置。例如,当按压的位置位于UI元素的左侧时,UI元素在视觉上围绕其基准点(以“+”所示)向左侧旋转,从而变化为形状3420。变化后的形状3420类似于左侧被压下,而右侧被翘起的翘板。此外,当按压的位置位于UI元素的右侧时,UI元素在视觉上围绕其基准点向右侧旋转,从而变化为形状3430。变化后的形状3430类似于左侧被翘起,而右侧被压下的翘板。34 shows a schematic diagram of an example of a UI element that is a rigid body changing 3400 when pressed, according to some embodiments of the present disclosure. As shown in Figure 34, upon detection of a press at the UI element, the UI element can be animated from the initial shape 3410 to visually move the position in a rocker fashion relative to the position of the press. For example, when the pressed position is to the left of the UI element, the UI element is visually rotated to the left about its reference point (indicated by a "+"), changing to shape 3420. The altered shape 3420 resembles a rocker with the left side depressed and the right side up. Furthermore, when the pressed position is on the right side of the UI element, the UI element is visually rotated to the right around its reference point, changing to shape 3430 . The altered shape 3430 resembles a rocker with the left side lifted and the right side depressed.
在这种情况下,UI元素可以被视为两侧连接到弹簧的翘板,UI元素的按压可以被视为在一侧按压弹簧,而在另一侧拉伸弹簧,从而在整体上实现UI元素围绕其基准点旋转的动画效果。In this case, the UI element can be seen as a rocker connected to a spring on both sides, and the pressing of the UI element can be seen as pressing the spring on one side and stretching the spring on the other, thus implementing the UI as a whole Animate the element's rotation around its base point.
图35示出了根据本公开的一些实施例的模拟UI元素的按压的弹簧的按压和拉伸3500的示例的示意图。图3510示出了处于初始状态的两侧弹簧。图3520示出了在按压的位置位于UI元素的左侧时,左侧的弹簧被按压,而右侧的弹簧被拉伸。图3530示出了在按压的位 置位于UI元素的右侧时,右侧的弹簧被按压,而左侧的弹簧被拉伸。35 shows a schematic diagram of an example of a pressing and stretching of a spring 3500 that simulates pressing of a UI element, according to some embodiments of the present disclosure. Figure 3510 shows the two-sided spring in its initial state. Graph 3520 shows that when the pressed position is on the left side of the UI element, the left spring is pressed and the right spring is stretched. Diagram 3530 shows that when the pressed position is on the right side of the UI element, the right spring is pressed and the left spring is stretched.
在这种情况下,弹簧的模型可以由如下等式(9)来表示:In this case, the model of the spring can be represented by the following equation (9):
Figure PCTCN2022087751-appb-000005
Figure PCTCN2022087751-appb-000005
其中L表示按压的位置与UI元素的基准点之间的水平距离,c表示按压的位置与基准点之间的直线距离,并且k’表示弹簧的弹性系数。where L represents the horizontal distance between the pressed position and the reference point of the UI element, c represents the linear distance between the pressed position and the reference point, and k' represents the spring coefficient of the spring.
进一步地,上述等式(9)可以变换为如下等式(10)的形式:Further, the above equation (9) can be transformed into the form of the following equation (10):
Figure PCTCN2022087751-appb-000006
Figure PCTCN2022087751-appb-000006
其中k’表示弹簧的弹性系数,x’表示弹簧的形变量,g’表示弹簧的阻尼系数,T表示发生形变的时间,m’表示UI元素的尺寸。Where k' represents the elastic coefficient of the spring, x' represents the deformation amount of the spring, g' represents the damping coefficient of the spring, T represents the time of deformation, and m' represents the size of the UI element.
此外,在某些实施例中,UI元素可以被视为非刚体。在这种情况下,在检测到UI元素处的按压的情况下,UI元素可以在视觉上相对于按压的位置凹陷或突出,以呈现按压效果。Furthermore, in some embodiments, UI elements may be considered non-rigid bodies. In this case, upon detection of a press at the UI element, the UI element may be visually recessed or protruded relative to the location of the press to present the press effect.
图36示出了根据本公开的一些实施例的作为非刚体的UI元素在被按压时的变化3600的示例的示意图。如图36所示,UI元素可以被视为网格图。在检测到UI元素处的按压的情况下,初始UI元素3610可以以一动画效果发生变化,以在视觉上相对于按压的位置的凹陷或突出。例如,初始UI元素3610内的网格的坐标可以发生变化,从而变化为相对于按压的位置凹陷的UI元素3620。此外,在某些实施例中,还可以UI元素的颜色(例如,色调、明度、饱和度等)也可以发生变化,以突出按压。例如,初始UI元素3610还可以变化为相对于按压的位置凹陷并且颜色加深的UI元素3630。应当理解,颜色变化也可以适用于作为刚体的UI元素。36 shows a schematic diagram of an example of a UI element that is a non-rigid body changing 3600 when pressed, according to some embodiments of the present disclosure. As shown in Figure 36, UI elements can be viewed as grid diagrams. In the event that a press at the UI element is detected, the initial UI element 3610 may change with an animation effect to visually recess or protrude relative to the location of the press. For example, the coordinates of the grid within the initial UI element 3610 can be changed to change to UI element 3620 recessed relative to the location of the press. Additionally, in some embodiments, the color (eg, hue, lightness, saturation, etc.) of the UI elements may also vary to accentuate the press. For example, the initial UI element 3610 may also change to a UI element 3630 that is recessed and darkened relative to the location of the press. It should be understood that color changes may also apply to UI elements that are rigid bodies.
在某些实施例中,在UI元素发生变化之后,按压的位置可能不再处于变化后的UI元素的范围内。在这种情况下,由于按压的位置仍然处于变化前的UI元素的范围内,或者任何其他适当范围内,按压可以继续被检测为针对UI元素的按压。备选地,由于按压的位置不再处于变化后的UI元素的范围内,按压将不被检测为针对UI元素的按压。在这种情况下,可以认为按压结束。In some embodiments, after the UI element is changed, the pressed position may no longer be within the range of the changed UI element. In this case, since the location of the press is still within the range of the UI element before the change, or any other suitable range, the press can continue to be detected as a press on the UI element. Alternatively, since the location of the press is no longer within the range of the changed UI element, the press will not be detected as a press on the UI element. In this case, the compression can be considered to be over.
在下文中,将以UI元素在视觉上相对于按压的位置以翘板方式移动位置为例来描述本公开的实施例。然而,应当理解,UI元素还可以以其他方式变化,例如视觉上相对于按压的位置的凹陷或突出。Hereinafter, an embodiment of the present disclosure will be described by taking an example of the UI element being moved in a rocker manner visually relative to the pressed position. It should be understood, however, that UI elements may also vary in other ways, such as being recessed or protruding visually relative to the location of the press.
此外,在某些实施例中,为了使得UI元素的变化符合自然规律和用户使用习惯,变化的幅度可以取决于按压的力的大小。在真实世界中,力的大小通常是指真实的力的大小。在这种情况下,按压的力越大,在UI元素的变化越大。在某些实施例中,按压的力可以是电子设备检测到的用户施加的按压的力。备选地,按压的力也可以是由电子设备或者用户设置预定按压力。In addition, in some embodiments, in order to make the changes of UI elements conform to natural laws and user usage habits, the magnitude of the changes may depend on the magnitude of the pressing force. In the real world, the magnitude of the force usually refers to the actual magnitude of the force. In this case, the greater the pressing force, the greater the change in the UI element. In some embodiments, the force of the pressing may be the force of the pressing applied by the user detected by the electronic device. Alternatively, the pressing force may also be a predetermined pressing force set by the electronic device or the user.
图37示出了根据本公开的一些实施例的UI元素在不同按压力时的变化3700的示例的示意图。如图37所示,在按压力大的情况下,UI元素可以以更大幅度变化(例如,旋转)。作为对照,在按压力小的情况下,UI元素可以以更小幅度变化。然而,本公开的实施例不限于此。UI元素响应于不同按压力的发生变化方式是电子设备或用户可配置的。例如,在按压力大的情况下,UI元素可以以更小幅度变化,而在按压力小的情况下,UI元素可以以更大幅度变化。37 shows a schematic diagram of an example of a UI element changing 3700 at different pressing forces, according to some embodiments of the present disclosure. As shown in FIG. 37, in the case where the pressing force is large, the UI element can be changed (eg, rotated) by a larger magnitude. In contrast, UI elements can change in smaller magnitudes when the pressing force is small. However, embodiments of the present disclosure are not limited thereto. The manner in which the UI elements change in response to different pressing forces is electronically device or user configurable. For example, UI elements can change in smaller magnitudes when the pressing force is high, and UI elements can change in larger magnitudes when the pressing force is small.
进一步地,在电子设备中,完全基于真实的按压的力进行变化可能对用户要求较高,并且可能需要电子设备配备相关硬件。因此,在某些实施例中,可以用按压的时间来模拟或替换按压的力。例如,如果按压的时间越长,则可以认为按压的力越大,由此变化越大。Further, in an electronic device, making changes based entirely on the actual pressing force may have high requirements on the user, and may require the electronic device to be equipped with relevant hardware. Thus, in some embodiments, the time of the compression may be used to simulate or replace the force of the compression. For example, if the pressing time is longer, it can be considered that the pressing force is larger, and thus the change is larger.
图38示出了根据本公开的一些实施例的UI元素在不同按压持续时间时的变化3800的示例的示意图。如图38所示,在按压的持续时间长的情况下,UI元素可以以更大幅度变化(例如,旋转)。作为对照,在按压的持续时间短的情况下,UI元素可以以更小幅度变化。38 shows a schematic diagram of an example of changes 3800 of UI elements at different press durations in accordance with some embodiments of the present disclosure. As shown in FIG. 38, the UI element may change (eg, rotate) by a larger magnitude with a long duration of the press. In contrast, where the duration of the press is short, UI elements may change in smaller magnitudes.
然而,本公开的实施例不限于此。UI元素响应于不同按压持续时间的发生变化方式是电子设备或用户可配置的。例如,在按压的持续时间长的情况下,UI元素可以以更小幅度变化,而在按压的持续时间短的情况下,UI元素可以以更大幅度变化。However, embodiments of the present disclosure are not limited thereto. The manner in which the UI elements change in response to different press durations is electronically device or user configurable. For example, where the duration of the press is long, the UI elements may change in smaller magnitudes, and where the duration of the press is short, the UI elements may change by a larger magnitude.
此外,在某些实施例中,为了进一步使得UI元素的变化符合自然规律和用户使用习惯,变化的幅度可以取决于UI元素的尺寸。例如,直观上,相同的按压可能难以按下较大的UI元素,而可以较轻松地按下较小的UI元素。在这种情况下,较大的UI元素受按压的影响可以较小,而较小的UI元素受按压的影响可以较大。In addition, in some embodiments, in order to further make the changes of UI elements conform to natural laws and user usage habits, the magnitude of changes may depend on the sizes of UI elements. For example, intuitively, the same press may be difficult to press on a larger UI element, while it may be easier to press on a smaller UI element. In this case, larger UI elements may be less affected by presses, while smaller UI elements may be more affected by presses.
图39示出了根据本公开的一些实施例的UI元素在不同尺寸时的变化3900的示例的示意图。如图39所示,在UI元素的尺寸大的情况下,UI元素可以以更大幅度变化。作为对照,在UI元素的尺寸小的情况下,UI元素可以以更小幅度变化。39 shows a schematic diagram of an example of a UI element changing 3900 at different sizes, according to some embodiments of the present disclosure. As shown in FIG. 39, in the case where the size of the UI element is large, the UI element can be changed by a larger magnitude. In contrast, where the size of the UI element is small, the UI element can vary in smaller magnitudes.
然而,本公开的实施例不限于此。UI元素在不同尺寸时的发生变化方式是电子设备或用户可配置的。例如,在UI元素的尺寸大的情况下,UI元素可以以更小幅度变化,而在UI元素的尺寸小的情况下,UI元素可以以更大幅度变化。However, embodiments of the present disclosure are not limited thereto. The way UI elements change at different sizes is electronically device or user configurable. For example, where the size of the UI element is large, the UI element may vary in smaller magnitudes, and in the case where the size of the UI element is small, the UI element may vary in larger magnitudes.
此外,在某些实施例中,为了改善用户体验,可以对UI元素能够变化的幅度进行限制,使得UI元素只能在被允许的幅度范围内进行变化。例如,幅度范围可以是任何适当范围,诸如UI元素的旋转角度在0-60度之间、UI元素的颜色变化的灰度在10%-50%之间、或者UI元素内的网格的坐标变化在100-10000像素之间等。作为示例,假设幅度范围为UI元素的旋转角度在0-60度之间。在这种情况下,无论预定按压力多大、按压的持续时间多长,被按压的UI元素至多只能围绕基准点旋转60度,而不可能被旋转更大幅度。In addition, in some embodiments, in order to improve the user experience, the range that the UI element can change may be limited, so that the UI element can only change within the range of the allowable range. For example, the magnitude range may be any suitable range, such as a rotation angle of a UI element between 0-60 degrees, a color change of a UI element between 10%-50% grayscale, or the coordinates of a grid within a UI element Variation between 100-10000 pixels etc. As an example, assume the magnitude range is that the UI element's rotation angle is between 0-60 degrees. In this case, no matter how high the predetermined pressing force is and how long the pressing duration is, the pressed UI element can only be rotated at most 60 degrees around the reference point, and it is impossible to rotate by a larger amount.
在上文中,详细描述了被按压的UI元素的变化。如上所述,在压力联动中,被按压的目标UI元素可以影响没有被按压的其他UI元素。具体地,在压力联动中,触发目标UI元素的动画效果可以联合地触发一个或多个其他UI元素、甚至整个UI中的其他UI元素的动画效果,使得其他UI元素都受到目标UI元素的影响。例如,在压力联动中,在一持续时间期间按压目标UI元素时,除了该目标UI元素以一动画效果发生变化之外,其他UI元素也可以以相应动画效果发生变化,从而在视觉上呈现联动地按压。因此,在下文中,将参考图40至图46详细描述压力联动。In the above, the change of the pressed UI element is described in detail. As mentioned above, in the pressure linkage, the pressed target UI element can affect other UI elements that are not pressed. Specifically, in the pressure linkage, triggering the animation effect of the target UI element can jointly trigger the animation effect of one or more other UI elements, or even other UI elements in the entire UI, so that all other UI elements are affected by the target UI element . For example, in pressure linkage, when a target UI element is pressed during a duration, in addition to the target UI element changing with an animation effect, other UI elements can also change with a corresponding animation effect, thereby visually presenting the linkage press down. Therefore, hereinafter, the pressure linkage will be described in detail with reference to FIGS. 40 to 46 .
图40示出了根据本公开的实施例的图形界面显示方法4000的流程图。应当理解,方法4000可以由以上参考图1所描述的电子设备100或者参考图2所描述的电子设备200来执行。在此参考图3A的UI 300A描述方法4000。然而,应当理解,UI 300A仅是示例,方法2500可以适用于任何适当界面,包括但不限于UI 300B-300C。FIG. 40 shows a flowchart of a graphical interface display method 4000 according to an embodiment of the present disclosure. It should be understood that the method 4000 may be performed by the electronic device 100 described above with reference to FIG. 1 or the electronic device 200 described with reference to FIG. 2 . Method 4000 is described herein with reference to UI 300A of Figure 3A. However, it should be understood that UI 300A is merely an example, and method 2500 may be applied to any suitable interface, including but not limited to UIs 300B-300C.
在框4010,在电子设备的屏幕上显示M个用户界面UI元素。M为大于1的正整数。例如,M个UI元素可以是UI元素1至13。At block 4010, the M user interface UI elements are displayed on the screen of the electronic device. M is a positive integer greater than 1. For example, the M UI elements may be UI elements 1-13.
在框4020,检测M个UI元素中的第一UI元素处的按压。例如,第一UI元素可以是 UI元素5。如上所述,在第一UI元素处的按压将使得第一UI元素旋转,以呈现按压效果。At block 4020, a press at a first UI element of the M UI elements is detected. For example, the first UI element may be UI element 5 . As described above, a press at the first UI element will cause the first UI element to rotate to render the press effect.
在框4030,响应于检测到第一UI元素处的按压,使屏幕上的N个UI元素中的每个UI元素以相应动画效果发生变化。N为1与M-1之间的正整数。由此,从视觉上指示联动地按压。At block 4030, in response to detecting the press at the first UI element, cause each of the N UI elements on the screen to change with a corresponding animation effect. N is a positive integer between 1 and M-1. Thereby, interlocking pressing is visually indicated.
在某些实施例中,N个UI元素相对于按压的位置发生变化的方向可以是从N个UI元素中的每个UI元素指向按压的位置的方向。在某些实施例中,该方向可以是从N个UI元素中的每个UI元素的相应基准点指向被按压的UI元素的基准点的方向。在这种情况下,按压的位置是N个元素的变化的变化基准点,也就是说,按压的位置在视觉上被指示为按压的中心。图41示出了根据本公开的实施例的N个UI元素的压力联动4000的示例的示意图。如图41所示,UI元素5被按压,使得UI元素5旋转,以呈现按压效果。此外,屏幕上的其他UI元素(例如,UI元素1至4、和6至13)也响应于按压相对于按压的位置以不同幅度旋转,以呈现按压效果。由此,在视觉上呈现联动地按压。In some embodiments, the direction in which the N UI elements change relative to the pressed position may be a direction from each of the N UI elements to the pressed position. In some embodiments, the direction may be a direction from the corresponding reference point of each of the N UI elements to the reference point of the pressed UI element. In this case, the pressed position is the change reference point for the change of N elements, that is, the pressed position is visually indicated as the center of the pressed. 41 shows a schematic diagram of an example of a pressure linkage 4000 of N UI elements according to an embodiment of the present disclosure. As shown in FIG. 41, UI element 5 is pressed, so that UI element 5 is rotated to present the pressing effect. In addition, other UI elements on the screen (eg, UI elements 1 to 4, and 6 to 13) also rotate at different magnitudes relative to the position of the press in response to the press to present the press effect. Thereby, interlocking pressing is visually presented.
备选地,N个UI元素相对于按压的位置发生变化的方向可以与被按压的UI元素发生变化的方向相同。图42示出了根据本公开的实施例的N个UI元素的压力联动4000的另一示例的示意图。如图42所示,UI元素5被按压,使得UI元素5旋转,以呈现按压效果。此外,屏幕上的其他UI元素(例如,UI元素1至4、和6至13)也响应于按压在与UI元素5相同的方向上以不同幅度旋转,以呈现按压效果。在这种情况下,N个元素的变化的变化基准点为其自己的基准点。由此,在视觉上呈现联动地按压。Alternatively, the direction in which the N UI elements change relative to the pressed position may be the same as the direction in which the pressed UI element changes. 42 shows a schematic diagram of another example of pressure linkage 4000 of N UI elements according to an embodiment of the present disclosure. As shown in FIG. 42, UI element 5 is pressed, so that UI element 5 is rotated to present the pressing effect. In addition, other UI elements on the screen (eg, UI elements 1 to 4, and 6 to 13) also rotate in the same direction as UI element 5 by different magnitudes in response to pressing to present the pressing effect. In this case, the change reference point of the change of N elements is its own reference point. Thereby, interlocking pressing is visually presented.
为了清楚,图41-42仅示出了UI 300A中的UI元素1-13的压力联动。应当理解,压力联动可以发生在任何UI中的任何至少两个UI元素处,例如,UI 300A-300C中的任何至少两个UI元素处。For clarity, Figures 41-42 only show the pressure linkages of UI elements 1-13 in UI 300A. It should be understood that pressure linkage can occur at any at least two UI elements in any UI, eg, at any at least two UI elements in UIs 300A-300C.
在某些实施例中,压力联动可以作用于屏幕上的所有UI元素。在这种情况下,可以将M个UI元素中除第一UI元素以外的M-1个UI元素确定为N个UI元素。备选地,压力联动可以仅作用于屏幕上的部分UI元素。在这种情况下,可以基于第一UI元素的尺寸来确定第一UI元素的影响区域,以及将M个UI元素中在影响区域内的UI元素确定为N个UI元素。例如,第一UI元素的尺寸越大,其影响区域可以越大。备选地,影响区域也可以随着尺寸缩小,本公开在此不受限制。例如,影响区域可以是以第一UI元素的基准点为中心、具有预定半径的圆。应当理解,影响区域可以是具有任何形状的任何适当区域,例如具有预定尺寸的矩形、菱形等。影响区域可以是由电子设备和用户可配置的,本公开在此不受限制。In some embodiments, pressure linkage can act on all UI elements on the screen. In this case, M-1 UI elements other than the first UI element among the M UI elements may be determined as N UI elements. Alternatively, the pressure linkage may only act on some UI elements on the screen. In this case, the influence area of the first UI element may be determined based on the size of the first UI element, and the UI elements within the influence area among the M UI elements may be determined as N UI elements. For example, the larger the size of the first UI element, the larger its area of influence may be. Alternatively, the area of influence may also be reduced in size, and the present disclosure is not limited herein. For example, the area of influence may be a circle with a predetermined radius centered on the reference point of the first UI element. It should be understood that the area of influence may be any suitable area having any shape, such as a rectangle, diamond, etc. having a predetermined size. The area of influence may be configurable by the electronic device and the user, and the present disclosure is not limited herein.
此外,在某些实施例中,与影响区域相交的UI元素可以被认为在影响区域内。备选地,在影响区域为具有预定半径的圆的情况下,如果UI元素与第一UI元素的距离小于影响区域的预定半径,该UI元素可以被认为在影响区域内。Additionally, in some embodiments, UI elements that intersect the area of influence may be considered to be within the area of influence. Alternatively, where the area of influence is a circle with a predetermined radius, the UI element may be considered to be within the area of influence if the distance from the first UI element is less than the predetermined radius of the area of influence.
图43示出了根据本公开的实施例的UI元素的影响区域4300的示例的示意图。如图43所示,由于UI元素3、4、7、8在UI元素5的影响区域4310内,因此UI元素3、4、7、8将随着UI元素5联动变化。此外,由于UI元素1、2、6、9-13不在UI元素5的影响区域4310内,因此UI元素1、6、9-13不会随着UI元素5联动变化。43 shows a schematic diagram of an example of a UI element's area of influence 4300 according to an embodiment of the present disclosure. As shown in FIG. 43 , since UI elements 3, 4, 7, and 8 are within the influence area 4310 of UI element 5, UI elements 3, 4, 7, and 8 will change in conjunction with UI element 5. In addition, since UI elements 1, 2, 6, 9-13 are not within the influence area 4310 of UI element 5, UI elements 1, 6, 9-13 will not change in conjunction with UI element 5.
返回参考图40,为了使N个UI元素以相应动画效果发生变化,可以确定第一UI元素与N个UI元素中的每个UI元素之间的距离。如上所述,在某些实施例中,可以根据距离所处于的范围,将距离划分为多个距离等级。例如被操作的UI元素本身可以处于距离等级0、联 动的UI元素中的可以根据其与被操作的UI元素的相应距离而处于距离等级1、2、3……处于相同距离等级的UI元素可以被视为距离相同。由此,通过使用距离等级,可以简化UI元素的联动,使得处于相同距离等级的UI元素以相同方式联动,从而提高联动的统一性和协调性。然而,应当理解,在联动中,也可以使用距离本身,从而使得UI元素更精确地联动。在下文中,距离等级可互换地被称为距离。Referring back to FIG. 40, in order for the N UI elements to change with corresponding animation effects, the distance between the first UI element and each of the N UI elements may be determined. As described above, in some embodiments, distances may be divided into a plurality of distance levels according to the range in which the distances lie. For example, the operated UI element itself may be at distance level 0, and the linked UI elements may be at distance level 1, 2, 3 according to their corresponding distance from the operated UI element... UI elements at the same distance level may be are considered to be the same distance. Therefore, by using the distance level, the linkage of UI elements can be simplified, so that UI elements at the same distance level are linked in the same way, thereby improving the unity and coordination of the linkage. However, it should be understood that in linkage, the distance itself may also be used, thereby allowing UI elements to be more precisely linked. In the following, distance classes are referred to interchangeably as distances.
在上文中,已经参考图10-14B描述了第一UI元素与N个UI元素中的第二UI元素之间的距离的确定方式,因此在此省略其描述。In the above, the manner of determining the distance between the first UI element and the second UI element among the N UI elements has been described with reference to FIGS. 10-14B , and thus the description thereof is omitted here.
返回参考图40,在确定了第一UI元素与第二UI元素之间的距离之后,可以基于距离,来确定第二UI元素发生变化的动画效果。例如,如果第一UI元素与第二UI元素之间的距离越大,则第二UI元素发生变化的幅度可以越小,从而在视觉上指示按压对远处的UI元素的影响变小。备选地,如果第一UI元素与第二UI元素之间的距离越大,则第二UI元素发生变化的幅度也可以越大,从而在视觉上指示按压对远处的UI元素的影响变大。Referring back to FIG. 40 , after the distance between the first UI element and the second UI element is determined, the animation effect of the change of the second UI element may be determined based on the distance. For example, if the distance between the first UI element and the second UI element is larger, the magnitude of the change in the second UI element may be smaller, thereby visually indicating that the impact of the press on the distant UI element is smaller. Alternatively, if the distance between the first UI element and the second UI element is larger, the magnitude of the change in the second UI element may also be larger, thereby visually indicating that the impact of the press on the distant UI element changes. big.
在某些实施例中,为了确定第二UI元素发生变化的幅度,可以确定第一UI元素响应于按压而发生变化的第一幅度。在某些实施例中,第一UI元素发生变化的第一幅度可以基于与第一UI元素相关联的各种因素来确定。这些因素可以包括但不限于第一UI元素的尺寸、第一UI元素的第一基准点的位置、第一UI元素能够发生变化的幅度范围、按压的位置、按压的持续时间和预定按压力。在上文中,详细描述了这些因素分别对UI元素发生变化的幅度的影响,因此在此省略其描述。In some embodiments, to determine the magnitude of the change in the second UI element, a first magnitude of the change in the first UI element in response to the press may be determined. In some embodiments, the first magnitude of change in the first UI element may be determined based on various factors associated with the first UI element. These factors may include, but are not limited to, the size of the first UI element, the location of the first reference point of the first UI element, the range of magnitudes that the first UI element can vary, the location of the press, the duration of the press, and the predetermined press force. In the above, the influences of these factors on the magnitudes of changes of UI elements are described in detail, so the descriptions thereof are omitted here.
然后,可以基于第一幅度和第一UI元素与第二UI元素之间的距离,来确定第二UI元素响应于按压而发生变化的幅度。如何将第一UI元素发生变化的幅度传导到第二UI元素,从而得到第二UI元素发生变化的幅度可以利用上文中详细描述的传导方式实现。区别在于,在压力联动中,传导等式(7)和(8)中的x n表示联动变化的UI元素(例如,第二UI元素)的变化幅度,而x表示被按压的UI元素(例如,第一UI元素)的变化幅度。因此,在此省略其描述。 The magnitude by which the second UI element changes in response to the press can then be determined based on the first magnitude and the distance between the first UI element and the second UI element. How to transmit the magnitude of the change of the first UI element to the second UI element, so as to obtain the magnitude of the change of the second UI element, can be implemented using the transmission method described in detail above. The difference is that in pressure linkage, x n in conduction equations (7) and (8) represents the magnitude of change of the UI element (e.g., the second UI element) that changes in linkage, while x represents the pressed UI element (e.g., the second UI element) , the first UI element). Therefore, its description is omitted here.
由此,由于第二UI元素发生变化的幅度由第一UI元素发生变化的幅度以及第二UI元素与第一UI元素之间的距离来确定,因此可以实现直观、自然且符合用户的使用习惯的压力联动。Therefore, since the magnitude of the change of the second UI element is determined by the magnitude of the change of the first UI element and the distance between the second UI element and the first UI element, it can be intuitive, natural and conform to the user's usage habits. pressure linkage.
此外,在某些实施例中,第二UI元素的尺寸也可以影响第二UI元素发生变化的动画效果。在这种情况下,第二UI元素的尺寸也可以被考虑以确定第二UI元素发生变化的动画效果。例如,如果第二UI元素越大,则第二UI元素发生变化的幅度可以越大。备选地,如果第二UI元素越大,则第二UI元素发生变化的幅度可以越小。为此,在某些实施例中,可以基于第一幅度、距离以及第二UI元素的尺寸,来确定第二UI元素响应于按压而发生变化的幅度。In addition, in some embodiments, the size of the second UI element may also affect the animation effect of the change of the second UI element. In this case, the size of the second UI element may also be considered to determine the animation effect of the change of the second UI element. For example, if the second UI element is larger, the magnitude of the change in the second UI element may be larger. Alternatively, if the second UI element is larger, the magnitude of the change in the second UI element may be smaller. To this end, in some embodiments, the magnitude of the change in the second UI element in response to the press may be determined based on the first magnitude, the distance, and the size of the second UI element.
另外,在某些实施例中,第一UI元素的尺寸也可以影响第二UI元素发生变化的动画效果。在这种情况下,第一UI元素的尺寸也可以被考虑以确定第二UI元素发生变化的动画效果。例如,第一UI元素的尺寸越大,其可能产生的联动影响越大,因此第二UI元素发生变化的幅度可以与第一UI元素的尺寸成正比。为此,在某些实施例中,可以基于第一幅度、距离以及第一UI元素的尺寸,来确定第二UI元素的幅度。In addition, in some embodiments, the size of the first UI element may also affect the animation effect of the change of the second UI element. In this case, the size of the first UI element may also be considered to determine the animation effect of the change of the second UI element. For example, the larger the size of the first UI element, the greater the possible linkage effect, so the magnitude of the change of the second UI element may be proportional to the size of the first UI element. To this end, in some embodiments, the magnitude of the second UI element may be determined based on the first magnitude, the distance, and the size of the first UI element.
进一步地,如上所述,第一UI元素的尺寸和第二UI元素的尺寸都可能影响第二UI元素发生变化的动画效果。因此,在某些实施例中,可以基于第一幅度、距离、第一UI元素的尺寸和第二UI元素的尺寸,来确定第二UI元素发生变化的幅度。Further, as described above, both the size of the first UI element and the size of the second UI element may affect the animation effect of the change of the second UI element. Therefore, in some embodiments, the magnitude of the change in the second UI element may be determined based on the first magnitude, the distance, the size of the first UI element, and the size of the second UI element.
返回参考图40,在确定了第二UI元素发生变化的动画效果之后,可以使第二UI元素以该动画效果发生变化,以从视觉上指示第二UI元素随着第一UI元素被按压而发生变化。对于N个UI元素,都可以使其以各自的动画效果发生变化,以在整个屏幕上或者屏幕的部分区域上从视觉上指示按压,从而呈现按压联动。Referring back to FIG. 40 , after determining the animation effect of the change of the second UI element, the second UI element may be changed with the animation effect to visually indicate that the second UI element changes as the first UI element is pressed change. For N UI elements, all of them can be changed with their respective animation effects to visually indicate pressing on the entire screen or a partial area of the screen, thereby presenting a pressing linkage.
图44示出了根据本公开的实施例的基于距离的UI元素的变化4400的示例的示意图。如图4400所示,距离为0的UI元素(例如,UI元素5本身)发生变化的幅度大于距离为1的UI元素(例如,UI元素3、4、7、8),距离为1的UI元素发生变化的幅度大于距离为2的UI元素(例如,UI元素2、6、9),并且距离为2的UI元素发生变化的幅度大于距离为3的UI元素(例如,UI元素1、10-13)。FIG. 44 shows a schematic diagram of an example of a distance-based UI element change 4400 in accordance with an embodiment of the present disclosure. As shown in diagram 4400, UI elements with a distance of 0 (eg, UI element 5 itself) change more than UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8), and UI elements with a distance of 1 Elements change more than UI elements with distance 2 ( e.g. UI elements 2, 6, 9), and UI elements with distance 2 change more than UI elements with distance 3 (e.g. UI elements 1, 10) -13).
此外,在某些实施例中,为了更好地呈现动画效果的传导,并且改善用户体验,第一UI元素和第二UI元素并非同时开始发生变化。例如,第一UI元素可以在按压发生时开始发生变化,而第二UI元素可以在按压发生一段时间之后开始发生变化。为此,在某些实施例中,可以基于第一UI元素与第二UI元素之间的距离确定一个延迟时间,以及响应于按压发生后经过了延迟时间,使第二UI元素发生变化。进一步地,在某些实施例中,可以确定延迟系数,并且基于距离和延迟系数来确定延迟时间。例如,延迟时间可以是距离除以延迟系数的商。延迟系数可以是电子设备和用户可配置的。Furthermore, in some embodiments, in order to better present the conduction of the animation effect and improve the user experience, the first UI element and the second UI element do not start to change at the same time. For example, a first UI element may begin to change when a press occurs, while a second UI element may begin to change some time after the press occurs. To this end, in some embodiments, a delay time may be determined based on the distance between the first UI element and the second UI element, and the second UI element is changed in response to the elapse of the delay time after the pressing occurs. Further, in some embodiments, a delay factor may be determined, and the delay time is determined based on the distance and the delay factor. For example, the delay time may be the quotient of the distance divided by the delay factor. The delay factor may be electronically and user configurable.
图45示出了根据本公开的实施例的延迟时间4500的示例的示意图。如图45所示,距离为0的第一UI元素(例如,UI元素5)在按压发生的时间T81开始发生变化,距离为1的UI元素(例如,UI元素3、4、7、8)在其后的时间T82开始发生变化,距离为2的UI元素(例如,UI元素2、4、6、9)在更晚的时间T83开始发生变化,并且距离为3的UI元素(例如,UI元素1、10-13)在最晚的T84开始发生变化。45 shows a schematic diagram of an example of a delay time 4500 in accordance with an embodiment of the present disclosure. As shown in FIG. 45 , the first UI element with a distance of 0 (eg, UI element 5) starts to change at time T81 when the press occurs, and the UI elements with a distance of 1 (eg, UI elements 3, 4, 7, 8) Changes begin at a later time T82, UI elements with a distance of 2 (eg, UI elements 2, 4, 6, 9) begin to change at a later time T83, and UI elements with a distance of 3 (eg, UI Elements 1, 10-13) begin to change at the latest T84.
此外,在某些实施例中,UI元素发生变化的速度可以由幅度随时间变化的预定义曲线来控制。例如,预定义曲线可以为贝塞尔曲线或弹性力曲线。在弹性力曲线的情况下,可以通过控制弹簧的阻尼系数和刚性系数来控制发生变化的速度。在贝塞尔曲线的情况下,可以通过控制贝塞尔曲线的至少一个控制点中的至少一者的坐标,来控制发生变化的速度。Furthermore, in some embodiments, the speed at which UI elements change may be controlled by a predefined curve of amplitude versus time. For example, the predefined curve can be a Bezier curve or an elastic force curve. In the case of an elastic force curve, the speed at which the change occurs can be controlled by controlling the damping and stiffness coefficients of the spring. In the case of a Bezier curve, the speed at which the change occurs can be controlled by controlling the coordinates of at least one of the at least one control point of the Bezier curve.
此外,在某些实施例中,在按压结束之后(例如,在用户将手指抬离屏幕之后),发生变化的UI元素可以恢复。具体地,被按压的UI元素以及联动变化的N个UI元素都可以恢复。为此,在某些实施例中,可以将发生变化的第二UI元素恢复为发生变化前的第二UI元素。恢复过程可以是变化的逆过程,因此在此省略其详细描述。Furthermore, in some embodiments, UI elements that have changed may be restored after the press ends (eg, after the user lifts the finger off the screen). Specifically, the pressed UI element and the N UI elements that are changed in linkage can be restored. To this end, in some embodiments, the changed second UI element may be restored to the second UI element before the change. The restoration process may be an inverse process of the change, so a detailed description thereof is omitted here.
图46示出了根据本公开的实施例的UI元素的恢复4600的示例的示意图。如图46所示,发生变化后的UI元素(例如,UI元素1-13)都恢复为变化前的形态。46 shows a schematic diagram of an example of a restoration 4600 of UI elements in accordance with an embodiment of the present disclosure. As shown in FIG. 46, the UI elements (eg, UI elements 1-13) after the change are all restored to their pre-change forms.
在某些实施例中,变化的恢复可以存在回弹效果。例如,在用户松手后,UI元素的变化可以从左侧被压下同时右侧被翘起,变为左侧被翘起同时右侧被压下,然后再变化为初始形状。也就是说,在用户松手后,在视觉上呈现出UI元素翻转后再恢复的效果。In some embodiments, there may be a rebound effect to the restoration of changes. For example, after the user lets go, the UI element can change from being pressed on the left side while the right side is lifted, to being lifted on the left side while the right side is pressed down, and then back to the original shape. That is to say, after the user lets go, the effect of the UI element being flipped and then restored visually is presented.
图46B示出了根据本公开的实施例的具有回弹效果的UI元素的恢复的角度时间曲线4600B的示例的示意图。46B shows a schematic diagram of an example of an angle-time curve 4600B of recovery of a UI element with a bouncing effect, according to an embodiment of the present disclosure.
如图46B所示,在T91,UI元素5被按压而变化。例如,UI元素5在左侧被按压,从而围绕其基准点旋转。具体地,UI元素5在左侧被压下,同时右侧被翘起。此外,其他UI元素(例如,UI元素1-4、6-13)也联动变化。As shown in FIG. 46B, at T91, UI element 5 is pressed and changed. For example, UI element 5 is pressed on the left, thus rotating around its reference point. Specifically, UI element 5 is depressed on the left side, while the right side is lifted. In addition, other UI elements (eg, UI elements 1-4, 6-13) also change in conjunction.
在T92,用户松手。此时,UI元素5旋转的角度为-60°。此外,距离为1的UI元素(例如,UI元素3、4、7、8)联动旋转,但是旋转幅度小于UI元素5。另外,距离为2的UI元素(例如,UI元素2、6、9)也联动旋转,但是旋转幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)也联动旋转,但是旋转幅度小于距离为2的UI元素。At T92, the user lets go. At this time, the angle by which the UI element 5 is rotated is -60°. In addition, UI elements with a distance of 1 (eg, UI elements 3, 4, 7, and 8) rotate in conjunction with each other, but the rotation magnitude is smaller than that of UI element 5. In addition, UI elements with a distance of 2 (for example, UI elements 2, 6, and 9) are also rotated in conjunction, but the rotation amplitude is smaller than that of UI elements with a distance of 1. Further, UI elements with a distance of 3 (for example, UI elements 1, 10-13) are also rotated in conjunction, but the rotation amplitude is smaller than that of UI elements with a distance of 2.
在T92和T93期间,UI元素开始旋转回弹。During T92 and T93, UI elements start to spin and bounce back.
在T93,UI元素5旋转回弹的角度为45°。此外,距离为1的UI元素(例如,UI元素3、4、7、8)联动旋转回弹,但是旋转回弹幅度小于UI元素5。另外,距离为2的UI元素(例如,UI元素2、6、9)也联动旋转回弹,但是旋转回弹幅度小于距离为1的UI元素。进一步地,距离为3的UI元素(例如,UI元素1、10-13)也联动旋转回弹,但是旋转回弹幅度小于距离为2的UI元素。At T93, UI element 5 rotates back at an angle of 45°. In addition, UI elements with a distance of 1 (for example, UI elements 3, 4, 7, and 8) rotate and rebound together, but the magnitude of the rotation rebound is smaller than that of UI element 5. In addition, UI elements with a distance of 2 (for example, UI elements 2, 6, and 9) also rotate and rebound in conjunction, but the magnitude of the rotation rebound is smaller than that of UI elements with a distance of 1. Further, UI elements with a distance of 3 (for example, UI elements 1, 10-13) also rotate and rebound in linkage, but the magnitude of the rotation rebound is smaller than that of UI elements with a distance of 2.
在T94,全部UI元素恢复为初始形状。换句话说,全部UI元素的旋转角度恢复为0°。At T94, all UI elements revert to their original shapes. In other words, the rotation angle of all UI elements reverts to 0°.
应当理解,图46B中的旋转角度仅是示例,UI元素可以以任何适当模式变化。此外,虽然在图46B中将回弹效果示出为仅回弹一次,但是可以实现具有多次回弹的回弹效果。回弹次数可以是任何适当的回弹次数,本公开在此不受限制。在某些实施例中,多次回弹的回弹幅度可以随时间减小。It should be understood that the rotation angles in Figure 46B are examples only, and the UI elements may vary in any suitable pattern. Furthermore, although the rebound effect is shown as only one rebound in FIG. 46B, a rebound effect with multiple rebounds can be achieved. The number of rebounds may be any suitable number of rebounds, and the present disclosure is not limited herein. In certain embodiments, the rebound magnitude of the multiple rebounds may decrease over time.
图46C示出了根据本公开的实施例的具有回弹幅度减小的多次回弹的回弹效果的UI元素的恢复的角度时间曲线4600C的示例的示意图。46C shows a schematic diagram of an example of a recovered angular time curve 4600C of a UI element with the rebound effect of multiple rebounds with reduced rebound amplitudes, according to an embodiment of the present disclosure.
如图46C所示,UI元素经多次回弹后恢复为初始形状,其中距离为0的UI元素(例如,UI元素5)的回弹的旋转幅度(例如,旋转角度)大于距离为1的UI元素(例如,UI元素3、4、7、8)。距离为1的UI元素的回弹的旋转幅度大于距离为2的UI元素(例如,UI元素2、6、9)。距离为2的UI元素的回弹的旋转幅度大于距离为3的UI元素(例如,UI元素1、10-13)。As shown in FIG. 46C , the UI element recovers to its original shape after multiple rebounds, wherein the UI element with a distance of 0 (eg, UI element 5 ) rebounds with a greater rotation amplitude (eg, rotation angle) than the UI with a distance of 1 elements ( eg UI elements 3, 4, 7, 8). A UI element with a distance of 1 bounces with a greater rotation magnitude than a UI element with a distance of 2 (eg, UI elements 2, 6, 9). A UI element with a distance of 2 bounces with a greater rotation magnitude than a UI element with a distance of 3 (eg, UI elements 1, 10-13).
进一步地,在某些实施例中,回弹效果也可以受预定义曲线(例如,弹性力曲线、贝塞尔曲线等)控制。例如,这些UI元素可以以预定义曲线控制的动画效果变化回弹。Further, in some embodiments, the springback effect may also be controlled by predefined curves (eg, elastic force curves, Bezier curves, etc.). For example, these UI elements can bounce back and forth with animation effects controlled by predefined curves.
下面介绍本公开的实施例提出的联动的动画实现原理和系统架构。The following describes the implementation principle and system architecture of the linked animation proposed by the embodiments of the present disclosure.
图47示出了根据本公开的实施例的动画实现原理图4700。如上所述,动画本质上是基于刷新率实时显示UI或UI元素。由于人类的视觉暂留原理,使得用户感觉画面是运动的。如图47所示,动画从动画的初态在经过动画时间之后变换为动画的终态。在这个变换过程中,动画可以由动画类型和动画变换形式进行控制。例如,动画类型可以包括位移动画、旋转动画、缩放动画和透明动画等。而动画变换形式可以由插值器和估值器等控制器进行控制。这样的控制器可以用于在动画时间期间控制对动画进行变换的速度。Figure 47 shows an animation implementation schematic 4700 in accordance with an embodiment of the present disclosure. As mentioned above, animation is essentially the real-time display of UI or UI elements based on refresh rate. Due to the human vision persistence principle, the user feels that the picture is moving. As shown in FIG. 47 , the animation transitions from the initial state of the animation to the final state of the animation after the animation time has elapsed. During this transformation, the animation can be controlled by the animation type and animation transformation form. For example, animation types may include displacement animations, rotation animations, scale animations, and transparency animations, among others. The animation transformation form can be controlled by controllers such as interpolators and estimators. Such a controller can be used to control the speed at which the animation is transformed during animation time.
具体地,插值器用于设置动画属性值从初态过渡到终态的变化逻辑,从而控制动画变化的速率,使得动画能够以匀速、加速、减速、抛物线速率等速率中的一或多种速率变化。Specifically, the interpolator is used to set the change logic of the animation property value transitioning from the initial state to the final state, thereby controlling the rate of animation change, so that the animation can change at one or more of the rates of uniform speed, acceleration, deceleration, and parabolic rate. .
在某些实施例中,电子设备100可以根据系统插值器或自定义插值器(例如弹性力插值器、摩擦力插值器)设置动画属性值的变化逻辑。动画运行时,当电子设备100根据上述变化逻辑确定动画属性值发生改变时,基于上述动画属性值绘制图像帧,并且刷新视图。In some embodiments, the electronic device 100 may set the change logic of the animation property value according to a system interpolator or a custom interpolator (eg, an elastic force interpolator, a friction force interpolator). When the animation is running, when the electronic device 100 determines that the animation attribute value changes according to the above-mentioned change logic, it draws an image frame based on the above-mentioned animation attribute value, and refreshes the view.
在某些实施例中,当电子设备100根据插值器的变化逻辑确定动画属性值发生改变时,基于上述动画属性值调用invalidate()函数刷新视图,即调用onDraw()函数重新绘制视图并显示。In some embodiments, when the electronic device 100 determines that the animation property value has changed according to the change logic of the interpolator, the invalidate() function is called based on the animation property value to refresh the view, that is, the onDraw() function is called to redraw and display the view.
在某些实施例中,电子设备100自定义了弹性力插值器。例如,弹性力插值器的函数的参数至少包括刚性系数(stiffness)和阻尼系数(damping)。作为示例,弹性力插值器的函数代码可以表示为以下其中一项:“SpringInterpolator(float stiffness,float damping)”、“SpringInterpolator(float stiffness,float damping,float endPos)”、“SpringInterpolator(float stiffness,float damping,float endPos,float velocity)”、“SpringInterpolator(float stiffness,float damping,float endPos,float velocity,float valueThreshold)”。In some embodiments, the electronic device 100 customizes an elastic force interpolator. For example, the parameters of the function of the elastic force interpolator include at least stiffness and damping. As an example, the function code for an elastic force interpolator can be expressed as one of the following: "SpringInterpolator(float stiffness,float damping)", "SpringInterpolator(float stiffness,float damping,float endPos)", "SpringInterpolator(float stiffness,float)" damping,float endPos,float velocity)", "SpringInterpolator(float stiffness,float damping,float endPos,float velocity,float valueThreshold)".
其中,参数endPos表示相对位移,即弹簧初始位置和静止位置差值。在某些实施例中,endPos可以表示UI元素的相对位移。Among them, the parameter endPos represents the relative displacement, that is, the difference between the initial position of the spring and the rest position. In some embodiments, endPos may represent a relative displacement of UI elements.
参数velocity表示初速度。在某些实施例中,velocity可以表示UI元素的初速度。The parameter velocity represents the initial velocity. In some embodiments, velocity may represent the initial velocity of UI elements.
参数valueThreshold表示判断动画停止的阈值。当相邻两帧间的位移(或者其他属性)差值小于该阈值,动画停止运行。该阈值越大,动画越容易停止,运行时间也更短;反之,动画运行时间更长。该阈值的取值可以按照具体的动画属性进行设置。在一些实施例中,弹性插值器FloatValueHold参数缺省为1/1000,其他构造方法中该阈值取值为1。在一些实施例中,自定义该阈值时,按照动画属性可以使用表1所示的建议值。The parameter valueThreshold indicates the threshold for judging animation stop. When the difference in displacement (or other properties) between two adjacent frames is less than the threshold, the animation stops running. The larger the threshold, the easier it is for the animation to stop and the shorter the run time; conversely, the longer the animation runs. The value of the threshold can be set according to specific animation properties. In some embodiments, the default value of the elastic interpolator FloatValueHold parameter is 1/1000, and the threshold value is 1 in other construction methods. In some embodiments, when customizing the threshold, the suggested values shown in Table 1 can be used according to the animation properties.
表1Table 1
动画属性animation properties valueThresholdvalueThreshold
ROTATION/ROTATION_X/ROTATION_YROTATION/ROTATION_X/ROTATION_Y 1/101/10
ALPHA ALPHA 1/2561/256
SCALE_X/SCALE_YSCALE_X/SCALE_Y 1/5001/500
TRANSLATION_Y/TRANSLATION_XTRANSLATION_Y/TRANSLATION_X 11
此外,该阈值还可以直接使用DynamicAnimation类提供的如下常量:MIN_VISIBLE_CHANGE_PIXELS、IN_VISIBLE_CHANGE_ROTATION_DEGREES、MIN_VISIBLE_CHANGE_ALPHA、MIN_VISIBLE_CHANGE_SCALE。In addition, the threshold can directly use the following constants provided by the DynamicAnimation class: MIN_VISIBLE_CHANGE_PIXELS, IN_VISIBLE_CHANGE_ROTATION_DEGREES, MIN_VISIBLE_CHANGE_ALPHA, MIN_VISIBLE_CHANGE_SCALE.
作为示例,自定义弹性力插值器的动画类的具体代码可以表示如下:As an example, the specific code of the animation class of the custom elastic force interpolator can be expressed as follows:
“PhysicalInterpolatorBase interpolator=new SpringInterpolator(400F,40F,200F,2600F,1F);"PhysicalInterpolatorBase interpolator=new SpringInterpolator(400F, 40F, 200F, 2600F, 1F);
ObjectAnimator animator=ObjectAnimator.ofFloat(listView,“translationY”,0,346);ObjectAnimator animator = ObjectAnimator.ofFloat(listView, "translationY", 0, 346);
animator.setDuration(interpolator.getDuration());//获取动画时间animator.setDuration(interpolator.getDuration());//Get animation time
animator.setInterpolator(interpolator);//将自定义插值器设置给动画类animator.setInterpolator(interpolator);//Set the custom interpolator to the animation class
animator.start();//运行动画”。animator.start(); //Run the animation".
在某些实施例中,电子设备100自定义了摩擦力插值器。作为示例,摩擦力插值器的函数代码可以表示为“FlingInterpolator(float initVelocity,float friction)”。其中,initVelocity表示初速度,friction表示摩擦力。In some embodiments, electronic device 100 customizes a friction interpolator. As an example, the function code for the friction interpolator can be expressed as "FlingInterpolator(float initVelocity, float friction)". Among them, initVelocity represents the initial velocity, and friction represents the frictional force.
作为示例,使用摩擦力插值器的动画类的具体代码可以表示如下:As an example, the concrete code for an animation class using a friction interpolator can be represented as follows:
“PhysicalInterpolatorBase interpolator=new FlingInterpolator(600F,0.5F);"PhysicalInterpolatorBase interpolator=new FlingInterpolator(600F, 0.5F);
ObjectAnimator animator=ObjectAnimator.ofFloat(listView,“translationY”,0,interpolator.getEndOffset());ObjectAnimator animator=ObjectAnimator.ofFloat(listView,"translationY",0,interpolator.getEndOffset());
animator.setDuration(interpolator.getDuration());//获取动画时间animator.setDuration(interpolator.getDuration());//Get animation time
animator.setInterpolator(interpolator);//将自定义插值器设置给动画类animator.start();”//运行动画。animator.setInterpolator(interpolator);//Set the custom interpolator to the animation class animator.start();"//Run the animation.
在某些实施例中,电子设备100可以自行设置动画时间(Duration)以及起始位置;也可以调用引擎模型获取动画时间(Duration)以及终止位置,再设置给动画类(Animator类)。In some embodiments, the electronic device 100 can set the animation time (Duration) and start position by itself; it can also call the engine model to obtain the animation time (Duration) and end position, and then set them to the animation class (Animator class).
作为示例,电子设备100调用引擎模型获取动画时间的代码可以表示为“com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#getDuration”。As an example, the code for the electronic device 100 to call the engine model to obtain the animation time may be expressed as "com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#getDuration".
作为示例,调用引擎模型获取弹簧的终止位置的代码可以表示为“com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#getEndOffset”。As an example, the code that calls the engine model to get the end position of the spring can be expressed as "com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#getEndOffset".
作为示例,设置参数valueThreshold的代码可以表示为“com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#setValueThreshold”。As an example, the code to set the parameter valueThreshold may be represented as "com.xxx.dynamicanimation.interpolator.PhysicalInterpolatorBase#setValueThreshold".
在某些实施例中,使用弹性引擎动画类的代码可以表示为如下代码的其中一项:“SpringAnimation(K object,FloatPropertyCompat<K>property,float stiffness,float damping,float startValue,float endValue,float velocity)”、“SpringAnimation(K object,FloatPropertyCompat<K>property,float stiffness,float damping,float endValue,float velocity)”。In some embodiments, the code using the elastic engine animation class can be expressed as one of the following codes: "SpringAnimation(K object,FloatPropertyCompat<K>property,float stiffness,float damping,float startValue,float endValue,float velocity )", "SpringAnimation(K object,FloatPropertyCompat<K>property,float stiffness,float damping,float endValue,float velocity)".
其中,参数object表示动画对象;Property表示动画类或者插值器作用的属性对象。参见表1,该参数可以用于间接设置valueThreshold。插值器版本中该参数是可选的,当valueThreshold已通过其他方式设置,可不设置该参数,即直接使用无property参数的构造方法。动画类版本中该参数为必选参数。DynamicAnimation类已提供如下可直接使用的常量:Among them, the parameter object represents the animation object; Property represents the animation class or the property object of the interpolator. See Table 1, this parameter can be used to indirectly set valueThreshold. This parameter is optional in the interpolator version. When valueThreshold has been set in other ways, this parameter can be omitted, that is, the construction method without the property parameter can be used directly. This parameter is required in the animation version. The DynamicAnimation class already provides the following constants that can be used directly:
“TRANSLATION_X、TRANSLATION_Y、TRANSLATION_Z、SCALE_X、SCALE_Y、ROTATION、ROTATION_X、ROTATION_Y、X、Y、Z、ALPHA、SCROLL_X、SCROLL_Y”,电子设备100也可以自定义实现ViewProperty接口。"TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, SCALE_X, SCALE_Y, ROTATION, ROTATION_X, ROTATION_Y, X, Y, Z, ALPHA, SCROLL_X, SCROLL_Y", the electronic device 100 may also implement the ViewProperty interface by definition.
作为示例,使用弹簧引擎动画类的具体代码可以表示如下:As an example, concrete code using the Spring Engine animation class can be expressed as follows:
“SpringAnimation animation=SpringAnimation(listView,DynamicAnimation.TRANSLATION_Y,400F,40F,0,1000F);"SpringAnimation animation=SpringAnimation(listView,DynamicAnimation.TRANSLATION_Y,400F,40F,0,1000F);
animation.start();”animation.start();"
在某些实施例中,使用摩擦力引擎动画类的代码可以表示为:“FlingAnimation(K object,FloatPropertyCompat<K>property,float initVelocity,float friction)”。In some embodiments, the code using the friction engine animation class can be expressed as: "FlingAnimation(K object, FloatPropertyCompat<K> property, float initVelocity, float friction)".
作为示例,使用摩擦力动画类的具体代码可以表示如下:As an example, concrete code using the friction animation class can be expressed as follows:
“FlingAnimation animation=FlingAnimation(listView,DynamicAnimation.TRANSLATION_Y,2000F,0.5F);"FlingAnimation animation=FlingAnimation(listView,DynamicAnimation.TRANSLATION_Y,2000F,0.5F);
animation.start();”。animation.start();".
图48示出了根据本公开的实施例的用于实现“联动”动画效果能力或功能的系统框架4800的示意图。UI框架的动效能力的是基于安卓
Figure PCTCN2022087751-appb-000007
或者鸿蒙
Figure PCTCN2022087751-appb-000008
的整体架构来实现的,包含了主流的4层的逻辑处理,数据处理的流程从底层往上呈现给用户。用户主要在应用层使用和体验动效的功能。在本公开的实施例中,桌面和UI框架的能力交互关系如图48所示。具体 地,如图48所示,系统框架4800可以包括应用程序层4810、应用程序框架层4830、硬件抽象层4850、以及内核层4870。应用程序层4810可以包括桌面4812。桌面4812上可以实现UI元素操作4814。UI元素操作4814例如可以包括拖拽操作、按压操作、深度按压操作等。应用程序框架层4830可以包括系统服务4832和扩展服务4834。系统服务4832可以包括各种系统服务,例如Service 4833。扩展服务4834可以包括各种扩展服务,例如SDK 4835。硬件抽象层(HAL)4850可以包括HAL 3.0 4852和算法Algo 4854。内核层4870可以包括驱动4872和物理设备4874。物理设备4874可以向驱动4872提供原始参数流,而驱动4872可以向物理设备4874提供功能处理参数流。如图48进一步示出的,用于实现联动动效4825的UI框架4820可以实现在应用程序层4810与应用程序框架层4830之间。UI框架4820可以包括平台能力4822和系统能力4824,两者可以用于提供联动动效4825。联动动效4825进而可以提供给应用程序层4810的UI元素操作4814。
Figure 48 shows a schematic diagram of a system framework 4800 for implementing "linkage" animation effects capabilities or functions according to an embodiment of the present disclosure. The animation capabilities of the UI framework are based on Android
Figure PCTCN2022087751-appb-000007
or Hongmeng
Figure PCTCN2022087751-appb-000008
It is implemented by the overall architecture of the system, including the mainstream 4-layer logic processing, and the data processing process is presented to the user from the bottom to the top. Users mainly use and experience animation functions at the application layer. In the embodiment of the present disclosure, the capability interaction relationship between the desktop and the UI framework is shown in FIG. 48 . Specifically, as shown in FIG. 48 , the system framework 4800 may include an application layer 4810 , an application framework layer 4830 , a hardware abstraction layer 4850 , and a kernel layer 4870 . Application layer 4810 may include desktop 4812. UI element operations 4814 may be implemented on the desktop 4812. The UI element operation 4814 may include, for example, a drag operation, a press operation, a deep press operation, and the like. The application framework layer 4830 may include system services 4832 and extension services 4834. System services 4832 may include various system services, such as Service 4833. Extension services 4834 may include various extension services, such as SDK 4835. A hardware abstraction layer (HAL) 4850 may include HAL 3.0 4852 and algorithm Algo 4854. Kernel layer 4870 may include drivers 4872 and physical devices 4874. Physical device 4874 may provide raw parameter streams to driver 4872, and driver 4872 may provide functional processing parameter streams to physical device 4874. As further shown in FIG. 48 , the UI framework 4820 for implementing the linkage motion effect 4825 may be implemented between the application layer 4810 and the application framework layer 4830 . UI framework 4820 may include platform capabilities 4822 and system capabilities 4824, both of which may be used to provide linkage animation 4825. The linkage animation 4825 may in turn be provided to the UI element operations 4814 of the application layer 4810.
图49示出了根据本公开的实施例的“联动”动画效果能力或功能所涉及到的应用侧和UI框架侧之间的关系的示意图。如图49所示,应用侧4910可以包括桌面4915,桌面4915上的UI元素可以实现拖拽、按压、深度按压等操作。UI框架侧4950可以包括UI框架动效4952,UI框架动效4952可以实现联动动效能力4954,联动动效能力4954可以通过AAR格式4951、JAR格式4953和系统接口4955等方式来实现。应用侧4910可以通过集成4930和调用4940等方式来调用UI框架侧4950提供的“联动”动画效果能力或功能。通过应用侧4910和UI框架侧4950之间的交互,本公开的实施例实现了新型的联动“动画效果”,使得原本独立的UI元素(例如,图标、卡片、控件等)联系起来。FIG. 49 shows a schematic diagram of the relationship between the application side and the UI framework side involved in the "linkage" animation effect capability or function according to an embodiment of the present disclosure. As shown in FIG. 49 , the application side 4910 may include a desktop 4915, and UI elements on the desktop 4915 may implement operations such as dragging, pressing, and deep pressing. The UI frame side 4950 may include UI frame motion effects 4952. The UI frame motion effects 4952 may implement the linkage motion effect capability 4954. The linkage motion effect capability 4954 may be implemented by means of AAR format 4951, JAR format 4953, and system interface 4955. The application side 4910 can call the "linkage" animation effect capability or function provided by the UI framework side 4950 by integrating 4930 and calling 4940. Through the interaction between the application side 4910 and the UI framework side 4950, embodiments of the present disclosure implement a new type of linkage "animation effect" that links originally independent UI elements (eg, icons, cards, controls, etc.).
图50示出了根据本公开的实施例的“联动”动画效果能力或功能实现的三种方式的具体说明的示意图。如图50所示,AAR格式4951与电子设备100的系统之间的关系5001为:AAR格式4951是以二进制方式的能力打包的,提供给系统中应用侧集成的能力,可以自由控制版本节奏,不跟随系统。JAR格式4953与电子设备100的系统之间的关系5003为:JAR格式4953是以二进制方式的能力打包的,提供给系统中所有部件的能力,可以自由控制版本节奏,不跟随系统。系统接口4955与电子设备100的系统之间的关系5005为:系统接口4955是系统版本中的框架层的接口,提供给系统中所有部件的能力,跟随系统升级。本公开的重点就是联动动效能力的实现。其中,集成就是AAR和JAR的方式,调用就是系统接口的方式。场景不限,只是能力的展现方式不一致。也就是说,本公开在前文描述的各种方法的功能可以通过AAR格式文件、JAR格式文件和/或电子设备100的系统接口来实现。以此方式,“联动”动画效果的能力或功能可以简单和方便地被实现并提供给电子设备的应用程序,例如桌面。FIG. 50 shows a schematic diagram of a specific description of three ways of implementing the “linkage” animation effect capability or function according to an embodiment of the present disclosure. As shown in Figure 50, the relationship 5001 between the AAR format 4951 and the system of the electronic device 100 is as follows: AAR format 4951 is packaged with capabilities in a binary format, which provides the ability to integrate the application side in the system, and can freely control the version rhythm, Do not follow the system. The relationship 5003 between the JAR format 4953 and the system of the electronic device 100 is as follows: the JAR format 4953 is packaged with capabilities in a binary format, provides capabilities for all components in the system, and can freely control the version rhythm without following the system. The relationship 5005 between the system interface 4955 and the system of the electronic device 100 is: the system interface 4955 is the interface of the framework layer in the system version, and provides the capability of all components in the system, following the system upgrade. The focus of the present disclosure is the realization of the linkage dynamic effect capability. Among them, integration is the way of AAR and JAR, and invocation is the way of system interface. The scene is not limited, but the way the ability is displayed is inconsistent. That is to say, the functions of the various methods described above in the present disclosure may be implemented through an AAR format file, a JAR format file, and/or a system interface of the electronic device 100 . In this way, the ability or functionality to "link" animation effects can be simply and conveniently implemented and provided to an application of an electronic device, such as a desktop.

Claims (17)

  1. 一种图形界面显示方法,包括:A graphical interface display method, comprising:
    在电子设备的屏幕上显示M个用户界面UI元素,M为大于1的正整数;Display M user interface UI elements on the screen of the electronic device, where M is a positive integer greater than 1;
    检测到作用于所述M个UI元素中的第一UI元素处的按压;detecting a press acting on the first UI element among the M UI elements;
    响应于所述按压,使所述屏幕上的N个UI元素中的每个UI元素以相应动画效果发生变化,N为1与M-1之间的正整数,其中使所述N个UI元素以相应动画效果发生变化包括:In response to the pressing, causing each of the N UI elements on the screen to change with a corresponding animation effect, where N is a positive integer between 1 and M-1, wherein the N UI elements are caused to change with a corresponding animation effect Changes with corresponding animation effects include:
    确定所述第一UI元素与所述N个UI元素中的第二UI元素之间的距离;determining the distance between the first UI element and the second UI element in the N UI elements;
    基于所述距离以及所述按压在所述UI中的位置,来确定所述第二UI元素发生变化的动画效果;以及determining an animation effect of the change of the second UI element based on the distance and the position of the press in the UI; and
    使所述第二UI元素以所述动画效果发生变化,以从视觉上指示所述按压。The second UI element is animated with the animation effect to visually indicate the press.
  2. 根据权利要求1所述的方法,其中确定所述距离包括:The method of claim 1, wherein determining the distance comprises:
    确定所述第一UI元素的第一基准点和所述第二UI元素的第二基准点;以及determining a first fiducial point for the first UI element and a second fiducial point for the second UI element; and
    确定所述第一基准点与所述第二基准点之间的距离作为所述距离。The distance between the first reference point and the second reference point is determined as the distance.
  3. 根据权利要求1所述的方法,其中确定所述距离包括:The method of claim 1, wherein determining the distance comprises:
    确定所述第一UI元素的第一基准点;determining a first reference point of the first UI element;
    从以所述第一基准点为圆心的、具有各自半径的多个圆中,确定与所述第二UI元素相交并且半径最小的目标圆;以及from a plurality of circles having respective radii centered on the first reference point, determining a target circle intersecting the second UI element and having the smallest radius; and
    将所述目标圆的半径确定为所述距离。The radius of the target circle is determined as the distance.
  4. 根据权利要求1所述的方法,其中确定所述距离包括:The method of claim 1, wherein determining the distance comprises:
    确定所述第一UI元素与所述第二UI元素之间的横向间距;determining the horizontal spacing between the first UI element and the second UI element;
    确定所述第一UI元素与所述第二UI元素之间的纵向间距;以及determining a vertical spacing between the first UI element and the second UI element; and
    基于如下任一项来确定所述距离:The distance is determined based on any of the following:
    所述横向间距和所述纵向间距中的至少一者,或at least one of said lateral spacing and said longitudinal spacing, or
    所述横向间距和所述纵向间距中的至少一者、以及从所述第二UI元素的第二基准点指向所述第一UI元素的第一基准点的方向。at least one of the horizontal spacing and the vertical spacing, and a direction from a second fiducial point of the second UI element to a first fiducial point of the first UI element.
  5. 根据权利要求1至4中任一项所述的方法,还包括:The method of any one of claims 1 to 4, further comprising:
    基于所述第一UI元素的尺寸来确定所述第一UI元素的影响区域;以及determining an area of influence of the first UI element based on the size of the first UI element; and
    将所述M个UI元素中在所述影响区域内的UI元素确定为所述N个UI元素。The UI elements within the influence area among the M UI elements are determined as the N UI elements.
  6. 根据权利要求1至4中任一项所述的方法,还包括:The method of any one of claims 1 to 4, further comprising:
    将所述M个UI元素中除所述第一UI元素以外的M-1个UI元素确定为所述N个UI元素。M-1 UI elements other than the first UI element among the M UI elements are determined as the N UI elements.
  7. 根据权利要求1至6中任一项所述的方法,其中所述动画效果包括:The method according to any one of claims 1 to 6, wherein the animation effect comprises:
    视觉上相对于所述按压的所述位置以翘板方式移动位置,或seesaw the position visually relative to the position of the press, or
    视觉上相对于所述按压的所述位置的凹陷或突出。A depression or protrusion visually relative to the location of the press.
  8. 根据权利要求1至7中任一项所述的方法,其中确定所述动画效果包括:The method of any one of claims 1 to 7, wherein determining the animation effect comprises:
    确定所述第一UI元素响应于所述按压而发生变化的第一幅度;以及determining a first magnitude by which the first UI element changes in response to the press; and
    基于如下任一项来确定所述第二UI元素响应于所述按压而发生变化的幅度:The magnitude of the change in the second UI element in response to the press is determined based on any of the following:
    所述第一幅度和所述距离,或the first magnitude and the distance, or
    所述第二UI元素的尺寸和所述第一UI元素的尺寸中的至少一者、所述第一幅度、 以及所述距离。at least one of a size of the second UI element and a size of the first UI element, the first magnitude, and the distance.
  9. 根据权利要求8所述的方法,其中所述第一UI元素的变化的第一幅度基于与所述第一UI元素相关联的以下至少一项来确定:9. The method of claim 8, wherein the first magnitude of change in the first UI element is determined based on at least one of the following associated with the first UI element:
    所述第一UI元素的尺寸,the size of the first UI element,
    所述第一UI元素的第一基准点的位置,the position of the first reference point of the first UI element,
    所述第一UI元素能够发生变化的幅度范围,the range of the amplitude that the first UI element can change,
    所述按压的所述位置,said position of said pressing,
    所述按压的持续时间,和the duration of the compression, and
    预定按压力。Scheduled pressing force.
  10. 根据权利要求1至9中任一项所述的方法,其中使所述第二UI元素发生变化包括:The method of any one of claims 1 to 9, wherein changing the second UI element comprises:
    基于所述距离确定一个延迟时间;以及determining a delay time based on the distance; and
    响应于所述按压发生后经过了所述延迟时间,使所述第二UI元素发生变化。The second UI element is changed in response to the elapse of the delay time after the pressing occurs.
  11. 根据权利要求1至10中任一项所述的方法,其中使所述第二UI元素发生变化包括:The method of any one of claims 1 to 10, wherein changing the second UI element comprises:
    基于幅度随时间变化的预定义曲线,来确定所述第二UI元素响应于所述按压而发生变化的速度。The speed at which the second UI element changes in response to the press is determined based on a predefined curve of amplitude versus time.
  12. 根据权利要求11所述的方法,其中所述预定义曲线为贝塞尔曲线或弹性力曲线。The method of claim 11, wherein the predefined curve is a Bezier curve or an elastic force curve.
  13. 根据权利要求1至12中任一项所述的方法,还包括:The method of any one of claims 1 to 12, further comprising:
    将变化后的第二UI元素恢复为所述第二UI元素。Restore the changed second UI element to the second UI element.
  14. 根据权利要求1至13中任一项所述的方法,其中所述方法通过AAR格式文件、JAR格式文件和系统接口中的至少一者来实现。The method of any one of claims 1 to 13, wherein the method is implemented by at least one of an AAR format file, a JAR format file, and a system interface.
  15. 一种电子设备,其特征在于,包括:处理器、以及存储有指令的存储器,所述指令在被所述处理器执行时使得所述电子设备执行根据权利要求1至14中任一项所述的方法。An electronic device, characterized by comprising: a processor and a memory storing instructions, the instructions, when executed by the processor, cause the electronic device to execute the method according to any one of claims 1 to 14 Methods.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有指令,所述指令在被电子设备执行时使得所述电子设备执行根据权利要求1至14中任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores instructions, and when executed by an electronic device, the instructions cause the electronic device to perform the method according to any one of claims 1 to 14 Methods.
  17. 一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,所述指令在被电子设备执行时使得所述电子设备执行根据权利要求1至14中任一项所述的方法。A computer program product, characterized in that the computer program product comprises instructions which, when executed by an electronic device, cause the electronic device to perform the method according to any one of claims 1 to 14.
PCT/CN2022/087751 2021-04-20 2022-04-19 Graphical interface display method, electronic device, medium, and program product WO2022222931A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110426824.5A CN115220621A (en) 2021-04-20 2021-04-20 Graphical interface display method, electronic device, medium, and program product
CN202110426824.5 2021-04-20

Publications (1)

Publication Number Publication Date
WO2022222931A1 true WO2022222931A1 (en) 2022-10-27

Family

ID=83604135

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/087751 WO2022222931A1 (en) 2021-04-20 2022-04-19 Graphical interface display method, electronic device, medium, and program product

Country Status (2)

Country Link
CN (1) CN115220621A (en)
WO (1) WO2022222931A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150370447A1 (en) * 2014-06-24 2015-12-24 Google Inc. Computerized systems and methods for cascading user interface element animations
CN109643218A (en) * 2016-04-26 2019-04-16 谷歌有限责任公司 The animation of user interface element
CN112256165A (en) * 2019-12-13 2021-01-22 华为技术有限公司 Application icon display method and electronic equipment
CN113552987A (en) * 2021-04-20 2021-10-26 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product
CN113568549A (en) * 2021-04-20 2021-10-29 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7173623B2 (en) * 2003-05-09 2007-02-06 Microsoft Corporation System supporting animation of graphical display elements through animation object instances
CN107767431B (en) * 2017-09-28 2021-06-01 北京知道创宇信息技术股份有限公司 Web animation production method and computing device
EP4246447A3 (en) * 2017-11-20 2023-11-01 Huawei Technologies Co., Ltd. Method and device for dynamically displaying icon according to background image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150370447A1 (en) * 2014-06-24 2015-12-24 Google Inc. Computerized systems and methods for cascading user interface element animations
CN109643218A (en) * 2016-04-26 2019-04-16 谷歌有限责任公司 The animation of user interface element
CN112256165A (en) * 2019-12-13 2021-01-22 华为技术有限公司 Application icon display method and electronic equipment
CN112987987A (en) * 2019-12-13 2021-06-18 华为技术有限公司 Application icon display method and electronic equipment
CN113552987A (en) * 2021-04-20 2021-10-26 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product
CN113568549A (en) * 2021-04-20 2021-10-29 华为技术有限公司 Graphical interface display method, electronic device, medium, and program product

Also Published As

Publication number Publication date
CN115220621A (en) 2022-10-21

Similar Documents

Publication Publication Date Title
WO2022222738A1 (en) Graphical interface display method, electronic device, medium, and program product
WO2022222830A1 (en) Graphic interface display method, electronic device, medium and program product
WO2021036571A1 (en) Desktop editing method and electronic device
WO2021115194A1 (en) Application icon display method and electronic device
EP4224831A1 (en) Image processing method and electronic device
CN113805745B (en) Control method of suspension window and electronic equipment
WO2022199509A1 (en) Method for application performing drawing operation, and electronic device
CN113132526B (en) Page drawing method and related device
WO2022222931A1 (en) Graphical interface display method, electronic device, medium, and program product
WO2022222831A1 (en) Graphical interface display method, electronic device, medium, and program product
WO2022078116A1 (en) Brush effect picture generation method, image editing method and device, and storage medium
WO2023130977A1 (en) User interface display method, electronic device, medium and program product
WO2022247541A1 (en) Method and apparatus for application animation linking
WO2022247542A1 (en) Dynamic effect calculating method and apparatus
US20230351665A1 (en) Animation Processing Method and Related Apparatus
CN116700555B (en) Dynamic effect processing method and electronic equipment
WO2024017183A1 (en) Display method for interface switching, and electronic device
WO2023236649A1 (en) Method for displaying switch control, and electronic device
WO2024017185A1 (en) Interface display method and electronic device
WO2023066177A1 (en) Animation effect display method and electronic device
CN114691002A (en) Page sliding processing method and related device
CN117290004A (en) Component preview method and electronic equipment
CN115700444A (en) Cursor display method and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22791038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22791038

Country of ref document: EP

Kind code of ref document: A1