CN114860137A - Left-right circulating sliding method, device, equipment and medium for lvgl interface - Google Patents

Left-right circulating sliding method, device, equipment and medium for lvgl interface Download PDF

Info

Publication number
CN114860137A
CN114860137A CN202210270120.8A CN202210270120A CN114860137A CN 114860137 A CN114860137 A CN 114860137A CN 202210270120 A CN202210270120 A CN 202210270120A CN 114860137 A CN114860137 A CN 114860137A
Authority
CN
China
Prior art keywords
index
value
interface
tab
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.)
Granted
Application number
CN202210270120.8A
Other languages
Chinese (zh)
Other versions
CN114860137B (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 of an lvgl interface, which realize circular sliding by utilizing a callback mechanism of the lvgl interface and make up for the defect that the current lvgl interface can not realize circular sliding; and setting tab objects corresponding to the minimum value and the maximum value of the index ID to be empty, judging the sliding direction in the interface sliding processing process without judging the sliding direction, only obtaining the index ID values corresponding to the interface tab objects before and after sliding, judging whether the tab objects slide to the empty tab objects or not by judging whether the index ID is the minimum value or the maximum value, and if so, performing left-right circular sliding processing, thereby realizing left-right circular sliding of the lvgl interface through a simple scheme.

Description

Left-right circulating sliding method, device, equipment and medium for lvgl interface
Technical Field
The invention relates to the technical field of computers, in particular to a left-right circular sliding method, device, equipment and medium for an lvgl interface.
Background
The current electronic equipment gui interface of the embedded system has a high-end and a low-end, wherein the high-end mainly comprises an android system framework and a linux qt framework; the low end mainly comprises miniui (an open source Linux graphic user interface support system created by Beijing Fei Diffuse software technology Co., Ltd.), touchgfx, ucwin and the like. Some are only directed to individual chips due to the need for an open source, and the development efficiency of the simulator without the PC end is low.
Lvgl (Light and Versatile graphics Library, Mild Integrated graphics Library) is a novel GUI (Graphical User Interface, GUI for short), has small code quantity and easy transplantation and development, supports a touch screen, adopts an event callback mechanism to process events, has a simulator with a pc end, can be developed under linux, mac and windows systems, and can complete the transplantation work under the conditions of an 80KB flash memory and a 12KB RAM; and has the advantage of being transplanted into an embedded system and occupying fewer system resources.
The electronic student certificate is characterized in that a chip is installed on the basis of a common student certificate, a student photo, a name, an age, an admission time and the like are recorded, and a GPS module is included. The electronic student card has various education functions of access control management, home-school interconnection, book borrowing, campus consumption and the like of students going in and out of schools, and various urban functions of bus taking, scenic spot tourism, 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 can be displayed through a screen, and paging display can be realized through a page turning function if more information needs to be displayed.
However, the current Lvgl interface only supports the function of sliding left and right, and cannot realize the function of circular sliding. For example, chinese invention CN113325975A, published under 20210831, discloses a method and an apparatus for switching user interfaces based on LVGL, including: step S21: setting up the up-down position relation between a plurality of canvases, establishing a plurality of interfaces on each canvas, wherein the size of each interface is equal to that of the screen. Step S22: when a touch main body touches a touch screen of the electronic equipment, recording X-axis and Y-axis coordinates of a contact position as an initial position. Step S23: when the touch main body is always in contact with the touch screen and slides, recording X-axis and Y-axis coordinates of the contact position of the touch main body and the touch screen in real time, and judging whether the touch main body slides leftwards, rightwards, upwards or downwards; 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: and when the touch main body leaves the touch screen, determining the interface finally displayed on the screen. However, in the LVGL system framework, the switching of the user interface between the left-right sliding and the up-down sliding is realized, the circular sliding function of the interface cannot be realized, the realization mode is too complex, when the display effect needs to be modified, the whole program needs to be updated to refresh the program, the efficiency is low, and the service life of the flash is influenced.
Disclosure of Invention
The invention aims to solve the technical problem of providing a left-right circular sliding method and device for an lvgl interface, which can realize the circular sliding of the lvgl interface, do not need to judge the sliding direction and greatly reduce the complexity of realization.
In a first aspect, the present invention provides a left-right loop sliding method for an lvgl interface, which includes an object creating 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 required to be displayed by 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 as null; 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 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 non-empty tab objects;
the interface sliding processing process comprises the following steps: triggering an index ID value change event of a tab object of the current interface after the interface slides successfully; the callback event entering the Tabview object acquires and judges the modified index ID value, processes the following three conditions according to the judgment result, processes the callback event exiting the Tabview object, 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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
In a second aspect, the present invention provides a left-right cycle sliding apparatus for an lvgl interface, comprising:
the object creating module is used for creating a tabview object on a screen; creating at least one tab object required to be displayed by 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 as null; 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 the 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 non-empty tab objects;
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 sliding is successful; the callback event entering the Tabview object acquires and judges the modified index ID value, processes the following three conditions according to the judgment result, processes the callback event exiting the Tabview object, 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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
In a third aspect, the present invention provides 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 the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have 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 current lvgl interface can not realize the circular sliding, does not need to judge the sliding direction in the interface sliding processing process, only needs to obtain the index ID value corresponding to the interface tab object before and after the sliding, judges whether the index ID is the minimum value or the maximum value, and then carries out corresponding processing, thereby realizing the left-right circular sliding of the interface.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a general flow chart of a method according to one embodiment of the present invention;
FIG. 2 is a flowchart of an object creating process in a method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an interface sliding process in a method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the interface cycle switching state of the left-slide embodiment of the present invention;
FIG. 5 is a schematic diagram of interface cycle switching states according to a right-slide embodiment of the present invention;
FIG. 6 is a diagram illustrating a normal switching state of the interface according to the left-sliding embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an apparatus according to a second embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 9 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the application provides the left-right circular sliding method and the device for the lvgl interface, so that 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 can be more personalized, and the later modification of the display effect is simpler and easier.
The technical scheme in the embodiment of the application has the following general idea: the cyclic sliding is realized by utilizing a call-back mechanism of the lvgl interface, and the defect that the cyclic sliding cannot be realized by the conventional lvgl interface is overcome; and setting tab objects corresponding to the minimum value and the maximum value of the index ID to be empty, wherein the sliding direction does not need to be judged in the interface sliding processing process, only the index ID values corresponding to the interface tab objects before and after sliding need to be obtained, judging whether the tab objects slide to the empty tab objects or not by judging whether the index ID is the minimum value or the maximum value, and if so, performing left-right circular sliding processing.
Example one
As shown in fig. 1, the present embodiment provides a left-right loop sliding method for 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 required to be displayed by a business process on the tab view object, establishing an index ID (which can be marked as TABID) of the tab object, and setting the tab object corresponding to the minimum value and the maximum value of the index ID as null; 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, when creating specifically, a tabview object is created on a screen, the size of the tabview is set to be the screen size, a plurality of tab objects are sequentially added to the tabview object, the size of the tab object is equal to or smaller than the tabview, the IDs of the tab objects can be generally sorted from zero, the plurality of tab objects are tab0, tab1, …, tab n and the like in sequence, 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 null, and the rest of the tab objects are non-null; creating an img object and a label object to be displayed on the 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 a font, a format, a font size, a display position and the like corresponding to the label. After Tab1 is set, Tab2, Tab3 and the subsequent tabs are all set with configuration information according to Tab 1.
The callback mechanism setting process comprises the following steps: opening a slide enabling function of the tab view, setting an event callback mechanism of a control for the tab view object, and setting an initial index ID value, where the initial index ID value is one of index ID values corresponding to non-empty tab objects, that is, may be any one of all non-empty tab objects, but is usually an index ID value corresponding to a first non-empty tab object, that is, the ID is 1, and the corresponding tab object is tab 1.
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 slides successfully; the callback event entering the Tabvew object acquires and judges the modified index ID value (namely the modified current index ID value), the following three conditions are processed according to the judgment result, the callback event exiting the Tabvew object after being processed is displayed on the interface of the tab object corresponding to the processed index ID value, and the callback event exiting the Tabvew object is displayed on the interface of the tab object:
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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
The index ID value change event is specifically: and acquiring the index ID value of the tab object of the interface before and after sliding, and replacing the index ID value of the tab object of the interface after sliding with the index ID value of the tab object of the interface after sliding.
For example: in the object creation process, 10 tab objects are created in total, which are respectively represented as tab0, tab1, … and tab9, the minimum value of tab is 0, and the maximum value is 9, then tab0 and tab9 are set to be null, and the initial value of tab is set to be 1.
As shown in fig. 4, when the current TABID value is 1, the current interface is an interface corresponding to tab1 (see the first row in fig. 4), after the right sliding is successful, an index ID value change event of a tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 0 (see the second row in fig. 4), a callback event of a Tabview object is entered to obtain an index ID value 0 after the change, and a judgment is performed, and as a result of the judgment is the minimum tab value, tab0 is empty, tab0 is not displayed, but the index ID value is set to be the index ID value 8 corresponding to the last non-empty tab object, so as to be used as the tab value corresponding to the next interface, thereby switching the current interface to be the interface corresponding to tab8 (see the third row in fig. 4), and implementing circular sliding to the left;
as shown in fig. 5, when the current TABID value is 8, the current interface is an interface corresponding to tab8 (see the first row in fig. 5), after the left sliding is successful, an index ID value change event of a tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 9 (see the second row in fig. 5), a callback event of a Tabview object is entered to obtain the changed index ID value 9, and a judgment is performed, and as a result of the judgment is the maximum tab 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 value corresponding to the next interface, thereby switching the current interface to the interface corresponding to tab1 (see the third row in fig. 5), and implementing left circular sliding;
as shown in fig. 6, when the current tab value is 1, the current interface is an interface corresponding to tab1 (see the first row in fig. 5), after the left sliding is successful, an index ID value change event of the tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 2 (see the second row in fig. 5), a callback event entering the Tabview object obtains the changed index ID value 2 and performs judgment, and as the judgment result is neither the maximum value nor the minimum value, the tab object is processed according to the Tabview event, the changed index ID value is kept unchanged, and the tab object is directly used as the tab value corresponding to the next interface.
In this embodiment, when a callback event entering a Tabview object acquires a modified index ID value, it is further determined whether the modification of the index ID value is successful: obtaining index ID values of tab objects of interfaces before and after sliding, comparing to see whether the index ID values are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the change is confirmed to be successful, and the follow-up action is continued.
The method is applied to electronic student certificates. 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 the lvgl, and the circular sliding of each interface in the business process can be realized.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 7, in the present embodiment, a left-right loop sliding apparatus for an lvgl interface is provided, and includes an object creation module, a callback mechanism setting module, and an interface sliding processing module.
The object creating module is used for creating a tabview object on a screen; creating at least one tab object required to be displayed by 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 as null; 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, when creating specifically, a tabview object is created on a screen, the size of the tabview is set to be the screen size, a plurality of tab objects are sequentially added to the tabview object, the size of the tab object is equal to or smaller than the tabview, the IDs of the tab objects can be generally sorted from zero, the plurality of tab objects are tab0, tab1, …, tab n and the like in sequence, 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 null, and the rest of the tab objects are non-null; creating img objects and label objects to be displayed on tab1, wherein the img objects load and set image source information corresponding to the objects to be displayed, set position information of the img objects, and set fonts, formats, character sizes, display positions and the like corresponding to the labels. After Tab1 is set, Tab2, Tab3 and the subsequent tabs are all set with configuration information according to Tab 1.
The callback mechanism setting module is used for setting an event callback mechanism of the 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 non-empty tab objects; that is, any of all non-empty tab objects may be used, but usually the index ID value corresponding to the first non-empty tab object, i.e., ID 1, is used, and the corresponding tab object is tab 1.
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 sliding is successful; the callback event entering the Tabview object acquires and judges the modified index ID value, processes the following three conditions according to the judgment result, processes the callback event exiting the Tabview object, 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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
For example: in the object creation process, 10 tab objects are created in total, which are respectively represented as tab0, tab1, … and tab9, the minimum value of tab is 0, and the maximum value is 9, then tab0 and tab9 are set to be null, and the initial value of tab is set to be 1.
As shown in fig. 4, after the right sliding is successful, an index ID value change event of a tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 0 (see the second line in fig. 4), a callback event of a Tabview object enters the Tabview object to obtain an index ID value 0 after the change, and a judgment is performed, and as a result of the judgment, the tab0 is empty, the tab0 is not displayed, but the index ID value is set to be the index ID value 8(8 is 9-1) corresponding to the last non-empty tab object to serve as the tab value corresponding to the next interface, so that the current interface is switched to the interface corresponding to the tab8 (see the third line in fig. 4), and the left circular sliding is realized;
as shown in fig. 5, when the current TABID value is 8, the current interface is an interface corresponding to tab8 (see the first row in fig. 5), after the left sliding is successful, an index ID value change event of a tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 9 (see the second row in fig. 5), a callback event of a Tabview object is entered to obtain the changed index ID value 9, and a judgment is performed, and as a result of the judgment is the maximum tab 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 value corresponding to the next interface, thereby switching the current interface to the interface corresponding to tab1 (see the third row in fig. 5), and implementing left circular sliding; as shown in fig. 6, when the current tab value is 1, the current interface is an interface corresponding to tab1 (see the first row in fig. 5), after the left sliding is successful, an index ID value change event of the tab object of the current interface is triggered, the tab value corresponding to the next interface is changed to 2 (see the second row in fig. 5), a callback event entering the Tabview object obtains the changed index ID value 2 and performs judgment, and as the judgment result is neither the maximum value nor the minimum value, the tab object is processed according to the Tabview event, the changed index ID value is kept unchanged, and the tab object is directly used as the tab value corresponding to the next interface.
In this embodiment, the index ID value change event is specifically: and acquiring the index ID value of the tab object of the interface before and after sliding, and replacing the index ID value of the tab object of the interface after sliding with the index ID value of the tab object of the interface after sliding.
In this embodiment, when a callback event entering a Tabview object acquires a modified index ID value, it is further determined whether the modification of the index ID value is successful: obtaining index ID values of tab objects of interfaces before and after sliding, comparing to see whether the index ID values are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the change is confirmed to be successful, and the follow-up action is continued.
The device is applied to electronic student certificates. Therefore, the interface of the electronic student identity card can be realized through the lvgl, the circular sliding of each interface in the business process can be realized, the sliding is more personalized, and the later modification of the display effect is simpler and easier.
Since the apparatus described in the second embodiment of the present invention is an apparatus used for implementing the method of 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 apparatus, and thus the details are not described herein. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
EXAMPLE III
The present embodiment provides an electronic device, as shown in fig. 8, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any implementation manner of the first embodiment may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 9, on which a computer program is stored, and when the computer program is executed by a processor, any one of the first embodiment can be implemented.
The technical scheme provided in the embodiment of the application at least has 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 current lvgl interface can not realize the circular sliding, does not need to judge the sliding direction in the interface sliding processing process, only needs to obtain the index ID value corresponding to the interface tab object before and after the sliding, judges whether the index ID is the minimum value or the maximum value, and then carries out corresponding processing, thereby realizing the left-right circular sliding of the interface.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus or system, or 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (10)

1. A left-right circulation sliding method of an lvgl interface is characterized in that: the method comprises an object creating 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 required to be displayed by 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 as null; 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 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 non-empty tab objects;
the interface sliding processing process comprises the following steps: triggering an index ID value change event of a tab object of the current interface after the interface slides successfully; the callback event entering the Tabview object acquires and judges the modified index ID value, processes the following three conditions according to the judgment result, processes the callback event exiting the Tabview object, 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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
2. The left-right cyclic sliding method of the lvgl interface as recited in claim 1, wherein: the index ID value change event is specifically: and acquiring the index ID value of the tab object of the interface before and after sliding, and replacing the index ID value of the tab object of the interface after sliding with the index ID value of the tab object of the interface after sliding.
3. The left-right cyclic sliding method of the lvgl interface as recited in claim 1, wherein: when the callback event entering the Tabview object acquires the changed index ID value, whether the index ID value is changed successfully is confirmed: obtaining index ID values of tab objects of interfaces before and after sliding, comparing to see whether the index ID values are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the change is confirmed to be successful, and the follow-up action is continued.
4. The left-right cyclic sliding method of the lvgl interface as recited in claim 1, wherein: the method is applied to electronic student certificates.
5. A left and right circulation sliding device of an lvgl interface is characterized in that: the method comprises the following steps:
the object creating module is used for creating a tabview object on a screen; creating at least one tab object required to be displayed by 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 as null; 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 the 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 non-empty tab objects;
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 sliding is successful; the callback event entering the Tabview object acquires and judges the modified index ID value, processes the following three conditions according to the judgment result, processes the callback event exiting the Tabview object, 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;
and if the modified index ID value is neither the maximum value nor the minimum value, keeping the modified index ID value unchanged.
6. The left-right cycle slide of an lvgl interface of claim 5, wherein: the index ID value change event is specifically: and acquiring the index ID value of the tab object of the interface before and after sliding, and replacing the index ID value of the tab object of the interface after sliding with the index ID value of the tab object of the interface after sliding.
7. The left-right cyclic sliding device of an lvgl interface of claim 5, wherein: when the callback event entering the Tabview object acquires the changed index ID value, whether the index ID value is changed successfully is confirmed: obtaining index ID values of tab objects of interfaces before and after sliding, comparing to see whether the index ID values are equal, if so, confirming that the modification is unsuccessful, and continuing to judge; if not, the change is confirmed to be successful, and the follow-up action is continued.
8. The left-right cyclic sliding device of an lvgl interface of claim 6, wherein: the device is applied to electronic student certificates.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 3 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out 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 true CN114860137A (en) 2022-08-05
CN114860137B 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
CN114860137B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN109685870B (en) Information labeling method and device, labeling equipment and storage medium
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
CN112115678B (en) Information display method and device, storage medium and electronic equipment
CN107608609B (en) Event object sending method and device
CN111586464A (en) Content display method, device and equipment based on media information stream and storage medium
US11775260B1 (en) Method, apparatus, and device for DAS-based custom function expansion, and storage medium
CN112668290A (en) Dynamic form generation method and system based on gridding design
WO2020186837A1 (en) Text animation control method and device, storage medium and processor
CN111290680A (en) List display method, device, terminal and storage medium
CN106528115A (en) Visualized interface development method and device
CN103605521A (en) Method and device for realizing interface apposition
CN111158840B (en) Image carousel method and device
CN114860137B (en) Left-right circular sliding method, device, equipment and medium of lvgl interface
CN110018866B (en) User interface theme updating method, device and system, vehicle machine and vehicle
CN114816719B (en) Training method and device of multi-task model
CN115858049A (en) RPA flow componentization arrangement method, device, equipment and medium
CN115756692A (en) Method for automatically combining and displaying pages based on style attributes and related equipment thereof
CN109582411A (en) Graphical user interface creating method, device, computer equipment and storage medium
CN113011148A (en) Method, device, equipment and medium for automatically outputting file with specified format
CN114860140B (en) Configuration-based lvgl interface cyclic sliding method and device
CN113190365A (en) Information processing method and device and electronic equipment
CN112099770A (en) Template-based webpage generation method, system, equipment and storage medium
CN110554872B (en) Data processing method based on reader SDK and reader SDK
CN113836872A (en) Page diagram object editing method, device, equipment and readable medium
CN112581566A (en) Performance text picture generation method and system, cluster unmanned aerial vehicle, medium and terminal

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