CN109471689A - Interface display driving method, device, electronic equipment and storage medium - Google Patents
Interface display driving method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109471689A CN109471689A CN201811162433.1A CN201811162433A CN109471689A CN 109471689 A CN109471689 A CN 109471689A CN 201811162433 A CN201811162433 A CN 201811162433A CN 109471689 A CN109471689 A CN 109471689A
- Authority
- CN
- China
- Prior art keywords
- interface
- adapter
- data
- layer
- boundary layer
- 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/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Abstract
The present invention provides a kind of interface display driving method, device, electronic equipment and readable storage medium storing program for executing;Wherein, which comprises model layer is received in response to interface data caused by user's operation, and is sent to process layer;The process layer initializes the adapter according to the interface data, and handles the interface data, will handle resulting data result and is sent to the adapter;The adapter refreshes the currently displayed interface of the boundary layer according to the data result.Thus the present invention can mitigate boundary layer and the burden of developer, effectively improve the utilization rate to process layer.
Description
Technical field
The present invention relates to processing technology of interface field more particularly to interface display actuation techniques fields.
Background technique
Various applications in mobile terminal usually require to show each information, the exhibition of view list in the form of view list
Show and is generally realized by MVC (Model-View-Controller, model-view-controller) framework.Wherein, Model is responsible for
Storing data, View are responsible for display interface, and Controller is responsible for ensuring that the data of view object and model object are consistent.
But in IOS exploitation, every display for realizing a view list (UITableView or UICollectionView),
Controller requires access API (Application Programming Interface, using journey relevant to list
Sequence programming interface), to continually come into contacts with the call back function being stored in View;In such event, Controller and
The interface of View must be coupled.In display interface list, Controller obtains interface view list from Model
Data, and after being handled by data result back in View so that View by multiple call back functions to data result again
It is handled and realizes interface and update.
It follows that needing to preserve the call back function of multiple lists in View, even if there are duplicate portions for call back function
Point, common mathematical function such as relevant to list line number, row height, row content, it is also desirable to which developer writes one by one, not only increases exploitation
The burden of personnel, and code redundancy is caused, occupy the space of View.Also, View should only responsible display interface, but reality
It has been also responsible for data processing, the responsibility of Controller is caused to lack.
Summary of the invention
Based on this, the present invention provides a kind of interface display driving method, device, electronic equipment and computer-readable storage medium
Matter.
According to a first aspect of the embodiments of the present invention, the present invention provides a kind of interface display driving methods, including model
Layer, boundary layer, process layer and adapter;The model layer is for storing interface data;The boundary layer is used for display interface;Institute
Process layer is stated for handling the interface data;The adapter is for refreshing the interface bound in the boundary layer with it;Institute
The method of stating includes:
The model layer is received in response to interface data caused by user's operation, and is sent to the process layer;
The process layer initializes the adapter according to the interface data, and handles the interface data,
Resulting data result will be handled and be sent to the adapter;
The adapter refreshes the currently displayed interface of the boundary layer according to the data result.
It is realized as a result, relative to the relevant technologies by the interaction between API Controller related and cumbersome to list
List creating or the mode of refreshing, the callback method of interface related proxy by being converted into the number of process layer by the embodiment of the present invention
According to driving interface, that is, process layer refreshes interface shown by boundary layer with data result driving adapter --- process layer will
Adapter is transmitted directly to the resulting data result of interface data processing, as the data source of adapter, drives adapter root
Directly refresh interface shown by boundary layer according to data result.Do not have to data result being sent to boundary layer, interface to realize
Layer need to only be responsible for display interface in practice, do not need storage call back function, also do not need to handle interface data, be conducive to
Reduce the computational burden of boundary layer.Data processing is all concentrated on into process layer simultaneously, has preferably played the responsibility of process layer, and
Effectively improve the utilization rate to process layer.In addition, how identical developer only need to increase when needing to show multiple lists
One adapter, and increased adapter is initialized to bind corresponding list by process layer, do not need developer
Again essentially identical function code is write one by one, advantageously reduces the burden of developer.In such event, it advantageously reduces soft
The complexity of part system improves the maintainability and expansibility of software systems.
Optionally, the process layer initializes the adapter according to the interface data, comprising:
The interface data received is sent to boundary layer, and by the boundary layer is assigned to the interface data described
Adapter, to initialize the adapter;
Wherein, the adapter after being initialised is directed toward the interface list of the current desired display of the boundary layer.
The embodiment of the present invention initializes the adapter using boundary layer by process layer as a result, realizes interface
The list shown needed for layer can be reduced with corresponding adapter bundle to code relevant to list of bindings in adapter
Write, reduce the data-interface between process layer and adapter, and guarantee that adapter can accurately be directed toward corresponding list.
Optionally, the interface data is handled, resulting data result will be handled and be sent to the adapter, wrapped
It includes:
The interface data is handled, the high and each row of list line number, each every trade at the interface of current desired display is at least obtained
Content;
The high and each row content of the list line number, each every trade is arranged with specified format, obtains meeting the specified format
Data result;
The data result is sent to the adapter.
The embodiment of the present invention is equivalent to by the format of restriction data result and defines the number for being input to adapter as a result,
According to the format in source, realize that each call back function in adapter can directly obtain corresponding input data according to data result, and
It realizes the refreshing to interface, to not only simplify the arithmetic operation of adapter, and is able to solve because data source is with a variety of
The quantity of call back function caused by format increases the problem of increasing with algorithm complexity.
Optionally, the interface display driving method of the embodiment of the present invention further include:
After the adapter receives the data result, judge the data result format whether with the specified format
Matching;
If the format of the data result and the specified format mismatch, error message is returned to the processing
Layer, to remind the process layer transmission to meet the data result of the specified format.
Although in the process of development, being generally not in the case where data result format is not inconsistent, the embodiment of the present invention
Still through adapter when receiving the data result that format is not inconsistent, error message is returned to process layer, adapter may be implemented
It can be suitable for the process layer of other exploitation environment or other structures, be conducive to the practicability for improving adapter and guarantee interface energy
Enough normal and accurate display.
Optionally, if the adapter is at least preserved with data all types of in the data result correspondingly
Dry call back function;
The adapter according to the data result refresh the boundary layer shown by interface, comprising:
According to the data result, the high and each row of list line number, each every trade at the interface of current desired display is obtained respectively
Content;
List line number, the high and each row content of each every trade are inputted into corresponding call back function respectively;
Pass through interface shown by corresponding call back function boundary layer according to the Refresh Data inputted.
Adapter provided by the embodiment of the present invention only needs to obtain what current interface was included from data result as a result,
The data of element, such as list line number, the high and each row content of each every trade, and by corresponding call back function according to currently being inputted
Refresh Data interface is conducive to simplify the mathematical algorithm for refreshing interface.
Optionally, the quantity phase for the list that the interface of the quantity of the adapter and the current desired display of boundary layer is included
Together, and all adapters and all lists are corresponded and are mutually bound.
The embodiment of the present invention passes through above-mentioned restriction, when can guarantee that boundary layer needs to show multiple lists, Duo Gelie as a result,
Table can be shown simultaneously and normally, advantageously account for realizing logical miss caused by the display of multiple lists with an adapter
With the problem of logic complexity.
Optionally, the adapter also preserves instruction call back function corresponding with user instruction, the user instruction by
User generates the operation of current interface;The method also includes:
The adapter receives the user instruction sent by operating system, and is referred to the user by instruction call back function
Order passes to the process layer;
The process layer handles interface display logic according to the user instruction, obtains interface display effect, and pass through boundary
Surface layer shows the interface display effect.
The disclosure refers to user by increasing instruction call back function in adapter, and by instruction call back function as a result,
Order passes to the process layer, so that the processor is handled display interface logic according to the user instruction, and processing is obtained
Interfacial effect pass through boundary layer show;Be conducive to the management for being further reduced boundary layer to data, enhance the benefit to adapter
With rate, while but also showing interface is more animation, user experience effect is improved.
According to a second aspect of the embodiments of the present invention, corresponding with the interface display driving method, the present invention also provides
A kind of interface display driving device, described device include model layer module, boundary layer module, process layer module and adapter;
Model layer module, for storing and receiving in response to interface data caused by user's operation, and to the processing
Layer module is sent;
Boundary layer module is used for display interface;
Process layer module for initializing the adapter according to the interface data, and carries out the interface data
Processing, will handle resulting data result and is sent to the adapter;
Adapter, for refreshing the currently displayed interface of the boundary layer module according to the data result.
According to a third aspect of the embodiments of the present invention, a kind of electronic equipment is provided, the electronic equipment includes:
Processor;
Memory, for storing the computer program that can be executed by the processor;
Wherein, the step of realizing the interface display driving method when processor executes described program.
According to a fourth aspect of the embodiments of the present invention, the present invention also provides a kind of computer readable storage mediums, thereon
The step of being stored with computer program, the interface display driving method realized when described program is executed by processor.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of present invention structural schematic diagram of display driving system shown according to an exemplary embodiment;
Fig. 2 is a kind of present invention flow chart of interface display driving method shown according to an exemplary embodiment;
Fig. 3 is a kind of present invention step flow chart of step S11 shown according to an exemplary embodiment;
Fig. 4 is a kind of present invention step flow chart of step S12 shown according to an exemplary embodiment;
Fig. 5 is a kind of present invention flow chart of interface display driving method shown according to an exemplary embodiment;
Fig. 6 is a kind of present invention structural block diagram of interface display driving device shown according to an exemplary embodiment;
Fig. 7 is the structural block diagram for a kind of electronic equipment that the present invention is illustrated according to one.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is only to be not intended to limit the invention merely for for the purpose of describing particular embodiments in terminology used in the present invention.
It is also intended in the present invention and the "an" of singular used in the attached claims, " described " and "the" including majority
Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the present invention
A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from
In the case where the scope of the invention, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination ".
In interface display actuation techniques field, generally pass through MVC (Model-View-Controller, model-at present
View-Controller) each information in the view of applications various in mobile terminal is shown.The interface of Controller and
The interface of View, which is typically necessary, to be coupled, that is, it is every realize view list (UITableView or
UICollectionView display), Controller requires access API relevant to list, thus with interface is stored in
Call back function in layer View is come into contacts with.Wherein, when showing multiple lists, View is needed through multiple call back functions pair
The data result that Controller is returned is handled and realizes interface and update.Therefore, it needs to preserve multiple column in View
The call back function of table, even if there are duplicate parts for call back function, common letter such as relevant to list line number, row height, row content
Number, it is also desirable to which developer writes one by one, not only increases the burden of developer, but also causes code redundancy, occupies View's
Space.Also, View should only responsible display interface, but be actually also responsible for data processing, led to the responsibility of Controller
Missing, and increase the computational burden of View.
Based on this, to overcome above-mentioned technical problem present in the relevant technologies, the embodiment of the invention provides a kind of interfaces
Display driving method, device, electronic equipment and computer readable storage medium, relative to the relevant technologies by Controller with
List is related and cumbersome API between interaction realize the mode of list creating or refreshing, the embodiment of the present invention is by by interface
The callback method of related proxy is converted into the data-driven interface of process layer, that is, process layer drives adapter with data result
Interface --- process layer will be transmitted directly to be adapted to the resulting data result of interface data processing shown by refreshing boundary layer
Device drives adapter directly to refresh interface shown by boundary layer according to data result as the data source of adapter.To real
Not having to now data result being sent to boundary layer, boundary layer need to only be responsible for display interface in practice, storage call back function is not needed,
It does not need to handle interface data, advantageously reduces the computational burden of boundary layer yet.Data processing is all concentrated on simultaneously
Process layer, has preferably played the responsibility of process layer, and effectively improves the utilization rate to process layer.In addition, more when needing to show
When a list, developer only needs to increase a how identical adapter, and initializes increased adapter by process layer
To bind corresponding list, does not need developer and write essentially identical function code one by one again, advantageously reduce
The burden of developer.In such event, the complexity for advantageously reducing software systems, improve software systems maintainability and can
Expansion.
In the embodiment of the present invention, the interface display driving method be can be applied in terminal, so that terminal has driving
Interface display is in the function on display screen.Wherein, the terminal can be at least one of: plate, mobile phone, personal assistant,
Smartwatch, Medical Devices.For example, at least the interface display driving method can be applied to following scene: aobvious in terminal
In the case where being shown with application interface, when receiving the instruction that user's operation is triggered, new interface number is obtained according to described instruction
According to realize according to the interface data update current interface currently obtained.For example, it is assumed that the application interface that terminal is shown is connection
The list of people interface, then, described instruction can be clicked a certain control in contact person interface list, or a certain control of sliding by user
Part (such as TableView), or slided produced by the contact person interface list with assigned direction.These operations will all generate newly
Interface data, so that terminal updates current interface according to the new interface data, for example, it is assumed that described instruction is slided by user
A certain control so that not shown list display produced by current interface, then, updated interface display has list upper
Not shown content in one interface.
Before executing the interface display driving method, the pre-configured interface display of the embodiment of the present invention
The application environment of driving method, for example, the corresponding program module of the good interface display driving method is developed, so that the boundary
Face display driving method can be applied in above-mentioned mentioned scene.Wherein, as shown in Figure 1, Fig. 1 is that the present invention shows according to one
Example property implements a kind of structural schematic diagram of the display driving system exemplified;It is pre-configured with what a display driving system, it is described
Display driving system includes model layer, boundary layer, process layer and adapter.The model layer is for storing interface data.It is described
Boundary layer is used for display interface.The process layer is for handling the interface data.The adapter is for refreshing the interface
The interface bound in layer with it.Wherein, an interface corresponds to a model layer, a boundary layer, a process layer and at least
One adapter.Wherein, adapter can be bound in advance with list corresponding in boundary layer in the development phase, can also be made
Binding is realized in a manner of making the two be directed toward same memory address assignment with the stage.
It is illustrated next, being provided for the embodiments of the invention interface display driving method.
As shown in Fig. 2, Fig. 2 is a kind of present invention stream of interface display driving method shown according to an exemplary embodiment
Cheng Tu, the interface display driving method of the present embodiment the following steps are included:
S10, model layer are received in response to interface data caused by user's operation, and are sent to process layer;
S11, handled layer initializes adapter according to the interface data, and handles the interface data, will
It handles resulting data result and is sent to the adapter;
S12, the adapter refresh the currently displayed interface of the boundary layer according to the data result.
In the step S10, content documented by the interface data may include at least one of: list memory
Location, the list line number at the interface of current desired display, each every trade be high, each row content, list display pattern, current desired display
Other attributes of an element in interface except above-mentioned points.Wherein, attribute at least may include color attribute, text formatting attribute and/
Or shape attribute.In the present embodiment, this is not construed as limiting.
In the step S11, process layer can initialize adapter by boundary layer, can also be by between adapter
Initialization interface is established, realizes the initialization to adapter.In the present embodiment, to reduce to related to list of bindings in adapter
Code write, reduce the data-interface between process layer and adapter, and guarantee that adapter can accurately be directed toward correspondence
List, using process layer pass through boundary layer initialize adapter this scheme.Specifically, the process layer is to adapter
Initialization may comprise steps of:
The interface data received is sent to boundary layer by S111, and by the boundary layer by the interface data assignment
To the adapter, to initialize the adapter.
In the step S111, the adapter after initialization is directed toward the interface list of the current desired display of the boundary layer.
Wherein, the purpose for initializing adapter is for bundled adapters and its corresponding list.Pass through the step S111, interface
List and corresponding adapter in layer all point to same memory address, it can be understood as, interface data is assigned to adapter
Refer to and the list memory address information that interface data is included is assigned to adapter, so that boundary layer and adapter all point to together
One list.Wherein, the particular technique means for realizing the list binding shown needed for adapter and boundary layer, in combination with the present embodiment
Related content and this field the relevant technologies learn that this will not be repeated here.
It is the arithmetic operation of reducing adaptor in the step S11, and solves caused by there is multiple format because of data source
The quantity of call back function increases the problem of increasing with algorithm complexity, as shown in figure 3, Fig. 3 is the present invention according to an exemplary reality
The step flow chart of the step S11 exemplified a kind of is applied, the process layer may comprise steps of the processing of interface data:
S112 handles the interface data, at least obtain the list line number at the interface of current desired display, each every trade it is high and
Each row content;
S113 arranges the high and each row content of the list line number, each every trade with specified format, obtains meeting the specified lattice
The data result of formula;
The data result is sent to the adapter by S114.
In the step S112, at least handled according to interface data obtain the interface of current desired display list line number,
The visible this field the relevant technologies of the specific implementation means of each every trade height and each row content, this will not be repeated here.In addition, to the interface
The data that data processing obtains can also obtain the display sample of list other than list line number, the high and each row content of each every trade
The color or pattern of text, number, letter, picture, and/or figure that formula, each row content are included.
In the step S113, the data result of process layer output is the data source of the adapter, therefore, described specified
Format is not only the input format of the output format of data result and the data source of adapter.It is arranged with specified format by institute
Stating the data that step S112 is handled can refer to: save the number that the step S112 is handled with the matrix form of 1 × n
According to, wherein the high and each row content of list line number, each every trade position in the 1 × n matrix respectively can be appointed in advance,
For example, it is assumed that only one list, list shares 5 rows, then, the position arranged in advance can be with are as follows: list line number is arranged in institute
State the 1st in 1 × n matrix, each every trade height from the first row to fifth line sequential in the 1 × n matrix the 2nd~6
Position, the 7th~11 from the first row to fifth line sequential in the 1 × n matrix of each row content;Based on this, accorded with
The data result for closing the specified format can be [5, h1, h2, h3, h4, h5, nr1, nr2, nr3, nr4, nr5], wherein institute
Stating 5 in data result indicates that list line number is that 5, h1 indicates that the first every trade is high, and h2 indicates that the second every trade is high, and h3 indicates the third line
Row is high, and h4 indicates that fourth line row is high, and h5 indicates that fifth line row is high, and nr1 indicates the first row content, and nr2 indicates the second row content,
Nr3 indicates the third line content, and nr4 indicates fourth line content, and nr5 indicates fifth line content.In addition, in other embodiments, also
The data result can be exported by the matrix or data structure of extended formatting, for example, the specified format can be array,
As long as the output of data result meets specified format, therefore is not defined herein to specified format.
It, can be by establishing data transmission interface between process layer and adapter, and at realization in the step S114
Data result can be sent to the adapter by reason layer.
In the step S12, adapter refreshes the currently displayed interface of the boundary layer according to the data result, is
It does not need just to be able to achieve the refreshing to interface again by data result back to the boundary layer.Because from aforementioned to the step
The explanation of rapid S111 in the adapter with the interface of the current desired display of boundary layer or list it is found that bind, and the two
It is mutually binding by the same memory address realization list of direction, so, adapter updates corresponding number according to data result
According to when, the list on corresponding memory address is also synchronized to update.In such event, adapter does not need after being updated according to data result
Data back in boundary layer, so that it may realize that interface updates.
In an optional embodiment, the adapter is at least preserved and data all types of in the data result
One-to-one several call back functions, for example, list row height is corresponding with the high call back function of row, list line number is corresponding with line number
Call back function, each row content are corresponding with the readjustment line number that content is shown.Based on this, as shown in figure 4, Fig. 4 is the present invention according to one
The step flow chart of step S12 shown in exemplary embodiment a kind of, the step S12 may comprise steps of:
S121, according to the data result, obtain respectively the list line number at the interface of current desired display, each every trade it is high and
Each row content;
List line number, the high and each row content of each every trade are inputted corresponding call back function by S122 respectively;
S123 passes through interface shown by corresponding call back function boundary layer according to the Refresh Data inputted.
In the step S121~S123, from the explanation to the step S113 it is found that due to the data result be with
The specified format is input in the adapter, so the adapter is only needed according to each data in specified format
The position appointed in advance, so that it may data needed for obtaining list update, and different types of data are separately input to pair
In the call back function answered, the list in interface shown by the boundary layer can be refreshed by call back function.
As a result, by the step S121~S123, adapter provided by the embodiment of the present invention is only needed from data knot
The data that the current interface element that is included is obtained in fruit, such as list line number, each every trade is high, each row content and list style, and
By corresponding call back function according to the Refresh Data interface currently inputted, be conducive to simplify the operation calculation for refreshing interface
Method.
In addition, multiple lists can be shown simultaneously and normally, for when guaranteeing that boundary layer needs to show multiple lists to solve
The problem of logical miss caused by the display of multiple lists and logic complexity, the number of the adapter are realized with an adapter
Amount is identical as the quantity of list that the interface of the current desired display of boundary layer is included, and all adapters and all lists are one by one
It corresponds to and mutually binds.So, if an interface display has several lists, an interface in this case is corresponding
If a model layer, a boundary layer, a process layer and with the one-to-one adapter stem of several lists.
In one embodiment, it is based on the basis of aforementioned any embodiment, as shown in figure 5, Fig. 5 is that the present invention shows according to one
Example property implements a kind of flow chart of the interface display driving method exemplified, the interface display driving side of the embodiment of the present invention
Method can with the following steps are included:
S12a, after the adapter receives the data result, judge the data result format whether with the finger
Determine format match;
S12b returns to error message to described if the format of the data result and the specified format mismatch
Process layer, to remind the process layer transmission to meet the data result of the specified format.
In such event, change to being adapted to property the execution condition of the step S12, e.g., the step S12 is in the number
It is executed when being matched according to the format of result with the specified format.
In the step S12a, the judgement to the format of data result can be accomplished by the following way: if the finger
The formula of fixing is 1 × n matrix, it is possible to judge whether the data result is 1 × n matrix, if so, showing data result
Format matched with specified format, if it is not, then show data result format and specified format mismatch.Similarly, if it is specified
Format is extended formatting, and data result should also be corresponding format, that is to say, that can by both judge format whether phase
With both determining whether format matches.Certainly, in other examples, the lattice to data result can also be realized by other means
The judgement of formula, it is numerous to list herein.
In the step S12b, the error message may include: the specified format of the data source of adapter.Exist as a result,
After the process layer receives the error message, what the process layer can be exported according to adjustment in the error message
The format of data result, so that the format of the data result of output is matched with the specified format of the data source of adapter.Wherein, locate
Manage layer realized according to error message the specific implementation means of adjustment to the format of data result in combination with the embodiment of the present invention and
This field the relevant technologies are learnt, herein without repeating.
Although in the process of development, being generally not in the case where data result format is not inconsistent, the embodiment of the present invention
Still through adapter when receiving the data result that format is not inconsistent, error message is returned to process layer, adapter may be implemented
It can be suitable for the process layer of other exploitation environment or other structures, be conducive to the practicability for improving adapter and guarantee interface energy
Enough normal and accurate display.
In one embodiment, based on the basis of aforementioned any embodiment, the adapter can also preserve and user
Corresponding instruction call back function is instructed, the user instruction generates the operation of current interface by user.Wherein, the user refers to
It includes but is not limited to following any for enabling: the instruction that interface list row generates after being clicked, some control of interface list are clicked
Instruction that the instruction generated afterwards, interface or control generate after being slided, page jump instruction, page furbishing instruction.
Based on this, the method can with the following steps are included:
S13, the adapter receive the user instruction sent by operating system, and by instructing call back function by the use
Family instruction passes to the process layer;
S14, the process layer handle interface display logic according to the user instruction, obtain interface display effect, and lead to
It crosses boundary layer and shows the interface display effect.
The interface display effect can include but is not limited to following any: the jump at next interface is jumped to from current interface
The presentation effect for turning over journey is popped up from current interface back to the presentation effect of the return course at a upper interface in current interface
The presentation effect of the ejection process of dialog box.
Step S13~the S14 can be executed parallel with the step S10~S12, that is to say, that sequentially execute institute
While stating step S10~S12, the step S13~S14 is also sequentially executed.Wherein it is possible to which it is aobvious that the interface is presented at interface
After showing effect, then refresh interface.
For convenience of the expansion and the improvement in later period of instruction call back function, for example, if following there is the user of new type
Instruction, then the corresponding instruction call back function of user instruction of new type can be increased in adapter, without
Modify other instruction call back functions in adapter;In one embodiment, described instruction call back function includes and several inhomogeneities
The one-to-one some instructions call back function of the user instruction of type.For example, page jump instruction is corresponding with page jump and instructs back
Letter of transfer number, page furbishing instruction are corresponding with page furbishing instruction call back function.
In another embodiment, can will instruction call back function and with all types of data in the data result one by one
A part of subprogram of the corresponding several call back functions as tabulated function, for example, adapter is preserved and the column in boundary layer
The tabulated function of table binding, preserves several call back functions and described instruction call back function in the tabulated function.In work
During work, firstly, the tabulated function can receive the data result inputted by the process layer and operating system input
User instruction;Then, the various types of data taken out from data result are separately input to corresponding readjustment by tabulated function
Function, and type according to user instructions is entered into corresponding instruction call back function;It is achieved in and passes through data result
Call back function refresh the interface in the boundary layer, while user instruction is passed to by process layer by instruction call back function,
The interface display effect handled according to user instructions is shown by boundary layer by process layer.
The disclosure refers to user by increasing instruction call back function in adapter, and by instruction call back function as a result,
Order passes to the process layer, so that the processor is handled display interface logic according to the user instruction, and processing is obtained
Interfacial effect pass through boundary layer show;Be conducive to the management for being further reduced boundary layer to data, enhance the benefit to adapter
With rate, while but also showing interface is more animation, user experience effect is improved.
In one embodiment, method provided in an embodiment of the present invention can be applied in MVVM framework, that is to say, that can
To realize the model layer of the embodiment of the present invention using the Model in MVVM framework, the View that can use in MVVM framework is realized
The boundary layer of the embodiment of the present invention can use the process layer that the ViewModel in MVVM framework realizes the embodiment of the present invention.
But, it is necessary to the adapter is added in the MVVM framework, so that implementation of the present invention may be implemented in the MVVM framework after improving
Interface display driving method provided by example.
Wherein, MVVM full name Model-View-ViewModel is a kind of software architecture mode, and wherein Model represents number
According to View corresponds to UI (user interface) layer, and ViewModel is as the coordinator between View and Model.Model is in View
The storage organization of information, the information with View are mapping relations one by one, ViewModel can by the data to Model into
Formatting lines go to handle with other service logics, and the presentation logic for handling resulting final effect is notified View layers.
It shows logic therefore, because ViewModel is contained and View will not be quoted, therefore the embodiment of the present invention passes through utilization
ViewModel in MVVM (Model-View-ViewModel) framework is as the process layer, with the View in MVVM framework
As the boundary layer, and binding adapter, be conducive to the coupling preferably between separating treatment layer and boundary layer, further keep away
Exempt from interface layered data processing.
Corresponding with foregoing interface display driving method, the present invention also provides a kind of interface display driving devices, such as Fig. 6 institute
Show, Fig. 6 is a kind of present invention structural block diagram of interface display driving device shown according to an exemplary embodiment, the interface
Display drive apparatus 300 includes model layer module 301, boundary layer module 302, process layer module 303 and adapter 304.It is described
Model layer module 301 is for storing and receive in response to interface data caused by user's operation, and to the process layer module
303 send.
The boundary layer module 302 is used for display interface.
The process layer module 303 is used to initialize the adapter 304 according to the interface data, and to the interface
Layer data is handled, and will be handled resulting data result and is sent to the adapter 304.
The adapter 304 is used to refresh the currently displayed boundary of the boundary layer module 302 according to the data result
Face.
In one embodiment, the process layer module 303 may include:
Initialization submodule, for the interface data received to be sent to boundary layer, and will be described by the boundary layer
Interface data is assigned to the adapter 304, to initialize the adapter 304.
Wherein, the adapter 304 after being initialised is directed toward the interface list of the current desired display of the boundary layer.
In one embodiment, it is based on aforementioned any device embodiment, the process layer module 303 can also include:
Handle submodule, for handling the interface data, at least obtain the interface of current desired display list line number,
Each every trade height and each row content;
Format adjusting submodule is obtained for arranging the high and each row content of the list line number, each every trade with specified format
Meet the data result of the specified format;
Sending submodule, for the data result to be sent to the adapter 304.
In one embodiment, based on the basis of previous Installation practice, the adapter 304 may include:
Judging submodule, for after receiving the data result, judge the data result format whether with it is described
Specified format matching;
As a result submodule is returned, when the format of the data result and the specified format mismatch, returns to mistake letter
It ceases to the process layer module 303, to remind the transmission of process layer module 303 to meet the data result of the specified format.
In one embodiment, based on the basis of aforementioned any device embodiment, the adapter 304 at least preserve with
All types of data several call back functions correspondingly in the data result.The adapter 304 may include:
Data acquisition submodule, for obtaining the list at the interface of current desired display respectively according to the data result
The high and each row content of line number, each every trade;
Input submodule, for list line number, the high and each row content of each every trade to be inputted corresponding call back function respectively;
Refresh submodule, passes through boundary shown by corresponding call back function boundary layer according to the Refresh Data inputted
Face.
In one embodiment, it is based on the basis of aforementioned any device embodiment, the quantity of the adapter 304 and interface
The quantity for the list that the interface of the current desired display of layer is included is identical, and all adapters 304 and all lists correspond
And it mutually binds.
In one embodiment, based on the basis of aforementioned any device embodiment, it can use the Model in MVVM framework
The model layer for realizing the embodiment of the present invention can use the boundary layer that the View in MVVM framework realizes the embodiment of the present invention, can
To realize the process layer of the embodiment of the present invention using the ViewModel in MVVM framework.But, it is necessary to increase in the MVVM framework
If the adapter 304, so that the driving of interface display provided by the embodiment of the present invention may be implemented in the MVVM framework after improving
Device.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in described device
It realizes, this will not be repeated here.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The module of explanation may or may not be physically separated.Can select according to the actual needs part therein or
Person's whole module realizes the purpose of disclosure scheme.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
Corresponding with foregoing interface display driving method, the present invention also provides a kind of electronics of interface display driving device to set
It is standby, as shown in fig. 7, Fig. 7 is the structural block diagram for a kind of electronic equipment that the present invention is illustrated according to one, the electronic equipment
400 include:
Processor 401;
Memory 402, for storing the computer program that can be executed by the processor;
Wherein, interface display driving method in any of the preceding embodiments is realized when the processor executes described program
Step.
In one embodiment, the electronic equipment of the embodiment of the present invention can have data processing function, data to deposit to be a kind of
The electronic equipment of function and data transmission-receiving function is stored up, which can be computer equipment or mobile end equipment.
It is corresponding with the embodiment of foregoing interface display driving method, in one exemplary embodiment, the present invention also provides
A kind of non-transitorycomputer readable storage medium, is stored thereon with computer program.The computer program is by the electronics
The step of processor of equipment realizes interface display driving method in any of the preceding embodiments when executing.
In embodiments of the present invention, can be used one or more wherein include program code storage medium (including
But be not limited to magnetic disk storage, CD-ROM, optical memory etc.) on the form of computer program product implemented.Computer can
It include permanent and non-permanent, removable and non-removable media with storage medium, it can be by any method or technique Lai real
Existing information storage.Information can be computer readable instructions, data structure, the module of program or other data.Computer is deposited
The example of storage media includes but is not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic randon access
Memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable are read-only
Memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), digital multi
CD (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices or any other
Non-transmission medium, can be used for storage can be accessed by a computing device information.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure
Its embodiment.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following
Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
The foregoing is merely the preferred embodiments of the disclosure, not to limit the disclosure, all essences in the disclosure
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of disclosure protection.
Claims (10)
1. a kind of interface display driving method, which is characterized in that including model layer, boundary layer, process layer and adapter;The mould
Type layer is for storing interface data;The boundary layer is used for display interface;The process layer is for handling the interface data;Institute
Adapter is stated for refreshing the interface bound in the boundary layer with it;The described method includes:
The model layer is received in response to interface data caused by user's operation, and is sent to the process layer;
The process layer initializes the adapter according to the interface data, and handles the interface data, will locate
It manages resulting data result and is sent to the adapter;
The adapter refreshes the currently displayed interface of the boundary layer according to the data result.
2. the method according to claim 1, wherein the process layer is according to interface data initialization
Adapter, comprising:
The interface data received is sent to boundary layer, and the interface data is assigned to by the adaptation by the boundary layer
Device, to initialize the adapter;
Wherein, the adapter after being initialised is directed toward the interface list of the current desired display of the boundary layer.
3. will be handled resulting the method according to claim 1, wherein handling the interface data
Data result is sent to the adapter, comprising:
The interface data is handled, the high and each row content of list line number, each every trade at the interface of current desired display is at least obtained;
The high and each row content of the list line number, each every trade is arranged with specified format, obtains the data for meeting the specified format
As a result;
The data result is sent to the adapter.
4. according to the method described in claim 3, it is characterized by further comprising:
After the adapter receives the data result, judge the data result format whether with the specified format
Match;
If the format of the data result and the specified format mismatch, error message is returned to the process layer, with
The process layer is reminded to send the data result for meeting the specified format.
5. the method according to claim 3 or 4, which is characterized in that the adapter is at least preserved and the data knot
All types of data several call back functions correspondingly in fruit;
The adapter according to the data result refresh the boundary layer shown by interface, comprising:
According to the data result, the high and each row content of list line number, each every trade at the interface of current desired display is obtained respectively;
List line number, the high and each row content of each every trade are inputted into corresponding call back function respectively;
Pass through interface shown by corresponding call back function boundary layer according to the Refresh Data inputted.
6. according to the method described in claim 5, it is characterized in that, the quantity of the adapter and the current desired display of boundary layer
The interface list that is included quantity it is identical, and all adapters and all lists are corresponded and are mutually bound.
7. according to the method described in claim 5, it is characterized in that, the adapter also preserves finger corresponding with user instruction
Call back function is enabled, the user instruction generates the operation of current interface by user;The method also includes:
The adapter receives the user instruction sent by operating system, and is passed the user instruction by instruction call back function
Pass the process layer;
The process layer handles interface display logic according to the user instruction, obtains interface display effect, and pass through boundary layer
Show the interface display effect.
8. a kind of interface display driving device, which is characterized in that including model layer module, boundary layer module, process layer module and
Adapter;
Model layer module, for storing and receiving in response to interface data caused by user's operation, and to the process layer mould
Block is sent;
Boundary layer module is used for display interface;
Process layer module for initializing the adapter according to the interface data, and is handled the interface data,
Resulting data result will be handled and be sent to the adapter;
Adapter, for refreshing the currently displayed interface of the boundary layer module according to the data result.
9. a kind of electronic equipment characterized by comprising
Processor;
Memory, for storing the computer program that can be executed by the processor;
Wherein, the step of any one of claim 1~7 the method is realized when the processor executes described program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed
The step of any one of claim 1~7 the method is realized when device executes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811162433.1A CN109471689A (en) | 2018-09-30 | 2018-09-30 | Interface display driving method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811162433.1A CN109471689A (en) | 2018-09-30 | 2018-09-30 | Interface display driving method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109471689A true CN109471689A (en) | 2019-03-15 |
Family
ID=65663356
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811162433.1A Pending CN109471689A (en) | 2018-09-30 | 2018-09-30 | Interface display driving method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109471689A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109977164A (en) * | 2019-04-01 | 2019-07-05 | 时代数媒科技股份有限公司 | A kind of mobile terminal list development approach based on data-driven |
CN110609669A (en) * | 2019-09-02 | 2019-12-24 | Oppo(重庆)智能科技有限公司 | Interface processing method and device, storage medium and electronic equipment |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105373534A (en) * | 2014-08-12 | 2016-03-02 | 腾讯科技(北京)有限公司 | List display method, device and list display terminal |
CN108549564A (en) * | 2018-03-30 | 2018-09-18 | 武汉斗鱼网络科技有限公司 | The display processing method and client of user interface |
-
2018
- 2018-09-30 CN CN201811162433.1A patent/CN109471689A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105373534A (en) * | 2014-08-12 | 2016-03-02 | 腾讯科技(北京)有限公司 | List display method, device and list display terminal |
CN108549564A (en) * | 2018-03-30 | 2018-09-18 | 武汉斗鱼网络科技有限公司 | The display processing method and client of user interface |
Non-Patent Citations (2)
Title |
---|
DUB: "MVC,MVP和MVVM的区别", 《HTTPS://WWW.CNBLOGS.COM/DUBO-/P/5619077.HTML?IVK_SA=1024320U》 * |
LJHEEE: "Android适配器视图与适配器AdapterView & Adapter", 《HTTPS://LJHEEE.BLOG.CSDN.NET/ARTICLE/DETAILS/52302591》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109977164A (en) * | 2019-04-01 | 2019-07-05 | 时代数媒科技股份有限公司 | A kind of mobile terminal list development approach based on data-driven |
CN110609669A (en) * | 2019-09-02 | 2019-12-24 | Oppo(重庆)智能科技有限公司 | Interface processing method and device, storage medium and electronic equipment |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
WO2022001745A1 (en) * | 2020-06-29 | 2022-01-06 | 中国第一汽车股份有限公司 | Data instruction processing method and apparatus, vehicle, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2018203274B2 (en) | Training an RGB-D classifier with only depth data and privileged information | |
CN109471689A (en) | Interface display driving method, device, electronic equipment and storage medium | |
Dunning et al. | Streaming architecture: new designs using Apache Kafka and MapR streams | |
CN110506260A (en) | It is read by minimizing memory using the blob data being aligned in the processing unit of neural network environment and improves performance | |
US10580013B2 (en) | Method and apparatus for autonomous services composition | |
CN109901827A (en) | Using exchange method, device, electronic equipment and readable storage medium storing program for executing | |
CN105814579B (en) | Sandbox application data redirection is to data center | |
CN108563384A (en) | A kind of exchange method and relevant device based on questionnaire | |
US8046736B1 (en) | Generated code from graphical user interface | |
US20100174991A1 (en) | Maintaining data coherency within related multi-perspective user interfaces via session-less queries | |
CN110968943A (en) | Display method and device of terminal interface | |
JPH09326796A (en) | Method for generating test packet to simulate computer network communication and its device | |
US8583412B2 (en) | Systems and methods for providing a simulation environment having a simulation user interface | |
EP1723516A1 (en) | System and method for building mixed mode execution environment for component applications | |
US11144810B2 (en) | Enhanced visual dialog system for intelligent tutors | |
Hope et al. | Simplifying the interaction between cognitive models and task environments with the JSON Network Interface | |
US10339533B2 (en) | Methods and systems for scalable session emulation | |
CN110083342A (en) | A kind of program creating method, device and computer readable storage medium | |
Woods et al. | Continuous Architecture in Practice: Software Architecture in the Age of Agility and DevOps | |
Indrasiri et al. | Design Patterns for Cloud Native Applications | |
CN111444449A (en) | Http request processing method and apparatus | |
Zschörnig et al. | A cloud-based Analytics-Platform for user-centric Internet of Things domains–Prototype and Performance Evaluation | |
US8370862B1 (en) | Communicating between software environments | |
US20130091448A1 (en) | Transformative user interfaces | |
WO2013050060A1 (en) | Method and system for client side user interface generation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190315 |
|
RJ01 | Rejection of invention patent application after publication |