A method and apparatus for cyclic sliding switching of the main interface based on LVGL
By introducing an application interface avatar into the LVGL system framework and combining it with touch screen detection, the cyclic sliding switching of the main interface of electronic devices is realized, which solves the problem of limited interface switching direction in the prior art and improves user experience and interface recognition convenience.
Patent Information
- Application Number
- CN202311789709.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-12-22
Smart Images

Figure CN117742563B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for cyclically sliding and switching the main interface of an electronic device. Background Technology
[0002] Currently, there are two main GUI (graphical user interface) solutions used in embedded systems: high-end electronic devices use the Android GUI framework, while low-end electronic devices use the miniGUI framework. The Android GUI framework has a large codebase, making it unsuitable for electronic devices with limited storage space. The miniGUI framework has outdated functionality, insufficient visual effects, and its code size is still not small enough.
[0003] LVGL (Light and Versatile Graphics Library) is a new GUI system framework with advantages such as small code size and ease of UI (user interface) development. It only requires 16MB of flash memory to load the firmware of electronic devices, making it suitable for GUI solutions in devices such as smartwatches for children. However, the LVGL framework currently does not provide complete solutions for the diverse needs of various electronic devices, requiring the development of new functionalities on top of it.
[0004] Taking a certain electronic device as an example, assume its screen height is H pixels and its screen width is W pixels. Please refer to [link / reference]. Figure 1This is a schematic diagram of the main interface of the electronic device. The main interface is composed of N application interfaces pieced together from left to right, where N is a positive integer. Each application interface is a screen with a height of H pixels and a width of W pixels; therefore, the main interface is a canvas with a height of H pixels and a width of N×W pixels. One of the applications is a clock, and the clock interface is, for example, the content displayed on the screen by default on the main interface. Users can switch between other application interfaces by swiping left and right on a touch-enabled screen. On the main interface, the leftmost is application interface 0, for example, the clock interface, and the rightmost is application interface N-1. The interface indicator lights for each application interface from left to right are, for example, 0 to N-1, and the logical sequence numbers for each application interface from left to right are, for example, 0 to N-1. The interface indicator lights are used to inform the user which application interface in the main interface is currently displayed on the screen. The interface indicator lights can be hardware-based (e.g., different physical lights) or software-based (e.g., different display content on the screen). The logical sequence numbers are used to distinguish the various application interfaces that make up the main interface. The leftmost X-axis coordinate of the main interface is 0, the rightmost X-axis coordinate is N×W, the bottommost Y-axis coordinate is 0, and the topmost Y-axis coordinate is H, all in pixels.
[0005] The existing LVGL system framework does not support cyclic switching when implementing the main interface swiping transitions of the aforementioned electronic devices. Specifically, when application interface 0 is displayed on the screen, the user can only swipe left to switch to application interface 1 or other application interfaces on the right; if the user swipes right, application interface 0 remains stationary. When application interface N-1 is displayed on the screen, the user can only swipe right to switch to application interface N-2 or other application interfaces on the left; if the user swipes left, application interface N-1 remains stationary. Summary of the Invention
[0006] The technical problem to be solved by this invention is to develop a cyclic sliding switching method for the main interface of an electronic device based on the LVGL system framework.
[0007] To address the aforementioned technical problems, this invention proposes a method for cyclically switching the main interface based on LVGL, comprising the following steps: Step S1: Creating the main interface of the electronic device; the main interface is composed of N+2 application interfaces pieced together horizontally, where the leftmost application interface is a substitute for the second-to-last application interface from the right, and the rightmost application interface is a substitute for the second-to-last application interface from the left. Step S2: The touchscreen of the electronic device detects the user's left and right swiping gestures, and accordingly switches the display of a certain application interface of the main interface to the right or left on the screen; when the leftmost application interface is about to be displayed on the screen, the LVGL system framework replaces and displays it with the second-to-last application interface from the right; when the rightmost application interface is about to be displayed on the screen, the LVGL system framework replaces and displays it with the second-to-last application interface from the left.
[0008] Preferably, in step S1, the second application interface on the left is the application interface that is displayed by default on the screen of the electronic device as the main interface.
[0009] Further, in step S1, the method for creating the main interface is as follows: Assume the screen height of the electronic device is H pixels and the screen width is W pixels. Each application interface is a screen with a height of H pixels and a width of W pixels. First, the N application interfaces are spliced left and right to form a first canvas with a height of H pixels and a width of N×W pixels. From left to right, the first canvas contains application interfaces 0 to N-1. Then, the first canvas is expanded to the left and right sides by W pixels to form a second canvas with a height of H pixels and a width of (N+2)×W pixels. The rightmost application interface N-1 of the first canvas is copied and filled into the leftmost W-pixel wide expansion area of the second canvas. The leftmost application interface 0 of the first canvas is copied and filled into the rightmost W-pixel wide expansion area of the second canvas. The resulting second canvas serves as the main interface of the electronic device.
[0010] Furthermore, in step S1, the logical numbers of each application interface from left to right in the main interface are 0 to N+1, and the logical numbers are used to distinguish each application interface that constitutes the main interface.
[0011] Furthermore, in step S1, the interface indicator lights for each application interface from left to right in the main interface are N-1, 0 to N-1, 0 respectively. The interface indicator lights are used to inform the user which application interface in the main interface is currently displayed on the screen. When the main interface switches between N+2 application interfaces, the interface indicator lights only indicate that the switch is between N application interfaces.
[0012] Furthermore, in step S2, the touch screen of the electronic device detects the user's left and right swiping gestures. When the swiping gestures do not stop, the current application interface is displayed on the screen as it gradually moves off the screen and occupies a smaller and smaller proportion of the screen width, while the new application interface in the direction indicated by the swiping gesture gradually moves into the screen and occupies a larger and larger proportion of the screen width.
[0013] Furthermore, in step S2, when the swipe gesture stops, the proportion of the screen width occupied by the original application interface and the proportion of the screen width occupied by the new application interface are compared. The one with the larger proportion of the screen width occupied at this moment is used as the application interface to be displayed on the screen at this moment and displayed in full screen.
[0014] Further, in step S2, when the LVGL system framework detects that the second application interface from the left in the main interface is being displayed on the screen, and the touchscreen of the electronic device detects a rightward swipe gesture, and the LVGL system framework calculates based on this rightward swipe gesture that the leftmost application interface of the main interface needs to be displayed on the screen, the LVGL system framework displays the main interface moving to the right in an animated process; when the leftmost application interface of the main interface is about to completely occupy the screen, the LVGL system framework automatically replaces the leftmost application interface of the main interface with the second-to-last application interface from the right in the main interface for full-screen display. When the LVGL system framework detects that the second-to-last application interface from the right in the main interface is being displayed on the screen, and the touchscreen of the electronic device detects a leftward swipe gesture, and the LVGL system framework calculates based on this leftward swipe gesture that the rightmost application interface of the main interface needs to be displayed on the screen, the LVGL system framework displays the main interface moving to the left in an animated process; when the rightmost application interface of the main interface is about to completely occupy the screen, the LVGL system framework automatically replaces the rightmost application interface of the main interface with the second-to-left application interface of the main interface for full-screen display.
[0015] Further, in step S1, the leftmost X-axis coordinate of the main interface is -W, the rightmost X-axis coordinate is (N+1)×W, the bottommost Y-axis coordinate is 0, and the topmost Y-axis coordinate is H, all in pixels; the leftmost application interface's X-axis coordinate ranges from -W to 0, and the rightmost application interface's X-axis coordinate ranges from N×W to (N+1)×W; the remaining application interfaces' X-axis coordinates range from 0 to N×W. In step S2, replacing the leftmost application interface with the second-to-last application interface from the right is achieved by switching the main interface's X-coordinate. Specifically, the LVGL system framework moves the content displayed on the leftmost side of the screen from the position with X-coordinate of -W to the position with X-coordinate of (N-1)×W. Replacing the rightmost application interface with the second-to-last application interface from the left is also achieved by switching the main interface's X-coordinate. Specifically, the LVGL system framework moves the content displayed on the leftmost side of the screen from the position with X-coordinate of N×W to the position with X-coordinate of 0.
[0016] This invention also proposes a main interface cyclic sliding switching device based on LVGL, including a main interface creation unit and a switching implementation unit. The main interface creation unit is used to create the main interface of the electronic device; the main interface is composed of N+2 application interfaces pieced together horizontally, where the leftmost application interface is a substitute for the second-to-last application interface from the right, and the rightmost application interface is a substitute for the second-to-last application interface from the left. The switching implementation unit is used to detect the user's left and right swiping gestures on the touchscreen of the electronic device, and accordingly switch the display of a certain application interface of the main interface to the right or left on the screen; when the leftmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second-to-last application interface from the right and displays it; when the rightmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second-to-last application interface from the left and displays it.
[0017] The technical effect achieved by this invention is that, using the LVGL system framework, different application interfaces in the main interface can be swiped left and right on the screen of an electronic device to switch in a loop. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the main interface of an electronic device.
[0019] Figure 2 This is a flowchart illustrating the main interface cyclic sliding switching method based on LVGL proposed in this invention.
[0020] Figure 3 This is a schematic diagram of the main interface of the electronic device proposed in this invention.
[0021] Figure 4 This is a schematic diagram of the main interface cyclic sliding switching device based on LVGL proposed in this invention.
[0022] The attached diagrams are labeled as follows: Main interface creation unit 1, switching implementation unit 2. Detailed Implementation
[0023] Please see Figure 2 The main interface cyclic sliding switching method based on LVGL proposed in this invention includes the following steps.
[0024] Step S1: Create the main interface of the electronic device. The main interface is composed of N+2 application interfaces pieced together from left to right, with logical numbers ranging from 0 to N+1. These logical numbers distinguish the application interfaces that make up the main interface. The application interface with logical number 0 (leftmost) is a substitute (copy) of the application interface with logical number N (second to last from the right). The application interface with logical number N+1 (rightmost) is a substitute for the application interface with logical number 1 (second from the left). Preferably, the application interface with logical number 1 (second from the left) is the default application interface displayed on the screen of the electronic device, such as a clock interface.
[0025] An exemplary way to implement this step is as follows. Assume the screen height of the electronic device is H pixels and the screen width is W pixels. The main interface of the electronic device is required to contain N application interfaces, where N is a positive integer. Each application interface is a screen with a height of H pixels and a width of W pixels. First, the N application interfaces are joined side-by-side to form a first canvas with a height of H pixels and a width of N×W pixels. From left to right, the first canvas contains application interfaces 0 to N-1. Then, the first canvas is expanded to the left and right by W pixels to form a second canvas with a height of H pixels and a width of (N+2)×W pixels. The leftmost and rightmost W-pixel expanded areas of the second canvas are blank. The rightmost application interface N-1 from the first canvas is copied and filled into the leftmost W-pixel expanded area of the second canvas. The leftmost application interface 0 from the first canvas is copied and filled into the rightmost W-pixel expanded area of the second canvas. The resulting second canvas serves as the main interface of the electronic device.
[0026] Please see Figure 3 This is a schematic diagram of the main interface of the electronic device proposed in this invention. The main interface is a canvas with a height of H pixels and a width of (N+2)×W pixels. The leftmost element is a substitute for application interface N-1, and the rightmost element is a substitute for application interface 0. From the second element from the left to the second to last element from the right, they represent application interfaces 0 to N-1, respectively. Therefore, application interface 0 appears twice in the main interface, application interface N-1 appears twice in the main interface, and the other application interfaces appear only once. In other words, the main interface includes N non-repeating application interfaces and 2 repeating application interfaces.
[0027] Interface indicator lights are used to inform the user which application interface is currently displayed on the main interface. These indicator lights can be hardware or software-based. In the main interface of the electronic device proposed in this invention, the interface indicator lights for each application interface from left to right are N-1, 0 to N-1, 0, respectively. Therefore, when the main interface switches between N+2 application interfaces, the user perceives only a switch between N application interfaces. The application interface with logical number 0 (leftmost) is copied from the application interface with logical number N (second to last from the right). Both application interfaces have the same content (application interface N-1) and the same interface indicator light (N-1). The application interface with logical number N+1 (rightmost) is copied from the application interface with logical number 1 (second from the left). Both application interfaces have the same content (application interface 0) and the same interface indicator light (0).
[0028] As an example, the leftmost X-axis coordinate of the main interface is -W, the rightmost X-axis coordinate is (N+1)×W, the bottommost Y-axis coordinate is 0, and the topmost Y-axis coordinate is H, all in pixels. The X-axis coordinate of the application interface with logical number 0 (leftmost) ranges from -W to 0, and the X-axis coordinate of the application interface with logical number N+1 (rightmost) ranges from N×W to (N+1)×W. Excluding the first and last substitute application interfaces, the X-axis coordinates of the remaining application interfaces range from 0 to N×W. Figure 1 The main interface shown is consistent with that of existing electronic devices.
[0029] Step S2: The electronic device supports touchscreen detection of the user's left and right swipe gestures, and accordingly switches the display of a specific application interface on the main screen by swiping right or left. When the leftmost application interface is about to be displayed, the LVGL system framework replaces it with the second-to-last application interface from the right and displays it. When the rightmost application interface is about to be displayed, the LVGL system framework replaces it with the second-to-last application interface from the left and displays it. Thus, from the user's perspective, the user can continuously swipe left or right on the main interface of the electronic device to achieve a cyclical swipe.
[0030] In this step, the electronic device's touchscreen detects the user's left and right swipe gestures. While the swipe gesture continues, the current application interface gradually moves off-screen, occupying a smaller and smaller proportion of the screen width, while the new application interface in the direction indicated by the swipe gesture gradually moves onto the screen, occupying a larger and larger proportion of the screen width. The threshold is set to half the screen width. When the swipe gesture stops, the proportions of the original and new application interfaces are compared; the larger proportion is used for full-screen display.
[0031] For example, when the LVGL system framework detects that the application interface with logical index 1 (second from the left) is being displayed on the screen, and the touchscreen of the electronic device detects a right swipe gesture, and the LVGL system framework calculates that the application interface with logical index 0 (leftmost) needs to be displayed based on this gesture, the LVGL system framework animates the main interface moving to the right. That is, it animates the application interface moving out of the screen from the second from the left and the leftmost application interface moving into the screen from the right. Visually, the user gradually transitions from seeing the second from the left to seeing the leftmost application interface. When the leftmost application interface is about to completely occupy the screen, the LVGL system framework automatically replaces the application interface with logical index N (second to last from the right) for full-screen display. In other words, when the screen is about to display a substitute for application interface N-1, the LVGL system framework automatically replaces and displays application interface N-1 on the screen.
[0032] For example, when the LVGL system framework detects that the application interface with logical number N (second to last from the right) is being displayed on the screen, and the touchscreen of the electronic device detects a left swipe gesture, the LVGL system framework calculates that the application interface with logical number N+1 (far right) should be displayed on the screen based on this gesture. The LVGL system framework then animates the main interface moving to the left, that is, animates the application interface moving out of the screen from the second to last from the right, and the far right application interface moving into the screen from the left. Visually, the user gradually transitions from seeing the second to last application interface to seeing the far right application interface. When the far right application interface is about to completely occupy the screen, the LVGL system framework automatically replaces the application interface with logical number N+1 (far right) with the application interface with logical number 1 (second from the left) for full-screen display. In other words, when the screen is about to display a substitute for application interface 0, the LVGL system framework automatically replaces it with application interface 0 and displays it on the screen.
[0033] In step S2, replacing the leftmost application interface with the second-to-last application interface from the right is achieved, for example, by switching the X-coordinate of the main interface. The X-coordinate range of the leftmost application interface is -W to 0, while the X-coordinate range of the second-to-last application interface from the right is (N-1)×W to N×W. The LVGL system framework moves the content displayed on the leftmost side of the screen from the position with X-coordinate of -W in the main interface to the position with X-coordinate of (N-1)×W in the main interface, thus achieving the switch from the substitute of the full-screen application interface N-1 to the main full-screen application interface N-1.
[0034] Similarly, replacing the rightmost application interface with the second application interface from the left is also achieved by switching the X-coordinate of the main interface. The X-coordinate range of the rightmost application interface is N×W to (N+1)×W, while the X-coordinate range of the second application interface from the left is 0 to W. The LVGL system framework moves the content displayed on the far left of the screen from the position with X-coordinate N×W in the main interface to the position with X-coordinate 0 in the main interface, thus achieving the switch from the substitute of the full-screen application interface 0 to the main full-screen application interface 0.
[0035] Please see Figure 4 The main interface cyclic sliding switching device based on LVGL proposed in this invention includes a main interface creation unit 1 and a switching implementation unit 2. Figure 4 The device shown corresponds to Figure 2 The method shown.
[0036] The main interface creation unit 1 is used to create the main interface of the electronic device. The main interface is composed of N+2 application interfaces pieced together from left to right, with logical numbers ranging from 0 to N+1. The application interface with logical number 0 (leftmost) is a substitute (copy) of the application interface with logical number N (second to last from the right). The application interface with logical number N+1 (rightmost) is a substitute for the application interface with logical number 1 (second from the left).
[0037] The switching implementation unit 2 is used to detect the user's left or right swipe gestures on the touchscreen of the electronic device, and accordingly switch the display of a certain application interface of the main interface to the right or left on the screen. When the leftmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second-to-last application interface from the right and displays it. When the rightmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second-to-last application interface from the left and displays it.
[0038] This invention, based on the LVGL system framework, enables the main interface to cycle and switch on the screen of an electronic device. Users can continuously swipe left or right to cycle through various application interfaces, and there are interface indicator lights to display information about the application interfaces, enhancing the convenience for users to identify different application interfaces when swiping.
[0039] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for cyclic sliding switching of the main interface based on LVGL, characterized in that, Includes the following steps; Step S1: Create the main interface of the electronic device; the main interface is composed of N+2 application interfaces spliced together from left to right, the leftmost application interface is a substitute for the second to last application interface from the right, and the rightmost application interface is a substitute for the second application interface from the left. The method for creating the main interface is as follows: Assume the screen height of the electronic device is H pixels and the screen width is W pixels. Each application interface is a screen with a height of H pixels and a width of W pixels. First, the N application interfaces are stitched together left and right to form a first canvas with a height of H pixels and a width of N×W pixels. From left to right, the first canvas contains application interfaces 0 to N-1. Then, the first canvas is expanded to the left and right sides by W pixels to form a second canvas with a height of H pixels and a width of (N+2)×W pixels. The rightmost application interface N-1 of the first canvas is copied and filled into the leftmost W-pixel wide expansion area of the second canvas. The leftmost application interface 0 of the first canvas is copied and filled into the rightmost W-pixel wide expansion area of the second canvas. The resulting second canvas serves as the main interface of the electronic device. The leftmost X-axis coordinate of the main interface is -W, the rightmost X-axis coordinate is (N+1)×W, the bottommost Y-axis coordinate is 0, and the topmost Y-axis coordinate is H, all in pixels. The X-axis coordinate of the leftmost application interface is from -W to 0, and the X-axis coordinate of the rightmost application interface is from N×W to (N+1)×W. The X-axis coordinates of the other application interfaces range from 0 to N×W; Step S2: The touchscreen of the electronic device detects the user's left and right swipe gestures and switches the display of a certain application interface of the main interface to the right or left on the screen accordingly; when the leftmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second to last application interface from the right and displays it; when the rightmost application interface is about to be displayed on the screen, the LVGL system framework replaces it with the second to last application interface from the left and displays it. The second-to-last application interface on the right replaces the leftmost application interface by switching the X coordinate of the main interface. Specifically, the LVGL system framework moves the content displayed on the leftmost side of the screen from the position with an X coordinate of -W in the main interface to the position with an X coordinate of (N-1)×W in the main interface. Replacing the rightmost application interface with the second application interface from the left is also achieved by switching the X coordinate of the main interface. Specifically, the LVGL system framework moves the content displayed on the far left of the screen from the position with X coordinate N×W in the main interface to the position with X coordinate 0 in the main interface.
2. The LVGL-based main interface cyclic sliding switching method according to claim 1, characterized in that, In step S1, the second application interface on the left is the default application interface displayed on the screen of the electronic device as the main interface.
3. The LVGL-based main interface cyclic sliding switching method according to claim 1, characterized in that, In step S1, the logical numbers of each application interface from left to right in the main interface are 0 to N+1, and the logical numbers are used to distinguish the various application interfaces that make up the main interface.
4. The LVGL-based main interface cyclic sliding switching method according to claim 1, characterized in that, In step S1, the interface indicator lights for each application interface from left to right in the main interface are N-1, 0 to N-1, 0 respectively. The interface indicator lights are used to inform the user which application interface in the main interface is currently displayed on the screen. When the main interface switches between N+2 application interfaces, the interface indicator lights only indicate that the switch is between N application interfaces.
5. The LVGL-based main interface cyclic sliding switching method according to claim 1, characterized in that, In step S2, the touch screen of the electronic device detects the user's left and right swipe gestures. When the swipe gestures do not stop, the current application interface is displayed on the screen, gradually moving off the screen and occupying a smaller and smaller proportion of the screen width, while the new application interface in the direction indicated by the swipe gesture gradually moves into the screen and occupies a larger and larger proportion of the screen width.
6. The LVGL-based main interface cyclic sliding switching method according to claim 5, characterized in that, In step S2, when the swipe gesture stops, the proportion of the original application interface occupying the screen width and the proportion of the new application interface occupying the screen width are compared. The one with the larger proportion of the screen width at this time is used as the application interface to be displayed on the screen at this moment and displayed in full screen.
7. The LVGL-based main interface cyclic sliding switching method according to claim 1, characterized in that, In step S2, when the LVGL system framework detects that the second application interface from the left in the main interface is being displayed on the screen, and the touch screen of the electronic device detects a rightward swipe gesture, and the LVGL system framework calculates based on this rightward swipe gesture that the leftmost application interface in the main interface needs to be displayed on the screen, the LVGL system framework displays the main interface moving to the right in an animated process; when the leftmost application interface in the main interface is about to completely occupy the screen, the LVGL system framework automatically replaces the leftmost application interface in the main interface with the second-to-last application interface from the right in the main interface for full-screen display; When the LVGL system framework detects that the second-to-last application interface from the right in the main interface is being displayed on the screen, and the touch screen of the electronic device detects a leftward swipe gesture, and the LVGL system framework calculates based on this leftward swipe gesture that the rightmost application interface in the main interface needs to be displayed on the screen, the LVGL system framework displays the main interface moving to the left in an animated process; when the rightmost application interface in the main interface is about to completely occupy the screen, the LVGL system framework automatically replaces the rightmost application interface in the main interface with the second-to-last application interface from the left in the main interface for full-screen display.
8. A main interface looping and sliding switching device based on LVGL, characterized in that, Includes a main interface creation unit and a switching implementation unit; The main interface creation unit is used to create the main interface of the electronic device. The main interface is composed of N+2 application interfaces pieced together horizontally. The leftmost application interface is a substitute for the second-to-last application interface from the right, and the rightmost application interface is a substitute for the second-to-last application interface from the left. The creation process of the main interface is as follows: Assuming the screen height of the electronic device is H pixels and the screen width is W pixels, each application interface is a screen with a height of H pixels and a width of W pixels. First, the N application interfaces are pieced together horizontally to form a first canvas with a height of H pixels and a width of N×W pixels. From left to right, the first canvas contains application interfaces 0 to N-1. Then... Expand the first canvas to the left and right by W pixels each to form a second canvas with a height of H pixels and a width of (N+2)×W pixels. Copy the rightmost application interface N-1 from the first canvas and fill it into the leftmost W-pixel-width expansion area of the second canvas. Copy the leftmost application interface 0 from the first canvas and fill it into the rightmost W-pixel-width expansion area of the second canvas. The resulting second canvas serves as the main interface of the electronic device. The leftmost X-axis coordinate of the main interface is -W, the rightmost X-axis coordinate is (N+1)×W, the bottom Y-axis coordinate is 0, and the top Y-axis coordinate is H, all in pixels. The X-axis coordinate of the leftmost application interface is from -W to 0, and the X-axis coordinate of the rightmost application interface is from N×W to (N+1)×W. The X-axis coordinates of the other application interfaces range from 0 to N×W; The switching implementation unit is used to detect the user's left and right swipe gestures on the touch screen of the electronic device, and accordingly switch the display of a certain application interface of the main interface to the right or left on the screen. When the leftmost application interface is about to be displayed on the screen, the LVGL system framework replaces and displays the second-to-last application interface from the right. When the rightmost application interface is about to be displayed on the screen, the LVGL system framework replaces and displays the second-to-last application interface from the left. Replacing the leftmost application interface with the second-to-last application interface from the right is achieved by switching the X coordinate of the main interface. Specifically, the LVGL system framework moves the content displayed on the leftmost side of the screen from the position with X coordinate -W in the main interface to the position with X coordinate (N-1)×W in the main interface. Replacing the rightmost application interface with the second-to-last application interface from the left is also achieved by switching the X coordinate of the main interface. Specifically, the LVGL system framework moves the content displayed on the leftmost side of the screen from the position with X coordinate N×W in the main interface to the position with X coordinate 0 in the main interface.
Citation Information
Patent Citations
Multi-interface animation switching method for same region
CN104636141A
Electronic device and method of browsing images in a loop
US20110134149A1
