CN114860137B - Left-right circular sliding method, device, equipment and medium of lvgl interface - Google Patents

Left-right circular sliding method, device, equipment and medium of lvgl interface Download PDF

Info

Publication number
CN114860137B
CN114860137B CN202210270120.8A CN202210270120A CN114860137B CN 114860137 B CN114860137 B CN 114860137B CN 202210270120 A CN202210270120 A CN 202210270120A CN 114860137 B CN114860137 B CN 114860137B
Authority
CN
China
Prior art keywords
index
value
tab
interface
sliding
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202210270120.8A
Other languages
Chinese (zh)
Other versions
CN114860137A (en
Inventor
林智铃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hengonda Technology Co ltd
Original Assignee
Hengonda Technology Co ltd
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 Hengonda Technology Co ltd filed Critical Hengonda Technology Co ltd
Priority to CN202210270120.8A priority Critical patent/CN114860137B/en
Publication of CN114860137A publication Critical patent/CN114860137A/en
Application granted granted Critical
Publication of CN114860137B publication Critical patent/CN114860137B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • 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/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a left-right circular sliding method, a device, equipment and a medium for an lvgl interface, which realize circular sliding by using a callback mechanism of the lvgl interface, and make up the defect that the existing lvgl interface cannot realize circular sliding; and setting tab objects corresponding to the minimum value and the maximum value of the index ID to be empty, and only obtaining the index ID value corresponding to the tab object of the interface before and after the sliding without judging the sliding direction in the interface sliding treatment process, judging whether the tab object slides to the empty tab object by judging whether the index ID is the minimum value or the maximum value, if so, performing left-right circular sliding treatment, thereby realizing left-right circular sliding of the lvgl interface by a polar-simple scheme.

Description

Left-right circular sliding method, device, equipment and medium of lvgl interface
Technical Field
The invention relates to the technical field of computers, in particular to a left-right circulation sliding method, a device, equipment and a medium of an lvgl interface.
Background
The interface of the electronic equipment gui of the current embedded system is provided with a high-end and a low-end, and the high-end mainly comprises a system frame of android and a qt frame of linux; the main low-end is minigui (an open source Linux graphical user interface support system created by beijing fei-mi software technology limited), touchgfx, ucwin, etc. Some are only aimed at individual chips due to the need of open sources, and the development efficiency of the PC-free simulator is low.
Lvgl (Light and VersatileGraphics Library, light comprehensive graphic interface library) is a novel GUI (Graphical User Interface, GUI for short, also called graphic user interface) with small code quantity and easy transplanting and development, supports a touch screen, adopts an event callback mechanism to process events, has a simulator at a pc end, can be developed under a linux, mac and windows system, and can complete transplanting work under the conditions of 80KB flash memory and 12KB RAM; and has the advantage of being transplanted into an embedded system and occupying less system resources.
The electronic student certificate is that a chip is arranged on the basis of a common student certificate, the photos, names, ages, entrance time and the like of students are recorded in the electronic student certificate, and the electronic student certificate comprises a GPS positioning system module. The electronic student identity card has the education functions of entrance guard management, home school interconnection, book borrowing, campus consumption and the like of students entering and exiting the school, and the urban functions of taking buses, scenic spot traveling, medical safety, community service and the like.
The Lvgl is applied to chips in the fields of electronic student certificates and the like, so that the electronic student certificates can support the touch screen function, necessary information is displayed through a screen, and if more information needs to be displayed, paging display can be realized through a page turning function.
However, the conventional Lvgl interface only supports a left-right sliding function, and cannot realize a circular sliding function. For example, in 20210831, chinese invention publication No. CN113325975a discloses a user interface switching method and apparatus based on LVGL, including: step S21: setting up the upper and lower position relation among a plurality of canvases, and establishing a plurality of interfaces on each canvas, wherein the size of each interface is equal to the size of a screen. Step S22: when the touch control main body contacts the touch control screen of the electronic equipment, the X-axis and Y-axis coordinates of the contact position are recorded as initial positions. Step S23: when the touch main body always contacts the touch screen and slides, the X-axis coordinate and the Y-axis coordinate of the contact position of the touch main body and the touch screen are recorded in real time, and whether the touch main body slides leftwards, rightwards, upwards or downwards is judged; the X-axis coordinate of the canvas moves in the same direction along with the left-right sliding direction of the touch main body; the canvas is switched to move in the same direction along with the up-and-down sliding direction of the touch main body. Step S24: when the touch main body leaves the touch screen, an interface finally displayed on the screen is determined. However, the invention realizes the left-right sliding and up-down sliding switching of the user interface in the LVGL system frame, can not realize the circular sliding function of the interface, has too complex realization mode, and needs to update the whole program to refresh the program when the display effect needs to be modified, thereby not only having low efficiency, but also influencing the service life of flash.
Disclosure of Invention
The invention aims to solve the technical problem of providing a left-right circulation sliding method and device for an lvgl interface, which can realize circulation sliding of the lvgl interface without judging the sliding direction, thereby greatly reducing the realization complexity.
In a first aspect, the present invention provides a left-right circular sliding method for an lvgl interface, including an object creation process, a callback mechanism setting process, and an interface sliding processing process:
the object creation process includes: creating a tabview object on a screen; creating at least one tab object to be displayed in a business process on the tab view object, establishing an index ID of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
the callback mechanism setting process comprises the following steps: setting an event callback mechanism of a control on the tab view object, and setting an initial index ID value, wherein the initial index ID value is one of index ID values corresponding to a non-empty tab object;
the interface sliding treatment process comprises the following steps: triggering an index ID value change event of a tab object of the current interface after the interface is successfully slid; the callback event entering the Tabview object acquires the changed index ID value, judges the changed index ID value, processes the changed index ID value according to the judging result, exits the callback event of the Tabview object after processing, and displays the interface of the tab object corresponding to the processed index ID value:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
In a second aspect, the present invention provides a left-right circulation sliding device of an lvgl interface, including:
an object creation module for creating a tabview object on a screen; creating at least one tab object to be displayed in a business process on the tab view object, establishing an index ID of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
the callback mechanism setting module is used for setting an event callback mechanism of a control for the tab view object, and setting an initial index ID value which is one of index ID values corresponding to the non-empty tab object;
the interface sliding processing module is used for triggering an index ID value change event of a tab object of the current interface after the interface is successfully slid; the callback event entering the Tabview object acquires the changed index ID value, judges the changed index ID value, processes the changed index ID value according to the judging result, exits the callback event of the Tabview object after processing, and displays the interface of the tab object corresponding to the processed index ID value:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
In a third aspect, the invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect when executing the program.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention at least have the following technical effects or advantages: the invention realizes the circular sliding by utilizing the callback mechanism of the lvgl interface, overcomes the defect that the conventional lvgl interface cannot realize the circular sliding, does not need to judge the sliding direction in the interface sliding treatment process, only needs to obtain the index ID value corresponding to the tab object of the interface before and after the sliding, and can realize the left and right circular sliding of the interface by judging whether the index ID is the minimum value or the maximum value and then carrying out corresponding treatment.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
The invention will be further described with reference to examples of embodiments with reference to the accompanying drawings.
FIG. 1 is a general flow chart of a method according to a first embodiment of the invention;
FIG. 2 is a flow chart of an object creation process in a method according to a first embodiment of the invention;
FIG. 3 is a flowchart illustrating an interface sliding process in a method according to a first embodiment of the present invention;
FIG. 4 is a schematic diagram of interface cycle switching status in a left-hand slide embodiment of the present invention;
FIG. 5 is a schematic diagram of interface cycle switching status in a right-hand slide embodiment of the present invention;
FIG. 6 is a schematic diagram of an interface normal switching state according to a left-sliding embodiment of the present invention;
FIG. 7 is a schematic diagram of a device according to a second embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device in a third embodiment of the present invention;
fig. 9 is a schematic structural diagram of a medium in a fourth embodiment of the present invention.
Detailed Description
According to the left-right circular sliding method and device for the lvgl interface, the circular sliding of the lvgl interface can be realized based on the configuration of a user, the circular sliding of the lvgl interface can be realized, the sliding is personalized, and the later modification of the display effect is simpler and easier.
According to the technical scheme in the embodiment of the application, the overall thought is as follows: the callback mechanism of the lvgl interface is utilized to realize the circular sliding, so that the defect that the conventional lvgl interface cannot realize the circular sliding is overcome; and setting tab objects corresponding to the minimum value and the maximum value of the index ID to be empty, and only obtaining the index ID value corresponding to the tab object of the interface before and after the sliding without judging the sliding direction in the interface sliding treatment process.
Example 1
As shown in fig. 1, the present embodiment provides a left-right loop sliding method of an lvgl interface, which includes an object creation process, a callback mechanism setting process, and an interface sliding processing process:
the object creation process includes: creating a tabview object on a screen; creating at least one tab object to be displayed in the business process on the tab view object, establishing an index ID (which can be marked as a TABID) of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
as shown in fig. 2, in the specific creation, a tab view object is created on a screen, the size of the tab view is set to be the screen size, a plurality of tab objects are sequentially added to the tab view object, the size of the tab object is less than or equal to the tab view, IDs of the tab objects can be generally sequenced from zero, the plurality of tab objects are sequentially tab0, tab1, …, tab n, and the like, then 0 is the minimum value of the index ID, n is the maximum value of the index ID, tab0 and tab n are set to be empty, and the remaining tab objects are not empty; creating an img object and a label object to be displayed on tab1, loading image source information to be displayed by the img object, setting position information of the img object according to the image source information, and setting fonts, formats, word sizes, display positions and the like corresponding to the label. After the Tab1 is set, tab2, tab3 and subsequent tabs are all set with configuration information according to the Tab1 method.
The callback mechanism setting process comprises the following steps: the sliding enabling function of the tabview is opened, an event callback mechanism of a control is set for the tabview object, an initial index ID value is set, the initial index ID value is one of index ID values corresponding to non-empty tab objects, namely any one of all non-empty tab objects, but the index ID value corresponding to the first non-empty tab object is usually the index ID value, namely the ID is 1, and the corresponding tab object is tab1.
As shown in fig. 3, the interface sliding process includes: triggering an index ID value change event of a tab object of the current interface after the interface is successfully slid; the callback event entering the Tabview object acquires and judges the changed index ID value (namely the changed current index ID value), the following three conditions are processed according to the judging result, the callback event of the Tabview object is exited after the processing, the interface of the tab object corresponding to the processed index ID value is displayed, and the callback event of the Tabview object is exited after the processing:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
The index ID value change event is specifically: and acquiring index ID values of tab objects of the interface before and after sliding, and replacing the index ID values of tab objects of the interface after sliding with the index ID values of tab objects of the interface after sliding.
For example: in the object creation process, 10 tab objects are created in total, respectively denoted as tab0, tab1, …, tab9, the minimum value of tab id is 0, the maximum value is 9, tab0 and tab9 are set to null, and the initial value of tab id=1 is set.
As shown in fig. 4, the current tab ID value=1, the current interface is the interface corresponding to tab1 (see the first line of fig. 4), after the right sliding is successful, the tab ID value change event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is changed to 0 (see the second line of fig. 4), the callback event entering the tab view object obtains the changed tab ID value 0 and judges, because the judging result is the minimum tab ID value, tab0 is empty, tab0 is not displayed, but the tab ID value is set to the tab ID value 8 corresponding to the last non-empty tab object as the tab ID value corresponding to the next interface, so that the tab ID value corresponding to tab8 of the current interface is switched (see the third line of fig. 4), and the left circular sliding is realized;
as shown in fig. 5, the current tab ID value=8, the current interface is the interface corresponding to tab8 (see the first line of fig. 5), after the left-hand sliding is successful, an index ID value changing event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is changed to 9 (see the second line of fig. 5), the callback event entering the tab view object obtains the changed index ID value 9 and judges, because the judging result is the maximum tab ID value, tab9 is empty, tab9 is not displayed, but the index ID value is set to be the index ID value 1 corresponding to the first non-empty tab object, so as to be used as the tab ID value corresponding to the next interface, and the interface corresponding to tab1 of the current interface is switched (see the third line of fig. 5), thereby realizing the left-hand circular sliding;
as shown in fig. 6, the current tab ID value=1, the current interface is the interface corresponding to tab1 (see the first line of fig. 5), after the left-hand sliding is successful, the tab ID value modification event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is modified to 2 (see the second line of fig. 5), the callback event entering the tab view object obtains the modified tab ID value 2 and judges, and because the judging result is neither the maximum value nor the minimum value, the tab view event is processed, the modified tab ID value is kept unchanged, and the tab ID value is directly used as the tab ID value corresponding to the next interface.
In this embodiment, when the callback event entering the Tabview object acquires the changed index ID value, it is further confirmed whether the index ID value change is successful: obtaining index ID values of tab objects of the interface before and after sliding, comparing to see whether the tab objects are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the successful change is confirmed, and the follow-up action is continued.
The method is applied to the electronic student identity card. The method of the embodiment can be applied to the electronic student identity card, so that the interface of the electronic student identity card can be realized through lvgl, and the cyclic sliding of each interface in the business process can be realized.
Based on the same inventive concept, the present application also provides a device corresponding to the method in the first embodiment, and details of the second embodiment are described in the following.
Example two
As shown in fig. 7, in this embodiment, a left-right loop sliding device of an lvgl interface is provided, which includes an object creation module, a callback mechanism setting module, and an interface sliding processing module.
The object creation module is used for creating a tabview object on a screen; creating at least one tab object to be displayed in a business process on the tab view object, establishing an index ID of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
as shown in fig. 2, in the specific creation, a tab view object is created on a screen, the size of the tab view is set to be the screen size, a plurality of tab objects are sequentially added to the tab view object, the size of the tab object is less than or equal to the tab view, IDs of the tab objects can be generally sequenced from zero, the plurality of tab objects are sequentially tab0, tab1, …, tab n, and the like, then 0 is the minimum value of the index ID, n is the maximum value of the index ID, tab0 and tab n are set to be empty, and the remaining tab objects are not empty; an img object and a label object to be displayed are created on tab1, the img object loads and sets image source information corresponding to the image to be displayed, the img object position information is set, and fonts, formats, word sizes, display positions and the like corresponding to labels are set. After the Tab1 is set, tab2, tab3 and subsequent tabs are all set with configuration information according to the Tab1 method.
The callback mechanism setting module is used for setting an event callback mechanism of a control for the tab view object, and setting an initial index ID value, wherein the initial index ID value is one of index ID values corresponding to a non-empty tab object; i.e. any one of all non-empty tab objects, but typically the index ID value corresponding to the first non-empty tab object, i.e. ID 1, corresponds to tab object tab1.
As shown in fig. 3, the interface sliding processing module is configured to trigger an index ID value change event of a tab object of a current interface after the interface is successfully slid; the callback event entering the Tabview object acquires the changed index ID value, judges the changed index ID value, processes the changed index ID value according to the judging result, exits the callback event of the Tabview object after processing, and displays the interface of the tab object corresponding to the processed index ID value:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
For example: in the object creation process, 10 tab objects are created in total, respectively denoted as tab0, tab1, …, tab9, the minimum value of tab id is 0, the maximum value is 9, tab0 and tab9 are set to null, and the initial value of tab id=1 is set.
As shown in fig. 4, the current tab ID value=1, the current interface is the interface corresponding to tab1 (see the first line of fig. 4), after the right sliding is successful, an index ID value changing event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is changed to 0 (see the second line of fig. 4), the callback event entering the tab view object obtains the changed index ID value 0 and judges, because the judging result is the minimum tab ID value, tab0 is empty, tab0 is not displayed, and instead, the index ID value is set to be the index ID value 8 (8=9-1) corresponding to the last non-empty tab object, so as to switch the tab ID value corresponding to the current interface to the tab8 (see the third line of fig. 4), thereby realizing left circular sliding;
as shown in fig. 5, the current tab ID value=8, the current interface is the interface corresponding to tab8 (see the first line of fig. 5), after the left-hand sliding is successful, an index ID value changing event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is changed to 9 (see the second line of fig. 5), the callback event entering the tab view object obtains the changed index ID value 9 and judges, because the judging result is the maximum tab ID value, tab9 is empty, tab9 is not displayed, but the index ID value is set to be the index ID value 1 corresponding to the first non-empty tab object, so as to be used as the tab ID value corresponding to the next interface, and the interface corresponding to tab1 of the current interface is switched (see the third line of fig. 5), thereby realizing the left-hand circular sliding; as shown in fig. 6, the current tab ID value=1, the current interface is the interface corresponding to tab1 (see the first line of fig. 5), after the left-hand sliding is successful, the tab ID value modification event of the tab object of the current interface is triggered, the tab ID value corresponding to the next interface is modified to 2 (see the second line of fig. 5), the callback event entering the tab view object obtains the modified tab ID value 2 and judges, and because the judging result is neither the maximum value nor the minimum value, the tab view event is processed, the modified tab ID value is kept unchanged, and the tab ID value is directly used as the tab ID value corresponding to the next interface.
In this embodiment, the index ID value change event is specifically: and acquiring index ID values of tab objects of the interface before and after sliding, and replacing the index ID values of tab objects of the interface after sliding with the index ID values of tab objects of the interface after sliding.
In this embodiment, when the callback event entering the Tabview object acquires the changed index ID value, it is further confirmed whether the index ID value change is successful: obtaining index ID values of tab objects of the interface before and after sliding, comparing to see whether the tab objects are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the successful change is confirmed, and the follow-up action is continued.
The device is applied to the electronic student identity card. Therefore, the interface of the electronic student certificate can be realized through the lvgl, the circulating sliding of each interface in the business process can be realized, the sliding can be more personalized, and the later modification of the display effect is simpler and easier to implement.
Since the device described in the second embodiment of the present invention is a device for implementing the method described in the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the device, and thus the detailed description thereof is omitted herein. All devices used in the method according to the first embodiment of the present invention are within the scope of the present invention.
Example III
The present embodiment provides an electronic device, as shown in fig. 8, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where any implementation of the first embodiment may be implemented when the processor executes the computer program.
Since the electronic device described in this embodiment is a device for implementing the method described in the first embodiment of the present application, those skilled in the art will be able to understand the specific implementation of the electronic device and various modifications thereof based on the method described in the first embodiment of the present application, so how the method described in the embodiment of the present application is implemented in this electronic device will not be described in detail herein. The apparatus used to implement the methods of the embodiments of the present application are within the scope of what is intended to be protected by the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the first embodiment, and the details of the fourth embodiment are described in detail.
Example IV
The present embodiment provides a computer readable storage medium, as shown in fig. 9, on which a computer program is stored, which when executed by a processor, can implement any implementation of the first embodiment.
The technical scheme provided in the embodiment of the application has at least the following technical effects or advantages: the invention realizes the circular sliding by utilizing the callback mechanism of the lvgl interface, overcomes the defect that the conventional lvgl interface cannot realize the circular sliding, does not need to judge the sliding direction in the interface sliding treatment process, only needs to obtain the index ID value corresponding to the tab object of the interface before and after the sliding, and can realize the left and right circular sliding of the interface by judging whether the index ID is the minimum value or the maximum value and then carrying out corresponding treatment.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus or system, or a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that the specific embodiments described are illustrative only and not intended to limit the scope of the invention, and that equivalent modifications and variations of the invention in light of the spirit of the invention will be covered by the claims of the present invention.

Claims (10)

1. A left-right circular sliding method of an lvgl interface is characterized in that: the method comprises an object creation process, a callback mechanism setting process and an interface sliding processing process:
the object creation process includes: creating a tabview object on a screen; creating at least one tab object to be displayed in a business process on the tab view object, establishing an index ID of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
the callback mechanism setting process comprises the following steps: setting an event callback mechanism of a control on the tab view object, and setting an initial index ID value, wherein the initial index ID value is one of index ID values corresponding to a non-empty tab object;
the interface sliding treatment process comprises the following steps: triggering an index ID value change event of a tab object of the current interface after the interface is successfully slid; the callback event entering the tabview object acquires the changed index ID value, judges the changed index ID value, processes the changed index ID value according to the judging result, exits the callback event of the tabview object after processing, and displays the interface of the tab object corresponding to the processed index ID value:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
2. The left-right cyclic sliding method of an lvgl interface of claim 1, wherein: the index ID value change event is specifically: and acquiring index ID values of tab objects of the interface before and after sliding, and replacing the index ID values of tab objects of the interface after sliding with the index ID values of tab objects of the interface after sliding.
3. The left-right cyclic sliding method of an lvgl interface of claim 1, wherein: when a callback event entering the tabview object acquires the changed index ID value, whether the index ID value change is successful or not is also confirmed: obtaining index ID values of tab objects of the interface before and after sliding, comparing to see whether the tab objects are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the successful change is confirmed, and the follow-up action is continued.
4. The left-right cyclic sliding method of an lvgl interface of claim 1, wherein: the method is applied to the electronic student identity card.
5. A left-right circulation sliding device of an lvgl interface, which is characterized in that: comprising the following steps:
an object creation module for creating a tabview object on a screen; creating at least one tab object to be displayed in a business process on the tab view object, establishing an index ID of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID to be empty; creating an img object and a label text object to be displayed on each non-empty tab object, and determining corresponding image information; opening a sliding function of the tabview object;
the callback mechanism setting module is used for setting an event callback mechanism of a control for the tab view object, and setting an initial index ID value which is one of index ID values corresponding to the non-empty tab object;
the interface sliding processing module is used for triggering an index ID value change event of a tab object of the current interface after the interface is successfully slid; the callback event entering the tabview object acquires the changed index ID value, judges the changed index ID value, processes the changed index ID value according to the judging result, exits the callback event of the tabview object after processing, and displays the interface of the tab object corresponding to the processed index ID value:
if the changed index ID value is the minimum value, setting the index ID value as the index ID value corresponding to the last non-empty tab object;
if the changed index ID value is the maximum value, setting the index ID value as the index ID value corresponding to the first non-empty tab object;
if the modified index ID value is neither a maximum nor a minimum, then the modified index ID value is maintained.
6. The left-right cycling sliding device of the lvgl interface of claim 5, wherein: the index ID value change event is specifically: and acquiring index ID values of tab objects of the interface before and after sliding, and replacing the index ID values of tab objects of the interface after sliding with the index ID values of tab objects of the interface after sliding.
7. The left-right cycling sliding device of the lvgl interface of claim 5, wherein: when a callback event entering the tabview object acquires the changed index ID value, whether the index ID value change is successful or not is also confirmed: obtaining index ID values of tab objects of the interface before and after sliding, comparing to see whether the tab objects are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the successful change is confirmed, and the follow-up action is continued.
8. The left-right cycling sliding device of the lvgl interface of claim 6, wherein: the device is applied to the electronic student identity card.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 3 when the program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1 to 3.
CN202210270120.8A 2022-03-18 2022-03-18 Left-right circular sliding method, device, equipment and medium of lvgl interface Active CN114860137B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210270120.8A CN114860137B (en) 2022-03-18 2022-03-18 Left-right circular sliding method, device, equipment and medium of lvgl interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210270120.8A CN114860137B (en) 2022-03-18 2022-03-18 Left-right circular sliding method, device, equipment and medium of lvgl interface

Publications (2)

Publication Number Publication Date
CN114860137A CN114860137A (en) 2022-08-05
CN114860137B true CN114860137B (en) 2023-06-27

Family

ID=82627497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210270120.8A Active CN114860137B (en) 2022-03-18 2022-03-18 Left-right circular sliding method, device, equipment and medium of lvgl interface

Country Status (1)

Country Link
CN (1) CN114860137B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117611A (en) * 2009-12-31 2011-07-06 鸿富锦精密工业(深圳)有限公司 Method for realizing circular display of pictures in electronic device
CN102609168A (en) * 2011-01-25 2012-07-25 联想(北京)有限公司 Processing method for application object and electronic device
CN103914205A (en) * 2013-01-09 2014-07-09 腾讯科技(深圳)有限公司 File thumbnail display method and device for intelligent terminal
CN106126048A (en) * 2016-06-13 2016-11-16 青岛海信移动通信技术股份有限公司 The querying method of the associated person information of a kind of mobile device and device
CN112286455A (en) * 2020-10-27 2021-01-29 苏州浪潮智能科技有限公司 Remote copying method, device, electronic equipment and medium
CN114119340A (en) * 2021-10-18 2022-03-01 翱捷科技股份有限公司 Method and device for managing activities of application based on LVGL
WO2022042768A1 (en) * 2020-08-24 2022-03-03 荣耀终端有限公司 Index display method, electronic device, and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117611A (en) * 2009-12-31 2011-07-06 鸿富锦精密工业(深圳)有限公司 Method for realizing circular display of pictures in electronic device
CN102609168A (en) * 2011-01-25 2012-07-25 联想(北京)有限公司 Processing method for application object and electronic device
CN103914205A (en) * 2013-01-09 2014-07-09 腾讯科技(深圳)有限公司 File thumbnail display method and device for intelligent terminal
CN106126048A (en) * 2016-06-13 2016-11-16 青岛海信移动通信技术股份有限公司 The querying method of the associated person information of a kind of mobile device and device
WO2022042768A1 (en) * 2020-08-24 2022-03-03 荣耀终端有限公司 Index display method, electronic device, and computer readable storage medium
CN112286455A (en) * 2020-10-27 2021-01-29 苏州浪潮智能科技有限公司 Remote copying method, device, electronic equipment and medium
CN114119340A (en) * 2021-10-18 2022-03-01 翱捷科技股份有限公司 Method and device for managing activities of application based on LVGL

Also Published As

Publication number Publication date
CN114860137A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN107404428B (en) Service method and device based on chat group and electronic equipment
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
US11977719B2 (en) Mode setting method and device of monitoring system
CN103778128B (en) The method for drafting and device of a kind of list information
CN106648775B (en) Double-opening switching method and system of application program and terminal equipment
CN111880879B (en) Playing method, device, equipment and storage medium of dynamic wallpaper
CN111796821A (en) Page updating method and device
US20230351145A1 (en) Pipelining and parallelizing graph execution method for neural network model computation and apparatus thereof
CN106028172A (en) Audio/video processing method and device
CN111228816A (en) Scene layout method and device in game
CN109558173A (en) For switching the method, apparatus and system of login mode on interface
CN114860137B (en) Left-right circular sliding method, device, equipment and medium of lvgl interface
CN106855772A (en) A kind of information displaying method and device
CN110443772A (en) Image processing method, device, computer equipment and storage medium
CN106796531A (en) The management method of kernel setup information, device and electronic equipment
CN112637687B (en) Video playback method and device based on embedded point behaviors, computer equipment and medium
CN111158840B (en) Image carousel method and device
CN109254647A (en) Take down notes processing method and processing device
CN110018866B (en) User interface theme updating method, device and system, vehicle machine and vehicle
CN111736942A (en) Multi-application scene display method and device in VR system and VR equipment
CN114816719B (en) Training method and device of multi-task model
CN114860140B (en) Configuration-based lvgl interface cyclic sliding method and device
CN108401455B (en) Multi-system control method, control device and mobile terminal
CN111368234A (en) Window adjusting method, device and storage medium
CN111599449B (en) Automatic playing method, device and equipment of electronic image and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant