CN105955777A - User interface refreshing method and device - Google Patents
User interface refreshing method and device Download PDFInfo
- Publication number
- CN105955777A CN105955777A CN201610284654.0A CN201610284654A CN105955777A CN 105955777 A CN105955777 A CN 105955777A CN 201610284654 A CN201610284654 A CN 201610284654A CN 105955777 A CN105955777 A CN 105955777A
- Authority
- CN
- China
- Prior art keywords
- user interface
- data source
- delay timer
- refreshing
- refresh
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44578—Preparing or optimising for loading
Abstract
The invention provides a user interface refreshing method and device. Two variables, including a future data source and a current data source, are defined in TableViewModel, so that the future data source is changed when the data of the user interface is updated, at the time, the user interface is not truly refreshed, the value of the future data source is copied to the current data source when a latency timer is up, the user interface is refreshed for one time, and the user interface can be prevented from being frequently refreshed in short time through latency refreshing.
Description
Technical field
The present invention relates to Internet technology, particularly relate to method for refreshing and the device of a kind of user interface.
Background technology
Instant messaging (Instant Messagin is called for short IM) is that one can allow user build on network
The real-time communication service of certain private chat room (chatroom) vertical.It is known that the application number of IM class
According to change frequently, data volume big, if using the strategy refreshed in real time, user interface card can be caused unavoidably
, the consequence of degraded performance, the most sometimes, application directly block for a long time, reach disabled
State.And the interface fluency applied, it is to affect Consumer's Experience the most directly, to be also most important one and refer to
Mark.
Most instant messaging service provides the characteristic of status information--display data contact person list, connection
Can network people be the most online and talk with liaisons, and UITableView is the most used in IOS, also
Being one of most important control, it is to need the data shown in list mode to provide the side of displaying well
Case, its reusable mechanism optimizes application performance greatly.But the data of the user interface as IM
When source frequently occurs change, refreshing can make user interface card pause frequently, and performance reduces.
Summary of the invention
The present invention provides method for refreshing and the device of a kind of user interface, it is to avoid frequent updating in the short time
User interface.
First aspect present invention provides the method for refreshing of a kind of user interface, including:
When the data of user interface are updated, Future Data source is modified, described Future Data source
It it is the data source of next update data;
If delay timer is not opened, then starting described delay timer, described delay timer is used for remembering
Record the delay refresh time of described user interface;
When described delay timer is to constantly, described Future Data source is copied to current data source, described
Current data source is the data source of current display data;
Perform method for refreshing data according to described current data source, refresh described user interface;
After refreshing completes, close described delay timer.
Optionally, described described Future Data source is copied to current data source before, described method is also wrapped
Include:
Judge that described user interface the most shows;
If described user interface shows, then described Future Data source is copied to described current data source;
If described user interface is not to show, then close described delay timer.
Optionally, before the described delay timer of described startup, described method also includes:
Judge that described user interface the most shows;
If described user interface shows, then start described delay timer;
If described user interface is not to show, the most do not start described delay timer, wait next time
Update.
Optionally, described when the data of user interface are updated, call Future Data source method, to not
Coming before data source is modified, described method also includes:
When initializing TableViewModle, generate described delay timer, and create described following number
According to source and current data source.
Optionally, described when the data of user interface are updated, after Future Data source is modified,
Also include:
Adding 1 by the value of refresh counter, described refresh counter is for recording the number of times postponing to refresh;
Described after refreshing completes, after closing described delay timer, also include:
The value of refresh counter is set to 0.
Optionally, described method also includes:
When user actively opens described user interface, it is judged that whether the value of described refresh counter is 0;
When the value of described refresh counter is not 0, performs method for refreshing data, refresh described user circle
Face;
When the value of described refresh counter is 0, keep described user interface state constant.
Second aspect present invention provides the refreshing apparatus of a kind of user interface, including:
Change module, for when the data of user interface are updated, is modified Future Data source,
Described Future Data source is the data source of next update data;
Time block, if not opening for delay timer, then starts described delay timer, described in prolong
Intervalometer is for recording the delay refresh time of described user interface late;
Replication module, for when described delay timer is to constantly, is copied to described Future Data source work as
Front data source, described current data source is the data source of current display data;
Refresh module, for performing method for refreshing data according to described current data source, refreshes described user
Interface;
Described time block is additionally operable to after refreshing completes, and closes described delay timer.
Optionally, described device also includes the first judge module;
Described first judge module is for being copied to current number at described replication module by described Future Data source
Before source, it is judged that described user interface the most shows;
If described user interface shows, described Future Data source is copied to institute by the most described replication module
State current data source;
If described user interface is not to show, the most described time block closes described delay timer.
Optionally, described device also includes the second judge module;
Described second judge module is before starting described delay timer at described time block, it is judged that
Described user interface the most shows;
If described user interface shows, the most described time block starts described delay timer;
If described user interface is not to show, the most described time block does not start described delay timer,
Wait and updating next time.
Optionally, described device also includes initialization module;
Described initialization module is used for, when initializing TableViewModle, generating described delay timer,
And create described Future Data source and current data source.
Optionally, described device also includes:
Counting module, for after Future Data source is modified by described change module, counts refreshing
The value of number device adds 1, and described refresh counter is for recording the number of times postponing to refresh;
After described counting module is additionally operable to, more described time block closes described delay timer, by institute
The value stating refresh counter is set to 0.
Optionally, described device also includes:
3rd judge module, for when user actively opens described user interface, it is judged that described refreshing meter
Whether the value of number device is 0;
Described refresh module is additionally operable to, when described 3rd judge module judges the value of described refresh counter not
When being 0, perform method for refreshing data, refresh described user interface;
When the value of described refresh counter is 0, keep described user interface state constant.
The method for refreshing of the user interface that the present invention provides and device, by fixed in TableViewModel
Two variablees of justice: Future Data source and current data source, when the data of user interface are updated, to not
Carry out data source to be modified, and the value of refresh counter is added 1, the most real refreshes user circle
Face, but when delay timer is to constantly, just the value in Future Data source is copied to current data source, right
User interface once refreshes, and frequently refreshes user interface in avoiding the short time by delay refreshing;
Refresh counter is set, it is to avoid user the most actively opens interface and refreshes interface, effectively save
Data traffic, and improve Consumer's Experience.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality
Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that under,
Accompanying drawing during face describes is some embodiments of the present invention, for those of ordinary skill in the art,
On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the structural representation of MVVM;
Fig. 2 is UITableView flush mechanism flow chart;
The flow chart of the method for refreshing of the user interface that Fig. 3 provides for the embodiment of the present invention one;
The flow chart of the method for refreshing of the user interface that Fig. 4 provides for the embodiment of the present invention two;
Data between Future Data source and current data source that Fig. 5 provides for the embodiment of the present invention three replicate
Method.
The structural representation of the refreshing apparatus of a kind of user interface that Fig. 6 provides for the embodiment of the present invention four.
The structural representation of the refreshing apparatus of a kind of user interface that Fig. 7 provides for the embodiment of the present invention five.
Detailed description of the invention
The method of the present invention is applicable to the UITableView of MVVM pattern, and MVVM i.e. Model-View-
View model (Modle-View-ViewModle), (User Interface is called for short UI i.e. user interface
UI).Fig. 1 is the structural representation of MVVM, as it is shown in figure 1, MVVM is made up of three parts:
Modle, View and ViewModle, View i.e. UI, ViewModle are the abstract of View, are responsible for
Information conversion between View and Model, is sent to Modle, Model i.e. by the Command of View
Data access layer.
ViewModle is mainly improved by the present invention, the method for following example also by
ViewModle perform, in order to distinguish existing ViewModle, the present invention will improve after ViewModle
It is referred to as TableViewModel, below will be described in detail the operation principle of TableViewModel, and
The class used in TableViewModel:
1.1 classes TableViewSectionData
Core attribute:
NSArray*rowDatas;
id headData;
id footData;
Core methed:
(TableViewSectionMutableData*);
Wherein, attribute rowDatas is an array of data type id, and it is meant that a section
In data in all row.One UI includes that multiple section, each section include multiple row.
Attribute headData represents the required data shown of headView of a section, if belonged to
Property headData be empty, then explanation need not show headView.
Attribute footData represents the required data shown of footView of a section, if
FootView is empty, then explanation need not show footView.
The effect of method mutableCopy is that one data of return are on all four with itself
TableViewSectionMutableData, to provide outside to modify.
1.2 classes TableViewSectionMutableData
Core attribute:
NSMutableArray*rowDatas;
id headData;
id footData;
Core methed:
(TableViewSectionData*)copy;
Wherein, attribute rowDatas is a variable data array of data type id, and it is meant that one
Data in all row in section.
Attribute headData is consistent with TableViewSectionData implication, and attribute footData is same
TableViewSectionData implication is consistent.
The effect of method mutableCopy is that one data of return are on all four with itself
TableViewSectionData, to provide UITableView to be shown data.
1.3 classes TableViewDataSource
Core attribute:
NSArray*sectionDatas;
id headData;
id footData;
Core interface:
-(TableViewSectionData*)sectionDataInSection:(NSInteger)section;
-(TableViewMutableDataSource*)mutableCopy;
Wherein, attribute sectionDatas is an array of TableViewSectionData object, it
It is meant that the data of all section in a UITableView.
Attribute headData represents the required data shown of headView of a UITableView,
If headData is empty, then explanation need not headView.
Attribute footData represents the required data shown of footView of a UITableView, as
Really footView is empty, then explanation need not show footView.
The effect of method mutableCopy is that one data of return are on all four with itself
TableViewMutableDataSource, to provide outside to modify.
1.4 classes TableViewMutableDataSource
Core member's variable:
NSMutableArray*sectionDatas;
id headData;
id footData;
Core interface:
-(TableViewSectionMutableData*)sectionDataInSection:(NSInteger)
section;
-(TableViewDataSource*)copy;
Wherein, attribute sectionDatas this be a variable data array of TableViewSectionData object,
It is meant that the data of all section in a UITableView.
Attribute headData is consistent with TableViewDataSource, and attribute footData is same
TableViewDataSource is consistent.
The effect of method mutableCopy is that one data of return are on all four with itself
TableViewDataSource, to provide UITableView to be shown.
1.5 classes TableViewModel
Core member's variable:
TableViewDataSource*currentDataSource;
TableViewMutableDataSource*_nextDataSource;
Core attribute:
UITableView*tableView;
Core interface:
(TableViewMutableDataSource*)nextDataSource;
(TableViewDataSource*)currentDataSource;
(void)reloadData;
1.5.1 core member's variable lexical or textual analysis
A ,-currentDataSource represent dataSource (data source) current for UITableIView,
Here dataSource is not the dataSource in UITableView, UITableView's
DataSource is meant that the agency providing data source, and data source here is exactly
_ currentDataSource, in order to distinguish both, is referred to as the attribute dataSource of UITableView
DataSource acts on behalf of.
B ,-nextDataSource represent the dataSource that UITableView is following, and wherein, future refers to
Be next time reloadData time, nextDataSource will become the dataSource of UITableView,
So the change of any nextDataSource, will be represented when reloadData next time,
NextDataSource can be created and be initialised when TableViewModel is initialized.
1.5.2 core attribute lexical or textual analysis:
A, tableView are incoming by outside, and effect is at reloadData method intrinsic call tableView
ReloadData method.
1.5.3 core interface lexical or textual analysis:
a、-(TableViewMutableDataSource*)nextDataSource;
The external world obtains the Future Data of UITableView by calling this interface and is modified it.
b、-(TableViewDataSource*)currentDataSource;
The external world obtains the current data source of UITableView, the data got by calling this interface
Need to be demonstrated immediately.Note: actually member variable _ nextDataSource's that this interface returns
Immutable copy, preventing under multithreading _ currentDataSource sudden change causes crash.
c、-(void)reloadData;
This interface is consistent with the reloadData function of UITableView, is all after data source changes
For refreshing interface, actually the method is the most also the reloadData side calling UITableView
Method.They maximum differences are, reloadData method, before real refreshing interface, can carry out data source
Switching:
_ currentDataSource=[_ nextDataSource copy];
1.6TableViewModel (viewModel) and UITableVIewController
(viewController), the concrete steps that UITableView (tableView) is used in combination can refer to figure
2, Fig. 2 is UITableView flush mechanism flow chart, as in figure 2 it is shown, UITableView refreshes machine
System comprises the following steps:
Step 101, in the viewDidLoad method of viewController generate viewModel,
tableView。
Step 102, the dataSource agency that viewController is set to tableView and delegate
Agency, and the tableView attribute of viewModel is pointed to tableView.
Step 103, viewController loading data, load after terminating, call viewModel's
-(TableViewMutableDataSource*) nextDataSource method obtains data source more new data
Source.
Step 104, the reloadData method calling viewModel start to update UITableView interface.
Step 105, the delegate Proxy Method performing UITableView and dataSource agent
Method, is obtained by (TableViewDataSource*) currentDataSource method of viewModle
Data source.
Step 106, interface are refreshed complete.
In conjunction with the operation principle of the TableViewModel of foregoing description, and UITableView refreshes machine
System, the embodiment of the present invention one provides the method for refreshing of a kind of user interface, and Fig. 3 is the embodiment of the present invention one
The flow chart of the method for refreshing of the user interface provided, as it is shown on figure 3, the method bag that the present embodiment provides
Include following steps:
Step 201, when the data of user interface are updated, Future Data source is modified, future
Data source is the data source of next update data.
Here Future Data source, the nextDataSource of the most above-mentioned TableViewModle.Such as,
Get new data, need when the first row of user interface inserts a line, call TableViewModle
NextDataSource method, obtain table data source TableViewMutableDataSource, i.e. obtain
Take the data source of all section in user interface, and acquisition section is 0 again
TableViewSectionMutableData.Then at the attribute of TableViewSectionMutableData
RowData inserts a data.
If step 202 delay timer is not opened, then start delay intervalometer, delay timer is used for
The delay refresh time of record user interface.
After Future Data source is modified, it is judged that whether delay timer is opened, and delay timer exists
Generating when TableViewModle initializes, the delay refresh time of delay timer can be according to actual need
Arrange, for example, 1 second.If delay timer is not opened, then start delay intervalometer, if prolonged
Intervalometer has been switched on late, then terminate, and does not perform any operation, waits delay timer then.
Step 203, when delay timer is to constantly, Future Data source is copied to current data source, when
Front data source is the data source of current display data.
The method of the present embodiment, by defining two variable Future Data sources inside TableViewModle
With current data source, Future Data source variable, current data source be can not variable, when there being data to update,
Can update Future Data source immediately, current data source can't update immediately, only arrives when delay timer
Constantly, just the value in Future Data source can be copied to current data source, the value in current data source is once changed
Become, can display the most on a user interface.By arranging delay timer, it is to avoid at short notice
Repeat to refresh repeatedly to user interface, delay timer then before, every secondary data update time be not true
The most more new data, only when delay timer is to constantly, just can trigger real renewal operation.Postponing
May carry out in refresh time repeatedly updating, this repeatedly updates unification after being delayed by and once refreshes.
Reproduction process can be expressed as-currentDataSource=[-nextDataSource copy].
It addition, the method for the present invention can also solve to cause UITableView to have shown that because time delay refreshes
Data and its data source be inconsistent and the series of problems that causes.
Step 204, according to current data source perform method for refreshing data, refreshes user interface.
After Future Data source is copied to current data source, TableView performs method for refreshing data
ReloadData, refreshes user interface.
Step 205, closedown delay timer.
When follow-up have data to update time, repeat above-mentioned steps.
The method of the present embodiment, by defined in TableViewModel two variablees: Future Data source
With current data source, when the data of user interface are updated, Future Data source is modified, now
Not real refreshes user interface, but when delay timer is to constantly, just by the value in Future Data source
It is copied to current data source, carries out Refresh Data.Avoid in the short time frequently to user by postponing refreshing
Interface is refreshed.
On the basis of embodiment one, in other embodiments of the invention, all right after step 201
Comprising the steps: to add 1 by the value of refresh counter, refresh counter postpones the secondary of refreshing for recording
Number, and after step 205, i.e. complete in refreshing, after closing delay timer, by refresh count
The value of device is set to 0.Wherein, the initial value of refresh counter is 0, when often needing to update a secondary data, and brush
The value of refresh counter will add 1, such as, when user interface is updated 3 times, and the value of refresh counter
Being 3, when user interface is updated 5 times, the value of refresh counter is 5.Merely just from increasing refreshing meter
Number device, the actually the most real data that perform update, and data update or at delay timer to constantly,
Just carry out data renewal.
On the basis of the operation principle of above-described embodiment one and the TableViewModel of definition, Fig. 4 is
The flow chart of the method for refreshing of the user interface that the embodiment of the present invention two provides, as shown in Figure 4, this enforcement
The method that example provides may comprise steps of:
Step 301, get new data, need to insert a line in the first row.
Step 302, call the nextDataSource method of TableViewModel, obtain table data
Source TableViewMuTableDataSource, and again to get section be 0
TableViewMuTableData。
Step 303, insertion one in the attribute rowData of TableViewSectionMuTableData
Data.
Step 304, call the reloadData method of TableViewModle.
Step 305, the value of refresh counter add 1.
Step 306, judge whether delay timer is opened.
If delay timer is not opened, then perform step 307, if delay timer is opened, then hold
Row step 308.
Step 307, unlatching delay timer.
Step 308, end.
Step 309, delay timer callback method are triggered.
Step 310, start to perform callback method.
Step 311 ,-currentDataSource=[-nextDataSource copy].
Step 312, TableView perform reloadData.
Step 313, the value of refresh counter are set to 0.
Step 314, closedown delay timer.
Step 315, timer callback method terminate.
On the basis of above-described embodiment one and embodiment two, the embodiment of the present invention three provides a kind of data multiple
Method processed, the data between Future Data source and current data source that Fig. 5 provides for the embodiment of the present invention three
Clone method, the method for the present embodiment realizes based on above-mentioned TableViewModel, as it is shown in figure 5,
The method that the present embodiment provides may comprise steps of:
Step 401, start to perform the copy method of TableViewSectionMuTableData.
Step 402, newly-built TableViewDataSource, NSMuTableArray.
Wherein, TableViewDataSource is newData, and NSMuTableArray is newArray.
Step 403, newData.headData=self.headData, newData.footData=self.footDa
Ta。
Step 404, traversal sectionDatas obtain sectionData.
Step 405, judge traversal whether terminate.
If traversal terminates, then perform step 406, if traversal is not over, perform step 409.
Step 406, NSArray array=[newArray copy].
Step 407, newData.sectionData=array.
Step 408, return newData.
Step 409, TableViewSectionData newSectionData=[sectionData copy].
The specific implementation of step 409 can be: first newly-built newSectionData, then performs
NewSectionData.headData=self.headData,
NewSectionData.footData=self.footData,
NewSectionData.rowData=[self.rowDatacopy], finally performs newArray
addObject:newSectionData。
On the basis of above-described embodiment one, after delay timer is then, Future Data source is replicated
Before current data source, it is also possible to judge that user interface the most shows, if user interface shows
Show, then Future Data source is copied to current data source.If user interface is not to show, then close
Delay timer.If user interface shows, then illustrate that user is current just at browsing user interface,
Need to display more new data immediately, in order to user can see more new data in time, if used
Interface, family is not currently displayed, then more new data does not displays, immediately even if because displaying
, user also will not go to see, having little significance of renewal.If user interface is not to show, will not
User interface is updated, follow-up when user actively opens user interface, it is judged that refresh counter
Whether value is 0, when the value of refresh counter is not 0, performs method for refreshing data, refreshes user circle
Face, during to ensure that user actively opens user interface, can obtain the data of renewal at once.When refreshing meter
When the value of number device is 0, illustrates do not have data to be updated, be now not required to user interface is refreshed,
The state keeping user interface is constant such that it is able to avoid user the most actively to open interface all to boundary
Face is refreshed, effectively save data traffic, and improves Consumer's Experience.In order to realize above-mentioned user interface
Not at currently displaying not refreshes user interface, need TableViewModel is added to expand attribute and side
Method.
Attribute:
BOOL isShow;
Method
-(void)viewWillAppear;
-(void)viewWillDisappear;
Wherein, attribute isShow represents that UITableView the most shows, method viewWillAppear
Calling when UITableView i.e. will appear from, method viewWillDisappear as UITableView is
Call during by disappearance.
Accordingly, in embodiment two before step 311, it is judged that isShow==true is the most correct, as
Really isShow==true is correct, then perform step 311, if isShow==true is incorrect, then
Perform step 314.
Further, on the basis of embodiment one, before start delay intervalometer, it is also possible to further
Judge that user interface the most shows, if user interface shows, then start delay intervalometer, if
User interface is not to show, then not start delay intervalometer, waits and updating next time.User interface
It is not currently displayed, illustrates that user has had been moved off the user interface being updated, update the most immediately and do not have
What meaning, thus need not opening timing device, triggering following renewal operation.
The structural representation of the refreshing apparatus of a kind of user interface that Fig. 6 provides for the embodiment of the present invention four,
As shown in Figure 6, the device that the present embodiment provides includes: change module 11, time block 12, backed stamper
Block 13 and refresh module 14.
Change module 11, for when the data of user interface are updated, is modified Future Data source,
Described Future Data source is the data source of next update data;
Time block 12, if not opening for delay timer, then starts described delay timer, described
Delay timer is for recording the delay refresh time of described user interface;
Replication module 13, for when described delay timer is to constantly, is copied to described Future Data source
Current data source, described current data source is the data source of current display data;
Refresh module 14, for performing method for refreshing data according to described current data source, refreshes described use
Interface, family;
Described time block 12 is additionally operable to after refreshing completes, and closes described delay timer.
The structural representation of the refreshing apparatus of a kind of user interface that Fig. 7 provides for the embodiment of the present invention five,
As it is shown in fig. 7, on the architecture basics of Fig. 6 shown device, the device that the present embodiment provides also includes:
First judge module 15 and the second judge module 16.
Described first judge module 15 is for being copied to described Future Data source at described replication module 13
Before current data source, it is judged that described user interface the most shows.If described user interface shows
Showing, described Future Data source is copied to described current data source by the most described replication module 13.If described use
Interface, family is not to show, the most described time block 12 closes described delay timer.
Described second judge module 16 was used for before described time block 12 starts described delay timer,
Judge that described user interface the most shows.If described user interface shows, the most described timing mould
Block 12 starts described delay timer.If described user interface is not to show, the most described time block
12 do not start described delay timer, wait and updating next time.
Optionally, the refreshing apparatus of user interface can also only include the first judge module 15 or the second judgement
Module 16.
Optionally, on the basis of the refreshing apparatus of the user interface shown in Fig. 6 and Fig. 7, at the beginning of also including
Beginningization module, described initialization module is for when initializing TableViewModle, generating described delay
Intervalometer, and create described Future Data source and current data source.
The refreshing apparatus of the user interface shown in Fig. 6 and Fig. 7, can be used for performing above-described embodiment one to reality
Executing the scheme of example three, specific implementation, with reference to the description of above-described embodiment, repeats no more here.
It should be noted that in other embodiments of the invention, the refreshing apparatus of above-mentioned user interface
Can also include counting module, counting module is for being modified it when change module 11 to Future Data source
After, the value of refresh counter is added 1, refresh counter is for recording the number of times postponing to refresh, described meter
Digital-to-analogue block 12 is additionally operable to after described time block 12 closes described delay timer, by described refreshing
The value of enumerator is set to 0.Optionally, the refreshing apparatus of this user interface can also include that the 3rd judges mould
Block, the 3rd judge module is for when user actively opens described user interface, it is judged that described refresh count
Whether the value of device is 0.Described refresh module is additionally operable to, when described 3rd judge module judges described refreshing
When the value of enumerator is not 0, performs method for refreshing data, refresh described user interface, when described refreshing
When the value of enumerator is 0, keep described user interface state constant.
One of ordinary skill in the art will appreciate that: realize all or part of step of above-mentioned each method embodiment
Suddenly can be completed by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer can
Read in storage medium.This program upon execution, performs to include the step of above-mentioned each method embodiment;And
Aforesaid storage medium includes: ROM, RAM, magnetic disc or CD etc. are various can store program code
Medium.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, rather than right
It limits;Although the present invention being described in detail with reference to foregoing embodiments, this area common
Skilled artisans appreciate that the technical scheme described in foregoing embodiments still can be modified by it,
Or the most some or all of technical characteristic is carried out equivalent;And these amendments or replacement, and
The essence not making appropriate technical solution departs from the scope of various embodiments of the present invention technical scheme.
Claims (12)
1. the method for refreshing of a user interface, it is characterised in that including:
When the data of user interface are updated, Future Data source is modified, described Future Data source
It it is the data source of next update data;
If delay timer is not opened, then starting described delay timer, described delay timer is used for remembering
Record the delay refresh time of described user interface;
When described delay timer is to constantly, described Future Data source is copied to current data source, described
Current data source is the data source of current display data;
Perform method for refreshing data according to described current data source, refresh described user interface;
After refreshing completes, close described delay timer.
Method the most according to claim 1, it is characterised in that described that described Future Data source is multiple
Before system is to current data source, described method also includes:
Judge that described user interface the most shows;
If described user interface shows, then described Future Data source is copied to described current data source;
If described user interface is not to show, then close described delay timer.
Method the most according to claim 1, it is characterised in that the described delay timer of described startup
The most also include:
Judge that described user interface the most shows;
If described user interface shows, then start described delay timer;
If described user interface is not to show, the most do not start described delay timer, wait next time
Update.
Method the most according to claim 1, it is characterised in that described when the data quilt of user interface
During renewal, call Future Data source method, before Future Data source is modified, also include:
When initializing TableViewModle, generate described delay timer, and create described following number
According to source and current data source.
5. according to the method described in any one of claim 1-4, it is characterised in that described work as user interface
Data when being updated, after Future Data source is modified, also include:
Adding 1 by the value of refresh counter, described refresh counter is for recording the number of times postponing to refresh;
Described after refreshing completes, after closing described delay timer, also include:
The value of refresh counter is set to 0.
Method the most according to claim 5, it is characterised in that also include:
When user actively opens described user interface, it is judged that whether the value of described refresh counter is 0;
When the value of described refresh counter is not 0, performs method for refreshing data, refresh described user circle
Face;
When the value of described refresh counter is 0, keep described user interface state constant.
7. the refreshing apparatus of a user interface, it is characterised in that including:
Change module, for when the data of user interface are updated, is modified Future Data source,
Described Future Data source is the data source of next update data;
Time block, if not opening for delay timer, then starts described delay timer, described in prolong
Intervalometer is for recording the delay refresh time of described user interface late;
Replication module, for when described delay timer is to constantly, is copied to described Future Data source work as
Front data source, described current data source is the data source of current display data;
Refresh module, for performing method for refreshing data according to described current data source, refreshes described user
Interface;
Described time block is additionally operable to after refreshing completes, and closes described delay timer.
Device the most according to claim 7, it is characterised in that also include the first judge module;
Described first judge module is for being copied to current number at described replication module by described Future Data source
Before source, it is judged that described user interface the most shows;
If described user interface shows, described Future Data source is copied to institute by the most described replication module
State current data source;
If described user interface is not to show, the most described time block closes described delay timer.
Device the most according to claim 7, it is characterised in that also include the second judge module;
Described second judge module is before starting described delay timer at described time block, it is judged that
Described user interface the most shows;
If described user interface shows, the most described time block starts described delay timer;
If described user interface is not to show, the most described time block does not start described delay timer,
Wait and updating next time.
Device the most according to claim 7, it is characterised in that also include initialization module;
Described initialization module is used for, when initializing TableViewModle, generating described delay timer,
And create described Future Data source and current data source.
11. according to the device described in any one of claim 7-10, it is characterised in that also include:
Counting module, for after Future Data source is modified by described change module, counts refreshing
The value of number device adds 1, and described refresh counter is for recording the number of times postponing to refresh;
Described counting module is additionally operable to, after described time block closes described delay timer, by institute
The value stating refresh counter is set to 0.
12. devices according to claim 11, it is characterised in that also include:
3rd judge module, for when user actively opens described user interface, it is judged that described refreshing meter
Whether the value of number device is 0;
Described refresh module is additionally operable to, when described 3rd judge module judges the value of described refresh counter not
When being 0, perform method for refreshing data, refresh described user interface;
When the value of described refresh counter is 0, keep described user interface state constant.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610284654.0A CN105955777A (en) | 2016-05-03 | 2016-05-03 | User interface refreshing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610284654.0A CN105955777A (en) | 2016-05-03 | 2016-05-03 | User interface refreshing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105955777A true CN105955777A (en) | 2016-09-21 |
Family
ID=56913398
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610284654.0A Pending CN105955777A (en) | 2016-05-03 | 2016-05-03 | User interface refreshing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105955777A (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107329795A (en) * | 2017-06-23 | 2017-11-07 | 北京酷我科技有限公司 | A kind of TableView optimization methods |
CN107977068A (en) * | 2016-10-25 | 2018-05-01 | 中兴通讯股份有限公司 | The method, apparatus and terminal of a kind of delay display of terminal |
CN108108091A (en) * | 2017-11-28 | 2018-06-01 | 贵阳语玩科技有限公司 | The refreshing display methods and system of sliding trace |
CN108228300A (en) * | 2018-01-02 | 2018-06-29 | 武汉斗鱼网络科技有限公司 | The method and device that a kind of control content refreshes in real time |
CN108234624A (en) * | 2017-12-29 | 2018-06-29 | 贵阳语玩科技有限公司 | The processing method and system of request of data |
CN108337538A (en) * | 2017-01-20 | 2018-07-27 | 创盛视联数码科技(北京)有限公司 | A method of live streaming delay is eliminated based on Flash player |
CN108694066A (en) * | 2018-05-09 | 2018-10-23 | 北京酷我科技有限公司 | A kind of method that tableView delays refresh |
CN109218824A (en) * | 2018-09-29 | 2019-01-15 | 视联动力信息技术股份有限公司 | A kind of method and apparatus of business processing |
CN109634599A (en) * | 2018-12-14 | 2019-04-16 | 北京字节跳动网络技术有限公司 | Display methods, device, equipment and the storage medium of page view |
CN109725978A (en) * | 2019-01-22 | 2019-05-07 | Oppo广东移动通信有限公司 | Window refreshing method, device, electronic equipment and storage medium |
CN109783329A (en) * | 2018-12-04 | 2019-05-21 | 深圳市酷达通讯有限公司 | Application program clear data reminding method, system and terminal device |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
CN114356334A (en) * | 2022-01-20 | 2022-04-15 | 山东捷瑞数字科技股份有限公司 | TableView-based mobile terminal dynamic form generation method and device |
CN116088836A (en) * | 2022-12-09 | 2023-05-09 | 广州市保伦电子有限公司 | Tableview-based data page display method and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5907681A (en) * | 1997-10-20 | 1999-05-25 | International Business Machines Corporation | Intelligent method, apparatus and computer program product for automated refreshing of internet web pages |
CN101196934A (en) * | 2008-01-03 | 2008-06-11 | 中兴通讯股份有限公司 | Method and device for optimizing user interactive performance of built-in browser |
CN102013247A (en) * | 2009-09-08 | 2011-04-13 | 北大方正集团有限公司 | Refreshing control method and system of electronic paper screen |
CN102411496A (en) * | 2010-09-21 | 2012-04-11 | 宏碁股份有限公司 | Window-refreshing control method and system |
CN103036769A (en) * | 2012-12-12 | 2013-04-10 | 北京奇虎科技有限公司 | Method and breathing light for message prompt |
US20140368519A1 (en) * | 2013-06-13 | 2014-12-18 | Microsoft Corporation | Managing Transitions of Adaptive Display Rates for Different Video Playback Scenarios |
CN105094826A (en) * | 2015-07-23 | 2015-11-25 | 上海斐讯数据通信技术有限公司 | Response method and device thereof for interactive interface views in client terminal system |
-
2016
- 2016-05-03 CN CN201610284654.0A patent/CN105955777A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5907681A (en) * | 1997-10-20 | 1999-05-25 | International Business Machines Corporation | Intelligent method, apparatus and computer program product for automated refreshing of internet web pages |
CN101196934A (en) * | 2008-01-03 | 2008-06-11 | 中兴通讯股份有限公司 | Method and device for optimizing user interactive performance of built-in browser |
CN102013247A (en) * | 2009-09-08 | 2011-04-13 | 北大方正集团有限公司 | Refreshing control method and system of electronic paper screen |
CN102411496A (en) * | 2010-09-21 | 2012-04-11 | 宏碁股份有限公司 | Window-refreshing control method and system |
CN103036769A (en) * | 2012-12-12 | 2013-04-10 | 北京奇虎科技有限公司 | Method and breathing light for message prompt |
US20140368519A1 (en) * | 2013-06-13 | 2014-12-18 | Microsoft Corporation | Managing Transitions of Adaptive Display Rates for Different Video Playback Scenarios |
CN105094826A (en) * | 2015-07-23 | 2015-11-25 | 上海斐讯数据通信技术有限公司 | Response method and device thereof for interactive interface views in client terminal system |
Non-Patent Citations (2)
Title |
---|
埃斯普斯托(ESPOSITO,D.)著: "《Microsoft ASP. NET AJAX导学》", 30 June 2008, 机械工业出版社 * |
青岛英谷教育科技股份有限公司编著: "《电子商务产品经理》", 31 July 2015, 西安电子科技大学出版社 * |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107977068A (en) * | 2016-10-25 | 2018-05-01 | 中兴通讯股份有限公司 | The method, apparatus and terminal of a kind of delay display of terminal |
WO2018076698A1 (en) * | 2016-10-25 | 2018-05-03 | 西安中兴新软件有限责任公司 | Terminal delay display method and apparatus, and terminal and computer storage medium |
CN108337538A (en) * | 2017-01-20 | 2018-07-27 | 创盛视联数码科技(北京)有限公司 | A method of live streaming delay is eliminated based on Flash player |
CN108337538B (en) * | 2017-01-20 | 2022-01-11 | 创盛视联数码科技(北京)有限公司 | Method for eliminating live broadcast delay based on Flash player |
CN107329795A (en) * | 2017-06-23 | 2017-11-07 | 北京酷我科技有限公司 | A kind of TableView optimization methods |
CN108108091A (en) * | 2017-11-28 | 2018-06-01 | 贵阳语玩科技有限公司 | The refreshing display methods and system of sliding trace |
CN108234624A (en) * | 2017-12-29 | 2018-06-29 | 贵阳语玩科技有限公司 | The processing method and system of request of data |
CN108228300B (en) * | 2018-01-02 | 2021-03-16 | 武汉斗鱼网络科技有限公司 | Method and device for controlling real-time refreshing of content |
CN108228300A (en) * | 2018-01-02 | 2018-06-29 | 武汉斗鱼网络科技有限公司 | The method and device that a kind of control content refreshes in real time |
CN108694066B (en) * | 2018-05-09 | 2021-04-27 | 北京酷我科技有限公司 | TableView delayed refreshing method |
CN108694066A (en) * | 2018-05-09 | 2018-10-23 | 北京酷我科技有限公司 | A kind of method that tableView delays refresh |
CN109218824B (en) * | 2018-09-29 | 2021-02-12 | 视联动力信息技术股份有限公司 | Service processing method and device |
CN109218824A (en) * | 2018-09-29 | 2019-01-15 | 视联动力信息技术股份有限公司 | A kind of method and apparatus of business processing |
CN109783329A (en) * | 2018-12-04 | 2019-05-21 | 深圳市酷达通讯有限公司 | Application program clear data reminding method, system and terminal device |
CN109783329B (en) * | 2018-12-04 | 2022-07-19 | 深圳市酷达通讯有限公司 | Application program blank data prompting method and system and terminal equipment |
CN109634599A (en) * | 2018-12-14 | 2019-04-16 | 北京字节跳动网络技术有限公司 | Display methods, device, equipment and the storage medium of page view |
CN109725978A (en) * | 2019-01-22 | 2019-05-07 | Oppo广东移动通信有限公司 | Window refreshing method, device, electronic equipment and storage medium |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
CN114356334A (en) * | 2022-01-20 | 2022-04-15 | 山东捷瑞数字科技股份有限公司 | TableView-based mobile terminal dynamic form generation method and device |
CN114356334B (en) * | 2022-01-20 | 2022-08-05 | 山东捷瑞数字科技股份有限公司 | TableView-based mobile terminal dynamic form generation method and device |
CN116088836A (en) * | 2022-12-09 | 2023-05-09 | 广州市保伦电子有限公司 | Tableview-based data page display method and system |
CN116088836B (en) * | 2022-12-09 | 2023-11-21 | 广东保伦电子股份有限公司 | Tableview-based data page display method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105955777A (en) | User interface refreshing method and device | |
Overkamp | Supervisory control using failure semantics and partial specifications | |
WO2020019458A1 (en) | Page switching method of hybrid application, framework, computer device and storage medium | |
US7533135B2 (en) | Methods and systems for reducing database accesses in an object-oriented system | |
CN107908336B (en) | Method for refreshing, device, storage medium and the terminal of list control | |
CN103514038B (en) | A kind of smooth method for closing and system of virtual system | |
JP2009512909A (en) | Partial caching and modification of multidimensional databases on user equipment | |
Cury et al. | Supervisory control of discrete event systems with distinguishers | |
CN110427342A (en) | A kind of method, equipment and readable medium creating mirror site | |
CN108304269A (en) | A kind of sending, receiving method of data, device and communications framework | |
EP3369006A1 (en) | Techniques for application undo and redo using sql patchsets or changesets | |
CN109409531A (en) | A kind of machine learning method, device and equipment based on serializing file | |
CN101206614A (en) | Simulator for simulating register with specific function | |
Ding et al. | Numerically representing stochastic process algebra models | |
CN107545060A (en) | A kind of method for limiting speed and device of redis principals and subordinates full dose synchrodata | |
US8818783B2 (en) | Representing state transitions | |
JP3505174B2 (en) | Data processing device | |
CN109388505B (en) | A kind of asynchronous multitask sequence loading method based on Android | |
CN110134340A (en) | A kind of method, apparatus of metadata updates, equipment and storage medium | |
CN106528082A (en) | FPGA (Field Programmable Gate Array)-based graphical configuration method and device | |
CN114064322A (en) | Software host construction method, construction system, software host and simulation equipment | |
CN107589978B (en) | Method and device for refreshing page in Flash | |
CN105023319B (en) | A kind of method and system of brake data storage | |
CN112567354A (en) | Modifying configuration of a port hub | |
JP2001154881A (en) | Simulation device and program recording medium to be used for the same device |
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: 20160921 |
|
RJ01 | Rejection of invention patent application after publication |