CN105739973A - Android based UI control automatic identification refreshing method and apparatus - Google Patents

Android based UI control automatic identification refreshing method and apparatus Download PDF

Info

Publication number
CN105739973A
CN105739973A CN201610044401.6A CN201610044401A CN105739973A CN 105739973 A CN105739973 A CN 105739973A CN 201610044401 A CN201610044401 A CN 201610044401A CN 105739973 A CN105739973 A CN 105739973A
Authority
CN
China
Prior art keywords
control
display items
user interface
attribute
display
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.)
Pending
Application number
CN201610044401.6A
Other languages
Chinese (zh)
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.)
Shenzhen Sinexcel Electric Co Ltd
Original Assignee
Shenzhen Sinexcel Electric 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 Shenzhen Sinexcel Electric Co Ltd filed Critical Shenzhen Sinexcel Electric Co Ltd
Priority to CN201610044401.6A priority Critical patent/CN105739973A/en
Publication of CN105739973A publication Critical patent/CN105739973A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an Android based UI control automatic identification refreshing method and apparatus, and belongs to the technical field of UI control identification refreshing. The identification refreshing method comprises the steps of S1, defining a display item attribute set of UI controls of an Android based user interface; S2, generating an XML file used for displaying the user interface, adding the UI controls into the XML file, and setting a control ID for each UI control; S3, based on the XML file, initializing the user interface, obtaining a display item attribute corresponding to each UI control from the display item attribute set, and refreshing the corresponding UI control according to each display item attribute; and S4, starting a user interface timed refreshing thread and obtaining display item data used for displaying the corresponding UI control according to each display item attribute. According to the method and apparatus, when the UI control is changed, operation codes do not need to be manually added, so that the purpose of automatically identifying the UI control is achieved, the code quantity of software is reduced, the development efficiency is improved, and the later maintenance is facilitated.

Description

A kind of UI control based on Android identifies method for refreshing and device automatically
Technical field
The present invention relates to UI control identification refresh technique field, particularly relate to a kind of UI control based on Android and automatically identify method for refreshing and device.
Background technology
Along with developing rapidly of electronic product, user interface (the UI of electronic product, UserInterface) design makes man-machine interaction also become increasingly hommization, facilitation and intellectuality, and UI design refers to the global design of the man-machine interaction to software, operation logic, beautiful interface.User is operated by the UI control (such as button, input frame etc.) in user interface, to realize the man-machine interaction with electronic product.
For different users, the man-machine interaction page often requires that and user right is limited, the user of common authority is then used to the page of common authority, the user of administration authority is then used to the page of administration authority, to this, the page of common authority and the page of administration authority are separately designed as different UI by developer, and then the logon rights of restriction user, and when receiving user's logging request difference according to user's logon rights, jump to the UI of correspondence, after entering UI, the value of periodic refreshing setting option, and monitor the selection event of control, click event etc., execution arranges operation.
The UI application of this restriction user right is extensive, including power electronics industry, the quality of power supply (PQ in power electronics industry, PowerQuality) in monitoring system, set amount and display items have more than 200, and wherein 80% belongs to normal user permission, and 20% belongs to administrator right, need to refresh in real time this tittle, and be distributed in the different pages according to authority.
But, owing to administrator right includes the display items (i.e. UI control) of common authority, cause the refreshing of the intersection of all display items in the page of common authority and the page of administration authority and monitor and need to carry out in different rights classes of pages respectively, causing that refreshing and monitor work repeats.
Additionally, if the authority of display items is changed, as common authority is promoted to administrator right, then need the classes of pages of change manager and common authority simultaneously (namely for processing the Activity of service logic, it is used for managing View, need to load View and just can demonstrate picture), the code range involving scope is big, is unfavorable for the later maintenance of software.
Summary of the invention
nullThe application identifies method for refreshing and device automatically by providing a kind of UI control based on Android,Solve the coincidence display items for existing in the different rights page in prior art,It refreshes and monitors needs to carry out in different rights classes of pages respectively,Cause that work repeats,And when changing the authority of display items,The classes of pages of different rights need to be changed simultaneously,Amendment size of code is big and is unfavorable for the technical problem of later maintenance of software,Achieve the coincidence display items for existing in the different rights page,It refreshes and monitors without carrying out in different rights classes of pages respectively,Display items (i.e. UI control) is being modified (as increased、Delete、Change display position、Change the display page etc.) time,Need not manually add the operation code relevant to this control,Reach automatically to identify the purpose of UI control,Simplify the size of code of software,Improve the development efficiency of software,Also quite convenient for the later maintenance of software.
On the one hand, the invention provides a kind of UI control based on Android and automatically identify method for refreshing, comprise the following steps:
S1, definition Android user interface the display items community set of UI control;
The XML file that S2, generation show for user interface, adds UI control in described XML file, and arranges control ID for each UI control;
S3, based on described XML file initialising subscriber interface, from described display items community set, obtain the display items attribute corresponding with each UI control simultaneously, and according to each display items attribute, corresponding UI control refreshed;
S4, startup user interface periodic refreshing thread, and obtain the display items data for showing corresponding UI control according to each display items attribute.
Optionally, described step S1 specifically includes sub-step:
S11, the display items attribute of each UI control of Android user interface is set;Wherein, described display items attribute includes control type, control ID, control data source and control title;
The display items attribute of all UI controls of S12, unified definition, to obtain described display items community set.
Optionally, described step S3 specifically includes sub-step:
S31, based on described XML file start UI control display page initialization task;
S32, control ID according to each UI control, extract UI control from current display page;
S33, the display items attribute corresponding for control ID of UI control extracted in obtaining step S32 from described display items community set;
S34, based in step S33 obtain display items attribute, the monitoring event of the UI control corresponding with this display items attribute is set;
Whether S35, the UI control judged in current display page by defining the class of described display items community set extract complete, and UI control in current display page is when extracting complete, redirect execution step S36, or the UI control in current display page is not when extracting complete, redirect execution step S32;
S36, end UI control display page initialization task.
Optionally, described step S4 specifically includes sub-step:
S41, startup user interface periodic refreshing thread;
S42, from described display items community set extract a UI control display items attribute;
S43, based in step S42 extract display items attribute, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;
S44, when described judged result is for being, obtain display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
S45, judge whether the display items attribute of UI control of user interface has extracted by defining the class of described display items community set, and when the display items attributes extraction of the UI control of user interface completes, redirect execution step S46, or when the display items attribute of the UI control of user interface has not extracted, redirect execution step S42;
S46, terminate user interface periodic refreshing thread.
Optionally, after step S43, described method also includes: when described judged result is no, redirects execution step S42.
On the other hand, present invention also offers a kind of UI control based on Android and automatically identify refreshing apparatus, including:
Display items community set definition unit, for defining the display items community set of the UI control of Android user interface;
XML file generates unit, for generating the XML file shown for user interface, adds UI control, and arrange control ID for each UI control in described XML file;
User interface initialization unit, for based on described XML file initialising subscriber interface, obtaining the display items attribute corresponding with each UI control, and according to each display items attribute, corresponding UI control refreshed simultaneously from described display items community set;
User interface periodic refreshing unit, is used for starting user interface periodic refreshing thread, and obtains the display items data for showing corresponding UI control according to each display items attribute.
Optionally, described display items community set definition unit includes:
UI control display items attribute setup module, for arranging the display items attribute of each UI control of Android user interface;Wherein, described display items attribute includes control type, control ID, control data source and control title;
Display items attribute unified definition module, for the display items attribute of all UI controls of unified definition, to obtain described display items community set.
Optionally, described user interface initialization unit includes:
Initialize and start module, for starting UI control display page initialization task based on described XML file;
UI control extraction module, for the control ID according to each UI control, extracts UI control from current display page;
First display items property extracting module, for obtaining the display items attribute corresponding for control ID of the UI control that described UI control extraction module extracts from described display items community set;
Monitoring event arranges module, for the display items attribute obtained based on described first display items property extracting module, arranges the monitoring event of the UI control corresponding with this display items attribute;
UI control extracts complete judge module, whether the UI control that the class for passing through the described display items community set of definition judges in current display page extracts complete, and UI control in current display page is when extracting complete, terminate UI control display page initialization task, or the UI control in current display page is not when extracting complete, from current display page, UI control is extracted, until the UI control of user interface extracts complete again through described UI control extraction module.
Optionally, described user interface periodic refreshing unit specifically includes:
Refresh thread and start module, be used for starting user interface periodic refreshing thread;
Second display items property extracting module, for extracting the display items attribute of a UI control from described display items community set;
Current display page UI control judge module, for the display items attribute extracted based on described second display items property extracting module, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;
Display items data acquisition module, for when described judged result is for being, obtaining display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
Display items attributes extraction completes judge module, class for passing through the described display items community set of definition judges whether the display items attribute of the UI control of user interface has extracted, and when the display items attributes extraction of the UI control of user interface completes, terminate the periodic refreshing thread of user interface, or when the display items attribute of the UI control of user interface has not extracted, from described display items community set, the display items attribute of a UI control is extracted again through described second display items property extracting module, until the display items attributes extraction of the UI control of user interface completes.
Optionally, described user interface periodic refreshing unit also includes:
Redirect execution module, for obtaining described judged result at described current display page UI control judge module, and described judged result is when being no, from described display items community set, extracted the display items attribute of a UI control by described second display items property extracting module.
One or more technical schemes that the present patent application provides, at least have the following technical effect that or advantage:
Due in the present invention program, by defining the display items community set of the UI control of Android user interface;Then, generate the XML file shown for user interface, described XML file is added UI control, and control ID is set for each UI control;And based on described XML file initialising subscriber interface, from described display items community set, obtain the display items attribute corresponding with each UI control simultaneously, and according to each display items attribute, corresponding UI control is refreshed;Afterwards, start user interface periodic refreshing thread, and obtain the display items data for showing corresponding UI control according to each display items attribute, the UI control based on Android is identified refreshing automatically.It is to say, by unified management UI control, add globally unique ID for each UI control, distinguish the display items attribute of each UI control;And UI control added in the XML file shown for user interface, for each UI control, control ID is set, by control ID, each UI control is carried out corresponding with its display items attribute, when (as increased, delete, moving) UI control changed by needs, only need to change XML interface layout, and not affect periodic refreshing corresponding to each UI control, display content and event handling.nullEfficiently solve the coincidence display items for existing in the different rights page in prior art,It refreshes and monitors needs to carry out in different rights classes of pages respectively,Cause that work repeats,And when changing the authority of display items,The classes of pages of different rights need to be changed simultaneously,Amendment size of code is big and is unfavorable for the technical problem of later maintenance of software,Achieve the coincidence display items for existing in the different rights page,It refreshes and monitors without carrying out in different rights classes of pages respectively,Display items (i.e. UI control) is being modified (as increased、Delete、Change display position、Change the display page etc.) time,Need not manually add the operation code relevant to this control,Reach automatically to identify the purpose of UI control,Simplify the size of code of software,Improve the development efficiency of software,Also quite convenient for the later maintenance of software.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, the accompanying drawing used required in embodiment or description of the prior art will be briefly described below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the premise not paying creative work, it is also possible to obtain other accompanying drawing according to the accompanying drawing provided.
Fig. 1 provide for the embodiment of the present application the first automatically identify method for refreshing flow chart based on the UI control of Android;
The second that Fig. 2 provides for the embodiment of the present application identifies method for refreshing flow chart automatically based on the UI control of Android;
Fig. 3 provide for the embodiment of the present application the third automatically identify method for refreshing flow chart based on the UI control of Android;
The 4th kind of UI control based on Android that Fig. 4 provides for the embodiment of the present application identifies method for refreshing flow chart automatically;
Fig. 5 A provide for the embodiment of the present application the first automatically identify the structured flowchart of refreshing apparatus based on the UI control of Android;
The second that Fig. 5 B provides for the embodiment of the present application identifies the structured flowchart of refreshing apparatus automatically based on the UI control of Android.
Detailed description of the invention
nullThe embodiment of the present application identifies method for refreshing automatically by providing a kind of UI control based on Android,Solve the coincidence display items for existing in the different rights page existed in prior art,It refreshes and monitors needs to carry out in different rights classes of pages respectively,Cause that work repeats,And when changing the authority of display items,The classes of pages of different rights need to be changed simultaneously,Amendment size of code is big and is unfavorable for the technical problem of later maintenance of software,Achieve the coincidence display items for existing in the different rights page,It refreshes and monitors without carrying out in different rights classes of pages respectively,Display items (i.e. UI control) is being modified (as increased、Delete、Change display position、Change the display page etc.) time,Need not manually add the operation code relevant to this control,Reach automatically to identify the purpose of UI control,Simplify the size of code of software,Improve the development efficiency of software,Also quite convenient for the later maintenance of software.
The technical scheme of the embodiment of the present application is for solving above-mentioned technical problem, and general thought is as follows:
The embodiment of the present application provides a kind of UI control based on Android and automatically identifies method for refreshing, comprises the following steps: S1, definition Android user interface the display items community set of UI control;The XML file that S2, generation show for user interface, adds UI control in described XML file, and arranges control ID for each UI control;S3, based on described XML file initialising subscriber interface, from described display items community set, obtain the display items attribute corresponding with each UI control simultaneously, and according to each display items attribute, corresponding UI control refreshed;S4, startup user interface periodic refreshing thread, and obtain the display items data for showing corresponding UI control according to each display items attribute.
Visible, in the embodiment of the present application, by unified management UI control, add globally unique ID for each UI control, distinguish the display items attribute of each UI control;And UI control added in the XML file shown for user interface, and control ID is set for each UI control, by control ID, each UI control is carried out corresponding with its display items attribute, when (as increased, delete, moving) UI control changed by needs, only need to change XML interface layout, and not affect periodic refreshing corresponding to each UI control, display content and event handling.nullEfficiently solve the coincidence display items for existing in the different rights page in prior art,It refreshes and monitors needs to carry out in different rights classes of pages respectively,Cause that work repeats,And when changing the authority of display items,The classes of pages of different rights need to be changed simultaneously,Amendment size of code is big and is unfavorable for the technical problem of later maintenance of software,Achieve the coincidence display items for existing in the different rights page,It refreshes and monitors without carrying out in different rights classes of pages respectively,Display items (i.e. UI control) is being modified (as increased、Delete、Change display position、Change the display page etc.) time,Need not manually add the operation code relevant to this control,Reach automatically to identify the purpose of UI control,Simplify the size of code of software,Improve the development efficiency of software,Also quite convenient for the later maintenance of software.
In order to be better understood from technique scheme, below in conjunction with Figure of description and specific embodiment, technique scheme is described in detail, the specific features being to be understood that in the embodiment of the present application and embodiment is the detailed description to technical scheme, rather than the restriction to technical scheme, when not conflicting, the embodiment of the present application and the technical characteristic in embodiment can be mutually combined.
Embodiment one
Refer to Fig. 1, the embodiment of the present application provides a kind of UI control based on Android and automatically identifies method for refreshing, comprises the following steps:
S1, definition Android user interface the display items community set of UI control;
The XML file that S2, generation show for user interface, adds UI control in described XML file, and arranges control ID for each UI control;
In Android, it is provided that one method very simply and easily is used for controlling UI interface.The method adopts XML file to carry out interface layout (including the size of UI control, position, arrangement mode etc.), thus the code of layout interface and the Java code of logic control being separated, uses the structure of program to become apparent from understanding.In step s 2, ID, control ID that the control ID adding UI control in described XML file is globally unique can be regarded as the information for distinguishing and identify each UI control.
S3, based on described XML file initialising subscriber interface, from described display items community set, obtain the display items attribute corresponding with each UI control simultaneously, and according to each display items attribute, corresponding UI control refreshed;
S4, startup user interface periodic refreshing thread, and obtain the display items data for showing corresponding UI control according to each display items attribute.
Further, refer to Fig. 2, described step S1 specifically includes sub-step:
S11, the display items attribute of each UI control of Android user interface is set;Wherein, described display items attribute includes control type, control ID (corresponding identical with the control ID arranged in above-mentioned XML file), control data source, the display precision of data and control title;Described control type includes button, text shows, text inputs, individual event selection etc..
The display items attribute of all UI controls of S12, unified definition, to obtain described display items community set.Android exists an effective class of the overall situation and preserves each display items attribute corresponding for control ID.
Refer to Fig. 3, described step S3 specifically includes sub-step:
S31, based on described XML file start UI control display page initialization task;
S32, control ID according to each UI control, extract UI control from current display page;Concrete, when Android initialising subscriber interface, according to the control ID of the UI control added in XML file, UI control can be extracted from current display page.
S33, the display items attribute corresponding for control ID of UI control extracted in obtaining step S32 from described display items community set;
S34, based in step S33 obtain display items attribute, the monitoring event of the UI control corresponding with this display items attribute is set.Such as, the UI control extracted in current display page includes button, individual event selection and text input, obtains the display items attribute about this three class UI control, and be correspondingly arranged monitoring event from described display items community set;Concrete, button control is arranged click monitoring event, individual event selects control arrange individual event select monitoring event, text-entry control arranges input complete monitoring event.
Whether S35, the UI control judged in current display page by defining the class of described display items community set extract complete, and UI control in current display page is when extracting complete, redirect execution step S36, or the UI control in current display page is not when extracting complete, redirect execution step S32;
S36, end UI control display page initialization task.
About above-mentioned steps S35, can be regarded as: the class of unified definition UI control display items community set in step sl, after the display items attribute having defined each UI control, just can determine that the total quantity (N1) of the UI control of the user interface based on Android;Control ID according to each UI control in step s 32, UI control is extracted one by one from current display page, and stored counts (N2) is carried out when extraction completes a UI control, by the total quantity (N1) of the UI control of the quantity (N2) and user interface that compare the UI control of extraction, just can determine that in current display page, whether UI control extracts complete;Concrete, when N1 is equal to N2, it is determined that in current display page, UI control extracts complete, when N1 is more than N2, it is determined that in current display page, UI control does not extract complete.Further, after the N1 monitoring event equal to N2 and each UI control is provided with, namely initialising subscriber interface completes, then step S4 is performed, user interface is refreshed by timing, when change occurs the UI control of user interface, to display in time in current display page.
Refer to Fig. 4, described step S4 specifically includes sub-step:
S41, startup user interface periodic refreshing thread;
S42, from described display items community set extract a UI control display items attribute;Described display items attribute includes control type, control ID, control data source, the display precision of data and control title;Described control type includes button, text shows, text inputs, individual event selection etc..
S43, based in step S42 extract display items attribute, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;Specifically can be compared by the ID of the control ID in the display items attribute of extraction with the UI control in current display page, judge whether the UI control corresponding with this display items attribute;
S44, when described judged result is for being, obtain display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
S45, judge whether the display items attribute of UI control of user interface has extracted by defining the class of described display items community set, and when the display items attributes extraction of the UI control of user interface completes, redirect execution step S46, or when the display items attribute of the UI control of user interface has not extracted, redirect execution step S42;
S46, terminate user interface periodic refreshing thread.
In specific implementation process, referring still to Fig. 4, after step S43, described method also includes: when described judged result is no, redirect execution step S42, until the display items attribute of the UI control in the display items community set of unified definition has all extracted, and carrying out page furbishing from corresponding control data source acquisition display items data respectively, namely the periodic refreshing of user interface completes.
Can be regarded as, in the present invention program, first to the UI control unified definition display items community set in user interfaces all in Android, including to each UI control, display items attribute is set, when a certain UI control changes (as increased, delete, moving, permission modification etc.), accordingly, the display items data of this UI control can change, define this UI control display items attribute time, to should control ID chain be connected to change after data source (storage has the display items data after change);When generating the XML file for showing user interface, the UI control of interpolation includes the UI control that change occurs;Android is when carrying out page display, then can load this XML file, when periodic refreshing page display items, whether can first inquire about in current page has the control ID of UI control consistent with in display items community set, if had, from display items community set, the display items attribute of the UI control corresponding with this control ID is then obtained by this control ID, and refresh the UI control in current page according to this display items attribute, wherein, when the data source of the display items data of a certain UI control occurs to change, with this UI control of display items Refresh Data of the data source after changing.Such as, the data display precision of a certain UI control is changed to by the numeral after not showing arithmetic point and is shown to one decimal place;And for example, in power electronics industry, when needing to increase in the user interface the set amount CT no-load voltage ratio (namely current transformer both sides convert the ratio between electric current) of common authority, so that it is [0 that user can pass through user interface input range, 30000] CT no-load voltage ratio numerical value is handed down to bottom controller, by adopting the present invention program, only need to add a UI control in the XML file of corresponding common authority, and control ID is set for this UI control, then other all of display modes, monitoring setting, operation setting, operation indicating etc. need not additionally carry out again.
In sum, by adopting this automatically to identify method for refreshing, unified management UI control based on the UI control of Android, add globally unique ID for each UI control, distinguish the display items attribute of each UI control;And UI control added in the XML file shown for user interface, and control ID is set for each UI control, by control ID, each UI control is carried out corresponding with its display items attribute, when (as increased, delete, moving) UI control changed by needs, only need to change XML interface layout, and not affect periodic refreshing corresponding to each UI control, display content and event handling.Achieve the coincidence display items for existing in the different rights page, it refreshes and monitors without carrying out in different rights classes of pages respectively, when display items (i.e. UI control) being modified (as increased, deleting, change shows position, change the display page etc.), need not manually add the operation code relevant to this control, reach automatically to identify the purpose of UI control, simplify the size of code of software, improve the development efficiency of software, also quite convenient for the later maintenance of software.
Embodiment two
Based on same inventive concept, refer to Fig. 5 A, the embodiment of the present application additionally provides a kind of UI control based on Android and automatically identifies refreshing apparatus, including:
Display items community set definition unit 51, for defining the display items community set of the UI control of Android user interface;
XML file generates unit 52, for generating the XML file shown for user interface, adds UI control, and arrange control ID for each UI control in described XML file;
User interface initialization unit 53, for based on described XML file initialising subscriber interface, obtaining the display items attribute corresponding with each UI control, and according to each display items attribute, corresponding UI control refreshed simultaneously from described display items community set;
User interface periodic refreshing unit 54, is used for starting user interface periodic refreshing thread, and obtains the display items data for showing corresponding UI control according to each display items attribute.
In specific implementation process, refer to Fig. 5 B, described display items community set definition unit 51 includes:
UI control display items attribute setup module 511, for arranging the display items attribute of each UI control of Android user interface;Wherein, described display items attribute includes control type, control ID, control data source and control title;
Display items attribute unified definition module 512, for the display items attribute of all UI controls of unified definition, to obtain described display items community set.
In specific implementation process, referring still to Fig. 5 B, described user interface initialization unit 53 includes:
Initialize and start module 531, for starting UI control display page initialization task based on described XML file;
UI control extraction module 532, for the control ID according to each UI control, extracts UI control from current display page;
First display items property extracting module 533, for obtaining the display items attribute corresponding for control ID of the UI control that described UI control extraction module 532 extracts from described display items community set;
Monitoring event arranges module 534, for the display items attribute obtained based on described first display items property extracting module 533, arranges the monitoring event of the UI control corresponding with this display items attribute;
UI control extracts complete judge module 535, whether the UI control that the class for passing through the described display items community set of definition judges in current display page extracts complete, and UI control in current display page is when extracting complete, terminate the initialization task of user interface, or the UI control in current display page is not when extracting complete, from current display page, UI control is extracted, until the UI control of user interface extracts complete again through described UI control extraction module 532.
In specific implementation process, referring also to Fig. 5 B, described user interface periodic refreshing unit 54 specifically includes:
Refresh thread and start module 541, be used for starting user interface periodic refreshing thread;
Second display items property extracting module 542, for extracting the display items attribute of a UI control from described display items community set;
Current display page UI control judge module 543, for the display items attribute extracted based on described second display items property extracting module 542, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;
Display items data acquisition module 544, for when described judged result is for being, obtaining display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
Display items attributes extraction completes judge module 545, class for passing through the described display items community set of definition judges whether the display items attribute of the UI control of user interface has extracted, and when the display items attributes extraction of the UI control of user interface completes, terminate the periodic refreshing thread of user interface, or when the display items attribute of the UI control of user interface has not extracted, from described display items community set, the display items attribute of a UI control is extracted again through described second display items property extracting module 542, until the display items attributes extraction of the UI control of user interface completes.
It addition, described user interface periodic refreshing unit 54 also includes:
Redirect execution module 546, for obtaining described judged result at described current display page UI control judge module 543, and described judged result is when being no, from described display items community set, extracted the display items attribute of a UI control by described second display items property extracting module 542.
As described above, the above-mentioned UI control based on Android identifies that refreshing apparatus is used for realizing the above-mentioned UI control based on Android and automatically identifies method for refreshing automatically, so, the work process of this device is consistent with one or more embodiments of said method, just no longer repeats one by one at this.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect.And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
Although preferred embodiments of the present invention have been described, but those skilled in the art are once know basic creative concept, then these embodiments can be made other change and amendment.So, claims are intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, the present invention can be carried out various change and modification without deviating from the spirit and scope of the present invention by those skilled in the art.So, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (10)

1. one kind identifies method for refreshing automatically based on the UI control of Android, it is characterised in that comprise the following steps:
S1, definition Android user interface the display items community set of UI control;
The XML file that S2, generation show for user interface, adds UI control in described XML file, and arranges control ID for each UI control;
S3, based on described XML file initialising subscriber interface, from described display items community set, obtain the display items attribute corresponding with each UI control simultaneously, and according to each display items attribute, corresponding UI control refreshed;
S4, startup user interface periodic refreshing thread, and obtain the display items data for showing corresponding UI control according to each display items attribute.
2. the UI control based on Android as claimed in claim 1 identifies method for refreshing automatically, it is characterised in that described step S1 specifically includes sub-step:
S11, the display items attribute of each UI control of Android user interface is set;Wherein, described display items attribute includes control type, control ID, control data source and control title;
The display items attribute of all UI controls of S12, unified definition, to obtain described display items community set.
3. the UI control based on Android as claimed in claim 1 identifies method for refreshing automatically, it is characterised in that described step S3 specifically includes sub-step:
S31, based on described XML file start UI control display page initialization task;
S32, control ID according to each UI control, extract UI control from current display page;
S33, the display items attribute corresponding for control ID of UI control extracted in obtaining step S32 from described display items community set;
S34, based in step S33 obtain display items attribute, the monitoring event of the UI control corresponding with this display items attribute is set;
Whether S35, the UI control judged in current display page by defining the class of described display items community set extract complete, and UI control in current display page is when extracting complete, redirect execution step S36, or the UI control in current display page is not when extracting complete, redirect execution step S32;
S36, end UI control display page initialization task.
4. the UI control based on Android as claimed in claim 1 identifies method for refreshing automatically, it is characterised in that described step S4 specifically includes sub-step:
S41, startup user interface periodic refreshing thread;
S42, from described display items community set extract a UI control display items attribute;
S43, based in step S42 extract display items attribute, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;
S44, when described judged result is for being, obtain display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
S45, judge whether the display items attribute of UI control of user interface has extracted by defining the class of described display items community set, and when the display items attributes extraction of the UI control of user interface completes, redirect execution step S46, or when the display items attribute of the UI control of user interface has not extracted, redirect execution step S42;
S46, terminate user interface periodic refreshing thread.
5. the UI control based on Android as claimed in claim 4 identifies method for refreshing automatically, it is characterised in that after step S43, described method also includes: when described judged result is no, redirects execution step S42.
6. one kind identifies refreshing apparatus automatically based on the UI control of Android, it is characterised in that including:
Display items community set definition unit, for defining the display items community set of the UI control of Android user interface;
XML file generates unit, for generating the XML file shown for user interface, adds UI control, and arrange control ID for each UI control in described XML file;
User interface initialization unit, for based on described XML file initialising subscriber interface, obtaining the display items attribute corresponding with each UI control, and according to each display items attribute, corresponding UI control refreshed simultaneously from described display items community set;
User interface periodic refreshing unit, is used for starting user interface periodic refreshing thread, and obtains the display items data for showing corresponding UI control according to each display items attribute.
7. the UI control based on Android as claimed in claim 6 identifies refreshing apparatus automatically, it is characterised in that described display items community set definition unit includes:
UI control display items attribute setup module, for arranging the display items attribute of each UI control of Android user interface;Wherein, described display items attribute includes control type, control ID, control data source and control title;
Display items attribute unified definition module, for the display items attribute of all UI controls of unified definition, to obtain described display items community set.
8. the UI control based on Android as claimed in claim 6 identifies refreshing apparatus automatically, it is characterised in that described user interface initialization unit includes:
Initialize and start module, for starting UI control display page initialization task based on described XML file;
UI control extraction module, for the control ID according to each UI control, extracts UI control from current display page;
First display items property extracting module, for obtaining the display items attribute corresponding for control ID of the UI control that described UI control extraction module extracts from described display items community set;
Monitoring event arranges module, for the display items attribute obtained based on described first display items property extracting module, arranges the monitoring event of the UI control corresponding with this display items attribute;
UI control extracts complete judge module, whether the UI control that the class for passing through the described display items community set of definition judges in current display page extracts complete, and UI control in current display page is when extracting complete, terminate UI control display page initialization task, or the UI control in current display page is not when extracting complete, from current display page, UI control is extracted, until the UI control of user interface extracts complete again through described UI control extraction module.
9. the UI control based on Android as claimed in claim 6 identifies refreshing apparatus automatically, it is characterised in that described user interface periodic refreshing unit specifically includes:
Refresh thread and start module, be used for starting user interface periodic refreshing thread;
Second display items property extracting module, for extracting the display items attribute of a UI control from described display items community set;
Current display page UI control judge module, for the display items attribute extracted based on described second display items property extracting module, it is judged that whether current display page exists the UI control corresponding with this display items attribute, it is thus achieved that a judged result;
Display items data acquisition module, for when described judged result is for being, obtaining display items data according to this display items attribute from corresponding control data source, and based on described display items data, UI control corresponding in current display page refreshed;
Display items attributes extraction completes judge module, class for passing through the described display items community set of definition judges whether the display items attribute of the UI control of user interface has extracted, and when the display items attributes extraction of the UI control of user interface completes, terminate the periodic refreshing thread of user interface, or when the display items attribute of the UI control of user interface has not extracted, from described display items community set, the display items attribute of a UI control is extracted again through described second display items property extracting module, until the display items attributes extraction of the UI control of user interface completes.
10. the UI control based on Android as claimed in claim 9 identifies refreshing apparatus automatically, it is characterised in that described user interface periodic refreshing unit also includes:
Redirect execution module, for obtaining described judged result at described current display page UI control judge module, and described judged result is when being no, from described display items community set, extracted the display items attribute of a UI control by described second display items property extracting module.
CN201610044401.6A 2016-01-22 2016-01-22 Android based UI control automatic identification refreshing method and apparatus Pending CN105739973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610044401.6A CN105739973A (en) 2016-01-22 2016-01-22 Android based UI control automatic identification refreshing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610044401.6A CN105739973A (en) 2016-01-22 2016-01-22 Android based UI control automatic identification refreshing method and apparatus

Publications (1)

Publication Number Publication Date
CN105739973A true CN105739973A (en) 2016-07-06

Family

ID=56247503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610044401.6A Pending CN105739973A (en) 2016-01-22 2016-01-22 Android based UI control automatic identification refreshing method and apparatus

Country Status (1)

Country Link
CN (1) CN105739973A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725976A (en) * 2018-12-29 2019-05-07 努比亚技术有限公司 A kind of display interface method for refreshing, mobile terminal and storage medium
WO2019090854A1 (en) * 2017-11-13 2019-05-16 平安科技(深圳)有限公司 Method and device for refreshing list control, storage medium and terminal
CN109871257A (en) * 2019-02-19 2019-06-11 广州视源电子科技股份有限公司 Page element display method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103491A (en) * 2009-12-18 2011-06-22 Tcl集团股份有限公司 System and method for generating interface
CN102375733A (en) * 2010-08-24 2012-03-14 北大方正集团有限公司 Convenient and quick interface arrangement method
CN103176802A (en) * 2013-03-29 2013-06-26 厦门亿联网络技术股份有限公司 Method of achieving separation of user interface UI of system and control library through control pool
CN105094832A (en) * 2015-08-01 2015-11-25 李志丹 WYSIWYG method and system for dynamically generating user interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103491A (en) * 2009-12-18 2011-06-22 Tcl集团股份有限公司 System and method for generating interface
CN102375733A (en) * 2010-08-24 2012-03-14 北大方正集团有限公司 Convenient and quick interface arrangement method
CN103176802A (en) * 2013-03-29 2013-06-26 厦门亿联网络技术股份有限公司 Method of achieving separation of user interface UI of system and control library through control pool
CN105094832A (en) * 2015-08-01 2015-11-25 李志丹 WYSIWYG method and system for dynamically generating user interface

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019090854A1 (en) * 2017-11-13 2019-05-16 平安科技(深圳)有限公司 Method and device for refreshing list control, storage medium and terminal
CN109725976A (en) * 2018-12-29 2019-05-07 努比亚技术有限公司 A kind of display interface method for refreshing, mobile terminal and storage medium
CN109871257A (en) * 2019-02-19 2019-06-11 广州视源电子科技股份有限公司 Page element display method, device and equipment
CN109871257B (en) * 2019-02-19 2023-02-17 广州视源电子科技股份有限公司 Page element display method, device and equipment

Similar Documents

Publication Publication Date Title
US7430718B2 (en) Configurable interface for template completion
US10291729B2 (en) User interface modification and usage tracking
Horak et al. Vistribute: Distributing interactive visualizations in dynamic multi-device setups
CN104267968A (en) Interface switching method and device
US9665255B2 (en) Deterministic visual indication of user data context
CN110807015A (en) Big data asset value delivery management method and system
CN103853611A (en) Method for copying text among application programs rapidly and electronic equipment
CN110532159A (en) Data decryptor method, apparatus, equipment and computer readable storage medium
Schuckmann et al. Modeling collaboration using shared objects
WO2013109858A1 (en) Design canvas
CN105955759A (en) Template engine realization method used for Web development
CN105739973A (en) Android based UI control automatic identification refreshing method and apparatus
US20110126171A1 (en) Dynamic native editor code view facade
CN115599363A (en) Configuration method, device and system of visual component
CN103257788A (en) Windows desktop dynamic icon forming method
CN104571811A (en) Information processing method and electronic equipment
Insfran et al. Evaluating the usability of mashups applications
CN104077114A (en) Method for changing display interface of application software and electronic equipment
CN105094923B (en) The method and device of display terminal Loading Menu
CN109952557A (en) Layered contents selection
CN115203162A (en) WYSIWYG graph data construction method
Blichmann et al. Customizing workspace awareness by non-programmers
CN105138322B (en) Generate the method and system of application program
US9268560B2 (en) Displaying dependent files for computer code in a tabbed-application user interface
CN102955648B (en) Terminal equipment, content merging method and display method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160706

RJ01 Rejection of invention patent application after publication