Disclosure of Invention
Based on the above, it is necessary to provide a method, a system and a storage medium for controlling the user interface presentation of a Recovery system, so as to solve the problem that in the prior art, a method for presenting a unified Recovery UI by using Recovery UIs under different platforms is troublesome.
The technical scheme of the invention is as follows:
a restoration system user interface presentation control method, comprising:
the intelligent terminal receives a layout importing instruction, and adds at least one prefabricated layout to a Surface, wherein the attribute of the layout can be modified to adapt to at least two different platforms;
the intelligent terminal receives a control import instruction, and adds a plurality of pre-manufactured UI controls with different functions to the Surface, wherein the attribute of the UI controls can be modified to adapt to at least two different platforms.
In a further preferred scheme, the UI control is drawn on a Surface by using Canvas, loads a picture resource by using Resources and receives an event by using Input under control of a View mechanism.
In a further preferred scheme, the Resources are used for encapsulating picture loading capability of the Min UI, the Canvas is used for encapsulating UI drawing capability of the Min UI, and the Input encapsulates event receiving capability of the Min UI.
In a further preferred embodiment, both Resources, canvas and Input are encapsulated with the underlying interfaces of at least two different platforms.
In a further preferred scheme, the step of receiving the layout import instruction and adding the prefabricated at least one layout to the Surface by the intelligent terminal further comprises: the layout making tool receives a layout making instruction and generates at least one layout according to the layout making instruction.
In a further preferred scheme, the step of receiving the layout import instruction and adding the prefabricated at least one layout to the Surface by the intelligent terminal further comprises: the control making tool receives the UI control making instruction and generates a plurality of UI controls with different functions according to the instruction.
In a further preferred scheme, the step of receiving the layout import instruction and adding the prefabricated at least one layout to the Surface by the intelligent terminal further comprises: the Surface creation tool receives the Surface creation instruction and generates a Surface according to the Surface creation instruction.
In a further preferred embodiment, at least the UI controls of the plurality of different functions include: the system comprises a first UI control and a second UI control, wherein the first UI control is View with an animation display function, and the second UI control is View with a text information display function.
A recovery system user interface presentation control system, the recovery system user interface presentation control system comprising an intelligent terminal, the intelligent terminal comprising: the system comprises a memory, a processor and a recovery system user interface presentation control program stored on the memory and capable of running on the processor, wherein the recovery system user interface presentation control program realizes the steps of the recovery system user interface presentation control method when being executed by the processor.
A storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of a recovery system user interface presentation control method as described above.
Compared with the prior art, the user interface presentation control method of the recovery system provided by the invention comprises the following steps: the intelligent terminal receives a layout import instruction, at least one prefabricated layout is added to the Surface, and the layout and the UI control attribute can be modified to adapt to at least two different platforms. According to the Recovery system user interface presentation control method provided by the invention, only the prefabricated UI control and the attribute of the layout are required to be configured when the business UI is written, and then the modified layout and the UI control are imported into the generated Surface, so that the problem that a method for presenting a unified Recovery UI by using Recovery UI under different platforms is troublesome in the prior art is solved.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The drawing code of the menu part of the Recovery interface shown in fig. 2 is:
int lenofVs = getLenOfMVS();
y += 4;
for (int i = 0; i < lenofVs; ++i) {
if (menuViews[i] == menu_sel) {
SetColor(IsLongPress() MENU_SEL_BG_ACTIVE : MENU_SEL_BG);
gr_fill(0, y - 2, gr_fb_width(), y + char_height_ + 2);
SetColor(MENU_SEL_FG);
gr_text(gr_sys_font(), 4, y, menu_[menuViews[i]], true);
SetColor(MENU);
} else {
gr_text(gr_sys_font(), 4, y, menu_[menuViews[i]], false);
}
y += char_height_ + 4;
}
DrawHorizontalRule(&y);
in popular terms, the menu drawing process of the codes is similar to drawing, firstly, a painting brush with one color is taken, a horizontal line is drawn, then another painting brush with another color is changed, a plurality of words are written, then a distance is reserved, and the painting brush with the horizontal line is taken to draw the horizontal line, so that the process is repeated. The whole process is complicated. And once the adjustment is needed, the details of the color of the painting brush, the position of the horizontal line, the position of the character and the like are carefully considered, so that the efficiency is extremely low.
The drawing code of the menu part of the Recovery interface shown in fig. 3 is:
int offset = (84 - char_height)/2;
for (int i = 0; i < menu_items; ++i) {
if (i == menu_sel) {
SetColor(MENU_SEL_BG);
gr_fill(0, y - offset, 591, y + char_height + offset);
SetColor(MENU_SEL_FG);
gr_text(93, y, menu_[i], true);
SetColor(MENU);
} else {
gr_text(93, y, menu_[i], false);
}
gr_color(32, 43, 68, 255);
gr_fill(0, y - offset - 1, 591, y - offset + 1);
y += 84;
SetColor(MENU);
}
it follows that the code of the two parts differs greatly, in the Screen UI, and there are many places in the Screen UI like this. It is conceivable that when a programmer resynchronizes to another platform after modifying one Recovery UI, a great deal of repetitive work often has to be done, which is very cumbersome.
If the UI control and the layout can be generated based on the original Min UI in the Recovery UI and imitating an Android UI system, the UI control and the layout are used for replacing the Screen UI, when the Recovery UI is presented, the prefabricated layout and the control are directly called, and after the attribute is modified according to the requirement, the UI control and the layout can be directly applied to other platforms, so that at least one problem existing in the prior art can be solved.
Based on the above-mentioned idea, the present invention provides a method for controlling the presentation of a user interface of a recovery system, as shown in fig. 1, where the method for controlling the presentation of a user interface of a recovery system includes the steps of:
s400, the intelligent terminal receives a layout import instruction, at least one prefabricated layout is added to the Surface, and the attribute of the layout can be modified to adapt to at least two different platforms.
The Surface is a picture finally presented on a screen of the intelligent terminal, such as a mobile phone screen, a flat screen, a television screen and the like; within the Surface are typically several UI controls, an aggregate of views, that can distribute key events to internal views. The layout is used for typesetting the UI controls according to preset rules.
S500, the intelligent terminal receives a control import instruction, a plurality of pre-manufactured UI controls with different functions are added to the Surface, and the attribute of the UI controls can be modified to adapt to at least two different platforms.
The UI control is a View with specific functions, and different UI controls may have different functions, such as text control, button control, status switch control, radio and check button, picture control, clock control, date and time selection control, and so on.
Three elements of the UI control: drawing, data and control.
Making the UI visible and drawing, each control has its own look, e.g., table View is a data Table, and Date Picker is a time selector.
The controls also need their own data, such as data that Label needs to display text, such as data that Image View needs to display pictures, and if there is no data, the use of these controls would become meaningless.
Control is key to user interaction with an interface, such as Button buttons, such as a Scroll View, that can slide through data.
Generalized View refers to a single control other than ViewGroup, such as Text View, check Box, button, edit Text, radio Button, etc., that manages the rendering itself and the handling of events. The View Group is a sub-class of View, and simultaneously exists as a container of a View control, and can control the display level and position of each sub-View, and can process, intercept or distribute interaction events such as focus acquisition, touch and the like.
The drawing of the view is mainly divided into three steps, measure, layout and Draw, respectively. The drawing of the control is usually carried out on a control tree, the control is distributed to the child views by the ViewGroup to respectively finish the measurement and layout operation of the control, and finally, the drawing is started by the root node, so that a complete interface is finally formed.
According to the Recovery system user interface presentation control method provided by the invention, only the prefabricated UI control and the attribute of the layout are required to be configured when the business UI is written, and then the modified layout and the UI control are imported into the generated Surface, so that the problem that a programmer managing codes of a plurality of system manufacturers is troublesome to modify the Recovery UI and synchronize to other platforms is solved. Such as pre-prepared with a menu control that is invoked using the following example code:
sgMenuView*menu=newsgMenuView(7,
sgView::SG_LP::MATCH_PARENT,sgView::SG_LP::WRAP_CONTENT);
menu->setItemViews(confirmItems,glodItemUnSeletcted, glodItemSeletcted);
menu ->setMargin(SG_DPI2PX(110), 0);
menu ->setSize(1.0f,0.7f);
menu->setOnSelectedListener(OnConFirmMenuSelectedListener, this) ;
int MenuID = menu->getId();
msLeft->addView(menu);
in this way, a menu can be created in a sentence, and the size, background view, position, and the like of the menu can be set in a sentence, respectively. The menu UI control can be automatically completed without considering the details of each horizontal line, the position of each line of characters and the like by comparing the menu drawing mode of the invention with the menu drawing mode of the figure 2 by analogy with drawing. Once the position, size and other attributes of the menu need to be adjusted, the corresponding parameters only need to be changed in the codes.
As a preferred embodiment of the invention, the UI control is drawn on Surface by using Canvas, loads picture Resources by using Resources and receives events by using Input under control of View mechanism. The Resources are used for packaging picture loading capability of the Min UI, the Canvas is used for packaging UI drawing capability of the Min UI, and the Input is used for packaging event receiving capability of the Min UI. The Resources, canvas and Input are both encapsulated with the underlying interfaces of at least two different platforms.
The prefabricated UI controls and layout have no platform difference in functional effect and use interface form, and the method for drawing the Recovery UI is unified in such a way, so that technical convenience can be brought to updating iteration of the Recovery UI in the future.
The invention further encapsulates the Min UI on one hand, and better shields the realization difference of the bottom layer of each platform about the UI. On the other hand, the UI control is realized by imitating an Android UI system, a function of flexibly configuring the UI control is provided for a Recovery UI, and the drawing function of the UI is enriched.
As an improvement of the above preferred embodiment, at least one of the plurality of UI controls with different functions includes: the system comprises a first UI control and a second UI control, wherein the first UI control is View with an animation display function, and the second UI control is View with a text information display function.
According to another aspect of the present invention, the step S400 further includes: s100, the layout making tool receives a layout making instruction and generates at least one layout according to the layout making instruction.
The step S400 further includes: and S200, receiving a UI control making instruction by a control making tool, and generating a plurality of UI controls with different functions according to the instruction.
The step S400 further includes: s300, the Surface creation tool receives the Surface creation instruction and generates the Surface according to the Surface creation instruction.
A recovery system user interface presentation control system, the recovery system user interface presentation control system comprising an intelligent terminal, the intelligent terminal comprising: the system comprises a memory, a processor and a recovery system user interface presentation control program stored on the memory and capable of running on the processor, wherein the recovery system user interface presentation control program realizes the steps of the recovery system user interface presentation control method when being executed by the processor.
Further, the recovery system user interface presentation control system further includes: the layout making tool is configured to receive a layout making instruction and generate at least one layout according to the layout making instruction, which is specifically described in the above method embodiment.
Further, the recovery system user interface presentation control system further includes: the control making tool is configured to receive a UI control making instruction and generate a plurality of UI controls with different functions according to the instruction, which is specifically described in the above method embodiments.
Further, the recovery system user interface presentation control system further includes: the Surface creation tool is configured to receive the Surface creation instruction and generate a Surface according to the Surface creation instruction, and is specifically described in the above method embodiment.
Further, at least the UI controls with the plurality of different functions include: the first UI control is View with an animation display function, and the second UI control is View with a text information display function, and the method is specifically described in the embodiment of the method.
The present invention also provides a storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of a recovery system user interface presentation control method as described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SynchliNk) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.