Ui control generation and trigger methods, and terminal
AssigneeHuawei Technologies Co., Ltd.
InventorsXuanzhe Hou, Ruofei Han
Life of this patent
Estimating the term…
Abstract
Embodiments of this application provide UI control generation and trigger methods and a terminal. In a method embodiment of a first terminal, detecting that a UI control template was dragged to a layout file editor using a drag operation and the drag operation was released. A UI control attribute of the UI control. The UI control is generated based on the UI control attribute of the UI control. In embodiments of this application, the developer can conveniently develop a GUI application that supports a plurality of input events and a plurality of presentation manners.
Claims20
A user interface (UI) control generation method performed by a first terminal, the first terminal comprising an integrated development environment (IDE) and a UI framework, the IDE comprises a layout file editor and a control editor, the UI framework comprises a UI control template, the method comprising:
- detecting that the UI control template was dragged to the layout file editor using a drag operation and the drag operation was released;
- setting a UI control attribute of a UI control;
- and
- generating the UI control based on the UI control attribute of the UI control after receiving an editing operation input by a developer to the control editor of the UI control template;
- the UI control attribute of the UI control comprising a trigger attribute, a presentation attribute, and a response attribute, the trigger attribute comprising a plurality of input events supported by the UI control, the presentation attribute comprising a plurality of presentation manners supported by the UI control, and the response attribute comprises a plurality of response actions performed after the UI control is triggered.
A user interface (UI) control trigger method performed by a second terminal, the second terminal comprising a target application, a UI framework, and a system service, the method comprising:
- invoking the UI framework to load a first interface of the target application when detecting a start operation performed by a user on the target application, the first interface comprising a UI control;
- determining a trigger attribute input event corresponding to a trigger attribute of the UI control;
- invoking the system service to obtain an input device input event using an input device and recognize the input device input event using the input device;
- generating, when the input device input event matches the trigger attribute input event, a trigger request corresponding to the input event;
- and
- finding, based on the input event carried in the trigger request, a UI control corresponding to the input event;
- and
- triggering the UI control;
- wherein a UI control attribute of the UI control comprises a trigger attribute, a presentation attribute, and a response attribute, the trigger attribute comprises a plurality of input events supported by the UI control, the presentation attribute comprises a plurality of presentation manners supported by the UI control, and the response attribute comprises a plurality of response actions performed after the UI control is triggered.
A first terminal, comprising:
- a display;
- an integrated development environment (IDE) comprising a layout file editor and a control editor;
- and
- a user interface (UI) framework comprising a UI control template;
- a memory storing instructions;
- and
- at least one processor in communication with the memory, the display, the IDE, and the UI framework, the at least one processor configured, upon execution of the instructions, to perform the following steps:
- detecting that the UI control template was dragged to the layout file editor using a drag operation and the drag operation was released;
- setting a UI control attribute of a UI control;
- and
- generating the UI control based on the UI control attribute of the UI control after receiving an editing operation input by a developer to the control editor of the UI control template;
- the UI control attribute of the UI control comprising a trigger attribute, a presentation attribute, and a response attribute, the trigger attribute comprising a plurality of input events supported by the UI control, the presentation attribute comprising a plurality of presentation manners supported by the UI control, and the response attribute comprising a plurality of response actions performed after the UI control is triggered.
Dependencies are inferred from the claim text.