CN108008955B - Method and device for displaying user-defined control information - Google Patents

Method and device for displaying user-defined control information Download PDF

Info

Publication number
CN108008955B
CN108008955B CN201711354518.5A CN201711354518A CN108008955B CN 108008955 B CN108008955 B CN 108008955B CN 201711354518 A CN201711354518 A CN 201711354518A CN 108008955 B CN108008955 B CN 108008955B
Authority
CN
China
Prior art keywords
information
custom
control
target information
page
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.)
Active
Application number
CN201711354518.5A
Other languages
Chinese (zh)
Other versions
CN108008955A (en
Inventor
刘必强
韩继红
饶福贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201711354518.5A priority Critical patent/CN108008955B/en
Publication of CN108008955A publication Critical patent/CN108008955A/en
Application granted granted Critical
Publication of CN108008955B publication Critical patent/CN108008955B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a method and an apparatus for displaying custom control information, wherein the method includes: acquiring request information for requesting to open a client software development interface; and drawing target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control. By adopting the method for displaying the custom control information, the preset development information of the custom control for constructing the page can be displayed in the page when the page information is displayed, so that the user can conveniently check the information.

Description

Method and device for displaying user-defined control information
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for displaying custom control information.
Background
An application, i.e., client software, typically includes a number of pages, each page including a number of modules, each module corresponding to a custom control in a developer.
The application program is assumed to be client software developed based on an Android system. In the related art, if a developer wants to know the information of the customized control corresponding to each module in a page, the developer generally checks a client log through an Android development environment installed on a PC terminal or is familiar with the information of each page and the customized control through a single step debugging mode.
However, all the above methods need the support of the Android development environment, and if a developer wants to use a common user terminal, such as a mobile terminal without the Android development environment, to conveniently and quickly view the custom control information, it is difficult to implement the method.
Disclosure of Invention
In order to overcome the problems in the related art, the disclosure provides a method and a device for displaying custom control information, which can visually display target information of a custom control in a page.
According to a first aspect of the embodiments of the present disclosure, a method for displaying custom control information is provided, which is applied to a mobile terminal, and includes:
acquiring request information for requesting to open a client software development interface;
and drawing target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
Optionally, the obtaining request information for requesting to open a client software development interface includes:
when the preset trigger information is detected through the preset interface, providing an information verification interface;
acquiring information to be verified through the information verification interface and performing information verification on the information to be verified;
and if the information to be verified passes the information verification, acquiring the request information.
Optionally, the drawing target information of a custom control in a page according to the request information includes:
obtaining a custom control list of the page, wherein the custom control list comprises: the corresponding relation between the position information of each module and the control type of the user-defined control;
and drawing the target information of the custom control in the page according to the custom control list.
Optionally, the drawing target information of the custom control in the page according to the custom control list includes:
determining whether the control types of the custom controls are the same according to the custom control list;
if the control types of the user-defined controls are the same, determining whether the target information of the user-defined controls is the same;
if the target information of each user-defined control is the same, drawing the target information at a preset position of the page.
Optionally, the drawing target information of the custom control in the page according to the custom control list further includes:
and if the control types of the custom controls are different or the target information of the custom controls is different, drawing the target information of the custom controls in the page.
Optionally, the target information of the custom control in the drawing page includes:
acquiring target data corresponding to the target information from a custom control through at least one abstract method provided by a custom base class inherited to a native control of an android system; wherein the custom control inherits the custom base class;
and sequentially drawing the information of the custom base class and the target information of the custom control by rewriting a preset drawing method of the custom base class.
Optionally, the preset drawing method includes: dispatch draw () method.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for displaying custom control information, disposed in a mobile terminal, the apparatus including:
the client software development interface processing module is configured to obtain request information for requesting to open a client software development interface;
and the display module is configured to draw target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
Optionally, the request module includes:
the trigger submodule is configured to provide an information verification interface when detecting preset trigger information through a preset interface;
the verification submodule is configured to acquire information to be verified through the information verification interface and perform information verification on the information to be verified;
the request submodule is configured to acquire the request information under the condition that the information to be verified passes the information verification.
Optionally, the display module includes:
a control list obtaining sub-module configured to obtain a custom control list of the page, where the custom control list includes: the corresponding relation between the position information of each module and the control type of the user-defined control;
and the information drawing submodule is configured to draw the target information of the custom control in the page according to the custom control list.
Optionally, the information drawing sub-module includes:
the type determining unit is configured to determine whether the control types of the custom controls are the same according to the custom control list;
the information determining unit is configured to determine whether the target information of each custom control is the same under the condition that the control types of the custom controls are the same;
and the first drawing unit is configured to draw the target information at a preset position of the page under the condition that the target information of each custom control is the same.
Optionally, the information drawing sub-module further includes:
and the second drawing unit is configured to draw the target information of each custom control in the page under the condition that the control types of the custom controls are different or the target information of the custom controls is different.
Optionally, the display module includes:
the target data acquisition submodule is configured to acquire target data corresponding to the target information from the custom control through at least one abstract method provided by a custom base class inherited to the native control of the android system; wherein the custom control inherits the custom base class;
and the target information drawing submodule is configured to draw the information of the custom base class and the target information of the custom control in sequence by rewriting a preset drawing method of the custom base class.
Optionally, the preset drawing method includes: dispatch draw () method.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspect described above.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a mobile terminal including:
a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring request information for requesting to open a client software development interface;
and drawing target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the method and the device, the mobile terminal can obtain preset request information sent by a user, the request information is used for requesting to open a client software development interface, then target information of a user-defined control in a page is drawn according to the request information, the target information at least comprises a class name of the user-defined control, so that a current user such as a developer of client software can inquire information of the target user-defined control anytime and anywhere through the mobile terminal, the developer can conveniently find a source code of the user-defined control in time according to the target information and repair the source code of the user-defined control, and the like, so that the development efficiency of a program developer is improved, the intelligent degree of the mobile terminal is enhanced, and the use experience of the user is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flowchart illustrating a method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 2 is a flow chart illustrating another method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 3-1 is a schematic diagram illustrating a scenario in which the present disclosure displays custom control information, according to an exemplary embodiment.
Fig. 3-2 is a schematic diagram illustrating another scenario in which the present disclosure displays custom control information, according to an example embodiment.
FIG. 4 is a flow chart illustrating another method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 5 is a flow chart illustrating another method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 6 is a flow chart illustrating another method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 7 is a flow chart illustrating another method of displaying custom control information according to an exemplary embodiment of the present disclosure.
FIG. 8 is a schematic structural diagram of a View control shown in the present disclosure according to an exemplary embodiment.
FIG. 9 is a block diagram illustrating an apparatus for displaying custom control information according to an example embodiment of the present disclosure.
FIG. 10 is a block diagram illustrating another apparatus for displaying custom control information according to an example embodiment of the present disclosure.
FIG. 11 is a block diagram illustrating another apparatus for displaying custom control information according to an example embodiment of the present disclosure.
FIG. 12 is a block diagram illustrating another apparatus for displaying custom control information according to an example embodiment of the present disclosure.
FIG. 13 is a block diagram illustrating another apparatus for displaying custom control information according to an example embodiment of the present disclosure.
FIG. 14 is a block diagram illustrating another apparatus for displaying custom control information according to an example embodiment of the present disclosure.
Fig. 15 is a block diagram illustrating a mobile terminal according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In an embodiment of the present disclosure, an execution body includes: a mobile terminal and a server. The mobile terminal may be an electronic device such as a smart phone, a Personal Digital Assistant (PDA), a tablet computer, and a wearable device. The mobile terminal is provided with client software, and the client software is provided with a human-computer interaction interface for developers to check development interface information. The server may be an application server or other devices. In a specific implementation process, the mobile terminal and the server are independent from each other and are simultaneously associated with each other, so that the technical scheme provided by the embodiment of the disclosure is implemented together. For convenience of description, the embodiments of the present disclosure are described below from the perspective of a mobile terminal.
Referring to FIG. 1, a flowchart of a method of displaying custom control information is shown according to an exemplary embodiment, which may include the steps of:
in step 11, obtaining request information for requesting to open a client software development interface;
the mobile terminal is assumed to be a smart phone, and at least one piece of client software is installed on the smart phone, where the client software may be a piece of software with an obfuscated version that has already been released, or a piece of software that is not obfuscated by the version and is in a developing stage. The client software is assumed to be a first APP, a preset human-computer interaction interface is provided in a page of the first APP, request information input by a user, which is generally a developer, can be received through the human-computer interaction interface, and the request information is used for requesting the mobile terminal to display a development interface of the current client software, so that the developer can view development interface information of the first APP, such as information concerned by the developer, such as a class name and an ID of a custom control.
A base class in the Android control is called View, and module contents in a client software UI (User Interface) are drawn through the View control. Client software is typically version obfuscated based on the original development version before it is formally released. The obfuscation of the client software version is a process of reducing the size of a code program (i.e. software) in order to remove unnecessary codes after the development software is successfully debugged, for example, the original size of a client software is 10M, and the obfuscated version of the client software may be reduced to 5M, thereby reducing the amount of downloaded data of the software and the error rate during transmission.
In the version obfuscation process, the obfuscation rule of the View control is as follows: no constructors inherited from the View control are confused. Because the name of the constructor of the custom control is the same as the class name of the custom control, if the constructor is not confused, the class name of the custom control is not confused in the formal confused version of the client software. That is, the class name of the child control inherited from the View control is not confused in any version of client software. Based on the method, a developer can quickly search the source program code of the custom control according to the displayed class name. This step 11 is a process in which the user requests the mobile terminal to display custom control target information such as a class name.
With respect to how the mobile terminal obtains the request information, reference may be made to a flowchart of another method for displaying the custom control information shown in fig. 2 according to an exemplary embodiment, where step 11 may include:
in step 111, when the preset trigger information is detected through the preset interface, providing an information verification interface;
as above, the preset interface may be the preset human-computer interaction interface, such as a preset button set at a preset position of the first APP page, and when the smartphone detects that the preset button in the first APP is triggered, an information verification interface may be provided, for example, a preset window pops up in the display interface of the first APP, and a human-computer interaction interface that requires a user to input information to be verified, such as a text input box that asks the current user to input information such as a user name and a password, is set in the preset window.
In step 112, obtaining information to be verified through the information verification interface and performing information verification on the request verification information;
after receiving the information to be verified input by the current user through the information verification interface, the smart phone authenticates the current user locally or by sending the information to be verified, such as account name + password. According to the related knowledge, the development interface of the client software is only available for a small part of authorized persons, such as developers of the client software, to view in view of information security. Each developer with viewing rights has a unique account and password. When a developer wants to view development interface information anytime and anywhere using a mobile terminal such as a smart phone, personal authorization information can be input.
In step 113, if the information to be verified passes the information verification, the request information is obtained.
And if the client software passes the information verification of the current user, the current user is the user with the permission of viewing the development interface. Then, the request information input by the user can be received according to the related technology, and the request information is used for informing the client software of the specific page which the client software wants to view and the related information of each custom control in the page.
In step 12, target information of the custom control in the page is drawn according to the request information, and the target information at least includes a class name of the custom control.
This step 12 involves the process of rendering the display page of the client software development interface. According to the relevant knowledge, any view appearing on the screen can be displayed after being drawn through a scientific drawing process.
Taking the example that the target information is a class name, in the android system, one custom control corresponds to one class. A class is a collection of a set of objects that have the same properties and services (methods). An object is an entity in the system that describes objective things, and is a basic unit that constitutes the system. An object is composed of a set of attributes and a set of services (methods) that operate on the set of attributes. The custom control is an object.
In the JAVA program, a program document of a class, i.e. the source program code of the class, may be expressed as: class name java. Java, for example, the program document for a class is Person, and correspondingly, the class name is Person. On the contrary, if the class name of an object such as a custom control is known, the source code of the object can be found. Therefore, for developers, if the class name of a user-defined control can be quickly obtained, the source code of the class can be quickly found, the source code can be quickly searched through the method, and if the source code has errors, the source code can be quickly repaired.
The method aims to draw the class name of the custom control by adopting a preset drawing method when the custom control is drawn, so that the class name of the custom control is displayed on the uppermost layer, and a current user such as a developer can see target information such as the class name of the custom control in a display interface of client software.
In the present disclosure, the implementation of step 12 above may include at least the following two cases:
in the first case, the target information of each self-defined control in the page is drawn
And according to the request information, the mobile terminal for installing the client software acquires a page message corresponding to the client software development interface returned by the server. And the mobile terminal analyzes the page message, and acquires module data of each module in the page, wherein each module corresponds to a custom control, and the module data comprises the target information to be displayed, such as the class name of the custom control used by the module. Assuming that the current page includes 4 modules, correspondingly, the page uses 4 custom controls, and according to the related knowledge, the custom controls can be understood as the style of the module drawn on the UI (User Interface). The types of the customized controls can be the same or different. In the embodiment of the disclosure, when drawing each custom control, the target information may be drawn in the module according to a preset drawing method, so that the target information of the custom control is displayed on the uppermost layer of the module view, and it is ensured that a current user, such as a developer, can directly see the target information of the custom space, such as a class name, as shown in fig. 3-1, and the name of each module is displayed.
In the second case, if the types of the modules in the page are the same and the target information is also the same, the target information is merged and displayed in the current page
Referring to fig. 4, which is a flowchart illustrating another method for displaying custom control information according to an exemplary embodiment, step 12 may include:
in step 121, a custom control list of the page is obtained, where the custom control list includes: and the corresponding relation between the position information of each module and the control type of the user-defined control.
In the embodiment of the present disclosure, the page message obtained from the server by the client software in response to the request information includes: the number of modules is used for indicating how many modules the current page is laid out. The module data determines the display content of the module, and the module data may include: background, text, picture, module ID, module type, module location, target information, etc.
In an embodiment of the present disclosure, the module data at least includes: module type, module location information, target information. The client software can determine the control type of the custom control used by the current module according to the module type.
Accordingly, a custom control list of the current page can be obtained, the custom control list including: the corresponding relationship between the module position information and the control type of the custom control, for example, can be as shown in table one:
module position information Control type
Position 1 string
Position 2 ENU
Position 3 string
Position 4 ENU
Watch 1
As can be seen from Table one, the control types of the custom control used by the module at location 1 are: string, and so on.
In step 122, the target information of the custom control in the page is drawn according to the custom control list.
In the embodiment of the disclosure, the drawing mode of the target information can be determined according to the control type and the target information content of each custom control in the page.
Referring to fig. 5, which is a flowchart illustrating another method for displaying custom control information according to an exemplary embodiment, the step 122 may include:
in step 1221, determining whether the control types of the custom controls are the same according to the custom control list;
according to the control types of the custom controls corresponding to the modules recorded in the custom control list, it can be determined whether the control types of the custom controls in the current page are consistent, and if so, the following step 1222 is executed.
In step 1222, if the control types of the custom controls are the same, determining whether the target information of the custom controls is the same;
in the embodiment of the disclosure, the client may determine whether the types of the custom controls of the respective modules included in the page are the same. Still assume that the current page includes 4 modules, and whether the control types of the respective custom controls are the same can be determined according to the module types of the respective modules, and if the control types of the respective custom controls are the same, it is necessary to further determine whether the target information of the respective definition controls is the same. If the target information of each defined control is the same, the following step 1223 is performed.
In step 1223, if the target information of each custom control is the same, drawing the target information at a preset position of the page.
If the control types of the custom controls corresponding to the modules in the current page are the same, the target information of each custom control is also the same, such as the class name. Then, in the embodiment of the present disclosure, the target information may be rendered at a preset position of the current page, and as a result of the rendering, one piece of target information is displayed at the preset position of the current page, where the target information represents target information of each custom control in the current page. For example, referring to fig. 3-2, another schematic diagram showing information of a custom control according to an exemplary embodiment is shown, where target information is a class name, types of the custom controls corresponding to 4 modules are the same, and after contents of each module are drawn, the class name of the custom control corresponding to each module can be drawn on the upper right of a page.
Referring to fig. 6, which is a flowchart illustrating another method for displaying custom control information according to an exemplary embodiment, on the basis of the embodiment shown in fig. 5, the step 122 may further include:
in step 1224, if the control types of the respective custom controls are different or the target information of the respective custom controls is different, the target information of the respective custom controls is drawn in the page.
On the contrary, if the types of the controls of the custom controls corresponding to the modules in the page are different, that is, the negative determination result in step 1221, or although the types of the controls of the custom controls are the same, the target information to be displayed is different, that is, the negative determination result in step 1222, when the module content is drawn, the target information is drawn separately for each custom control. For example, when the types of the controls are the same, if the target information requested to be displayed is a control ID or a class name + ID, and the IDs of the controls are different due to different IDs of the modules, the target information of the controls is also different, and the target information needs to be separately drawn for each custom control when the module content is drawn.
If the types of the controls are different, for example, a page includes 4 modules, and the drawing result may be as shown in fig. 3-1, where the class names displayed in the modules are different.
The above example only illustrates a case where the control types or the target information of the custom controls of the respective modules are different, and it is predicted that, if the control types and the target information of two or more modules adjacent to each other in the page are the same, the target information may also be locally merged and displayed, for example, in the above example, if the control types and the target information of the module 1 and the module 2 are the same, the target information may be drawn at the preset positions of the page areas where the two modules are located, and when the user sees the target information of the custom controls at the preset positions, it is known according to the preset rule that the target information belongs to the target information of the custom controls corresponding to the two modules, that is, the module 1 and the module 2, and it is known that the control types of the custom controls corresponding to the two modules are the same.
Regarding the drawing of the target information in the foregoing embodiments, another flowchart of a method for displaying custom control information may be shown in fig. 7 according to an exemplary embodiment, where the method may include:
in step 1201, target data corresponding to target information is acquired from a custom control through at least one abstract method provided by a custom base class inherited to the native control of the android system; wherein the custom control inherits the custom base class;
referring to fig. 8, according to an exemplary embodiment, a schematic structural diagram of a View control is shown, in an android system, the View control is used as a base class, a container control View group of the class is distributed at a lower node of the View control, and linear layout, FrameLayout, and relatedlayout of native controls of three android systems are distributed at a lower level, and more related technologies may be used.
When a developer develops client software or a component of the client software based on the android system, a plurality of self-defined controls can be set, in the disclosure, the developer can self-define at least one base class based on the native control of the operating system, as shown in fig. 8, three self-defined base classes are set, and names are respectively: custom Base Linear layout, Custom Base Framelayout, Custom Base relative layout; inheriting from the three native controls respectively: LinearLayout, FrameLayout, RelativeLayout. Each Custom Base class inherits a plurality of Custom controls, for example, n Custom controls with the numbers of 21-2 n respectively inherit the Custom Base class FrameLayout.
In the embodiment of the present disclosure, a preset abstraction method may be provided in the custom base class, and the abstraction method may be used as an interface to obtain target data corresponding to target information to be displayed from a custom control inherited from the custom base class. The preset abstract method described above may be an abstract method for printing a class name, denoted as name ().
In software engineering, if an abstract method is set in a parent class, each subclass that inherits the parent class implements the abstract method. As shown in FIG. 8, the Custom control 21-2 n belongs to the subclass of the Custom control 21-2 n, and the Custom control 21-2 n belongs to the subclass of the Custom control.
Assuming that the Custom Base class Custom Base FrameLayout provides an abstract method such as name (), respectively defining controls 21-2 n as subclasses of the Custom Base class Custom Base FrameLayout can realize the method for printing the class name, and acquiring data corresponding to the class name, namely target data, wherein the target data is pre-filled in the Custom control.
In an embodiment of the present disclosure, if a preset abstract method is defined for each class written, that is, the custom control, although the class name can be printed, the code redundancy is very large, which results in a very large code. And if a code error is found subsequently, the codes corresponding to the subclasses need to be repeatedly modified.
In the method, by setting the custom base class inherited to the native control of the android system, only a preset abstract method needs to be provided in the custom base class, so that all subclasses inherited to the custom base class, namely the custom control, need to realize the preset abstract method, such as a method for printing class names, printing of all subclass class names can be realized, if a code error of the preset abstract method is found in a program development process, quick modification or error correction of the preset abstract method can be realized in the base class, and code redundancy is avoided. For example, 10 custom controls inherit to a custom base class, if a target message printing error is found, for example, a class name printing error, only the constructor of the class name printing method needs to be modified in the custom base class, i.e., the parent class, and the constructor of the class name printing method of the 10 custom controls, i.e., the subclasses, does not need to be modified respectively.
In step 1202, the information of the custom base class and the target information of the custom control are sequentially drawn by rewriting a preset drawing method of the custom base class.
In this disclosure, the drawing rule of the rewritten preset drawing method is: firstly, drawing the information of the parent control and then drawing the information of the child control, and ensuring that the target information of the child control can be displayed.
In an embodiment of the present disclosure, the rewritten preset drawing method in the custom base class is a dispatchdraw (Canvas) method, where a first Canvas represents a class name of an object as a Canvas, and a second Canvas represents a class name parameter, that is, represents on which Canvas to draw.
Regarding why the dispatchDraw () method is rewritten, it is necessary to first understand the drawing process of the View control in the related art:
any view appearing on the screen can be displayed after a scientific drawing process. The drawing process of each view must go through three most major stages, namely onMeasure (), onLayout (), and onDraw ().
Wherein the onMeasure () method is used to measure the size of the view; and the method of onLayout () is used for laying out the view after the capture process is finished, namely determining the position of the view. And the onDraw () method is used for drawing the view after the capture and layout process is finished. The above views may be understood as controls.
In the process of drawing the control content, for a background control, the drawing process is to call onDraw () first and then call a displatcDraw () method, wherein the displatcDraw () method is mainly distributed to a child control for drawing. However, for the drawing of the container control Viewgroup, it is the dispatch drop () method that is called directly when it has no background, bypassing the ondrop () method.
In order to ensure that the drawn custom control with or without the background can display the target information, the method of dispatcdraw () in the custom base inherited from the Viewgroup control is rewritten, so that the parent control information and the child control information can be drawn in sequence. As shown in fig. 3-1, for example, when the customized Base class Custom Base class FrameLayout calls the rewritten dispatch draw () method to draw, first draw its own information, and then draw the information of the subordinate customized control. In the drawing process, the content drawn in the subsequent step can be covered on the layer drawn in the previous step, that is, the information of the child control can be located on the layer where the information of the parent control is located, so that the rewritten dispatcdraw () method can be adopted in the disclosure to ensure that the information of the user-defined control drawn in the last step is displayed, and the information of the user-defined control includes the target information.
To sum up, by using the method for displaying the custom control information provided by the present disclosure, the mobile terminal can obtain the preset request information sent by the user, where the request information is used to request to open a client software development interface, and then draw the target information of the custom control in the page according to the request information, where the target information at least includes the class name of the custom control, so that a current user, such as a developer of client software, can query the information of the target custom control at any time and any place through the mobile terminal, and the developer can conveniently find the source code of the custom control in time and repair the source code of the custom control according to the target information, thereby improving the development efficiency of a program developer, enhancing the intelligence degree of the mobile terminal, and improving the user experience.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently.
Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
Corresponding to the embodiment of the application function implementation method, the disclosure also provides an embodiment of an application function implementation device and a corresponding terminal.
Referring to fig. 9, a block diagram of an apparatus for displaying custom control information is shown, which may include:
a request module 21 configured to acquire request information for requesting to open a client software development interface;
and the display module 22 is configured to draw target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
Referring to fig. 10, which is a block diagram of another apparatus for displaying custom control information according to an exemplary embodiment, on the basis of the apparatus embodiment shown in fig. 9, the requesting module 21 may include:
the trigger submodule 211 is configured to provide an information verification interface when detecting preset trigger information through a preset interface;
the verification submodule 212 is configured to acquire information to be verified through the information verification interface and perform information verification on the information to be verified;
a request submodule 213 configured to obtain the request information if the information to be verified passes the information verification.
Referring to fig. 11, which is a block diagram of another apparatus for displaying custom control information according to an exemplary embodiment, on the basis of the apparatus embodiment shown in fig. 9, the display module 22 may include:
a control list obtaining sub-module 221, configured to obtain a custom control list of the page, where the custom control list includes: the corresponding relation between the position information of each module and the control type of the user-defined control;
and the information drawing sub-module 222 is configured to draw the target information of the custom control in the page according to the custom control list.
Referring to fig. 12, which is a block diagram of another apparatus for displaying custom control information according to an exemplary embodiment, on the basis of the apparatus embodiment shown in fig. 11, the information drawing sub-module 222 may include:
a type determining unit 2221 configured to determine whether the control types of the respective custom controls are the same according to the custom control list;
an information determining unit 2222, configured to determine whether the target information of each custom control is the same when the control type of each custom control is the same;
the first drawing unit 2223 is configured to draw the target information at a preset position of the page when the target information of the respective custom controls is the same.
Referring to fig. 13, which is a block diagram of another apparatus for displaying custom control information according to an exemplary embodiment, on the basis of the apparatus embodiment shown in fig. 12, the information drawing sub-module 222 may further include:
a second drawing unit 2224, configured to draw the target information of each custom control in the page when the control type of each custom control is different or the target information of each custom control is different.
Referring to fig. 14, which is a block diagram of another apparatus for displaying custom control information according to an exemplary embodiment, on the basis of the apparatus embodiment shown in fig. 9, the display module 22 may include:
the target data obtaining submodule 2201 is configured to obtain target data corresponding to the target information from a custom control through at least one abstract method provided by a custom base class inherited from a native control of an android system; wherein the custom control inherits the custom base class;
a target information drawing submodule 2202 configured to draw information of the custom base class and the target information of the custom control in sequence by rewriting a preset drawing method of the custom base class. In an embodiment of the present disclosure, the preset drawing method may be: overridden dispatch draw () method. The drawing process comprises the steps of firstly drawing original page content corresponding to the root object, then drawing target information of the user-defined control in the page, and ensuring that preset development information of the control, such as the class name of the user-defined control, is visible in the page after the whole page is drawn.
It is understood that, in other embodiments of the present disclosure, the first rendering unit 2223 and the second rendering unit 2224 may further include the target data obtaining sub-module 2201 and the target information rendering sub-module 2202.
With regard to the apparatus in the above embodiments, the specific manner in which each module performs the triggering has been described in detail in the embodiments related to the method, and will not be elaborated here.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
In addition, the present disclosure also provides a mobile terminal, which may include: a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring request information for requesting to open a client software development interface;
and drawing target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
It should be further noted that, for other programs stored in the memory, reference is specifically made to the description in the foregoing method flow, and details are not described here again, and the processor is also configured to execute the other programs stored in the memory.
Fig. 15 is a block diagram illustrating a mobile terminal according to an exemplary embodiment of the present disclosure.
Referring to fig. 15, the device 1500 may be, for example, a mobile phone with routing functionality, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, or the like.
The device 1500 includes one or more of the following components: processing components 1502, memory 1504, power components 1506, multimedia components 1508, audio components 1510, input/output (I/O) interfaces 1512, sensor components 1514, and communication components 1516.
The processing component 1502 generally controls overall triggering of the device 1500, such as triggering associated with display, phone call, data communication, camera triggering, and recording triggering. The processing components 1502 may include one or more processors 1520 executing instructions to perform all or a portion of the steps of the methods described above. Further, processing component 1502 may include one or more modules that facilitate interaction between processing component 1502 and other components. For example, processing component 1502 may include a multimedia module to facilitate interaction between multimedia component 1508 and processing component 1502.
The memory 1504 is configured to store various types of data to support triggering at the device 1500. Examples of such data include instructions for any application or method triggered on the device 1500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1506 provides power to the various components of the device 1500. The power components 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1500.
Multimedia component 1508 includes a screen that provides an output interface between device 1500 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide trigger. In some embodiments, multimedia component 1508 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 1500 is in a trigger mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1510 is configured to output and/or input audio signals. For example, the audio component 1510 includes a Microphone (MIC) configured to receive external audio signals when the device 1500 is in a triggering mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1504 or transmitted via the communication component 1516. In some embodiments, audio component 1510 also includes a speaker for outputting audio signals.
The I/O interface 1512 provides an interface between the processing component 1502 and peripheral interface modules, which can be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1514 includes one or more sensors for providing status assessment of various aspects of the device 1500. For example, the sensor component 1514 can detect an open/closed state of the device 1500, the relative positioning of components, such as a display and keypad of the device 1500, the sensor component 1514 can also detect a change in position of the device 1500 or a component of the device 1500, the presence or absence of user contact with the device 1500, orientation or acceleration/deceleration of the device 1500, and a change in temperature of the device 1500. The sensor assembly 1514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1516 is configured to facilitate wired or wireless communication between the device 1500 and other devices. The device 1500 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1516 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the device 1500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1504 comprising instructions, executable by the processor 1520 of the device 1500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a device, enable the device to perform a method of displaying custom control information, the method comprising:
acquiring request information for requesting to open a client software development interface;
and drawing target information of the custom control in the page according to the request information, wherein the target information at least comprises the class name of the custom control.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. A method for displaying custom control information is applied to a mobile terminal, and the method comprises the following steps:
acquiring request information for requesting to open a client software development interface;
drawing target information of a user-defined control in a page according to the request information, wherein the target information at least comprises a class name of the user-defined control;
drawing target information of a user-defined control in a page according to the request information, wherein the drawing step comprises the following steps:
and according to the request information, a mobile terminal for installing client software acquires a page message corresponding to a client software development interface returned by a server, the mobile terminal analyzes the page message and acquires module data of each module in the page, each module corresponds to a user-defined control, and the module data comprises target information to be displayed.
2. The method of claim 1, wherein obtaining request information for requesting to open a client software development interface comprises:
when the preset trigger information is detected through the preset interface, providing an information verification interface;
acquiring information to be verified through the information verification interface and performing information verification on the information to be verified;
and if the information to be verified passes the information verification, acquiring the request information.
3. The method of claim 2, wherein the drawing target information of the custom control in the page according to the request information comprises:
obtaining a custom control list of the page, wherein the custom control list comprises: the corresponding relation between the position information of each module and the control type of the user-defined control;
and drawing the target information of the custom control in the page according to the custom control list.
4. The method of claim 3, wherein the drawing the target information of the custom control in the page according to the custom control list comprises:
determining whether the control types of the custom controls are the same according to the custom control list;
if the control types of the user-defined controls are the same, determining whether the target information of the user-defined controls is the same;
if the target information of each user-defined control is the same, drawing the target information at a preset position of the page.
5. The method of claim 4, wherein the rendering the target information of the custom control in the page according to the custom control list further comprises:
and if the control types of the custom controls are different or the target information of the custom controls is different, drawing the target information of the custom controls in the page.
6. The method according to any one of claims 1 to 5, wherein the drawing of the target information of the custom control in the page includes:
acquiring target data corresponding to the target information from a custom control through at least one abstract method provided by a custom base class inherited to a native control of an android system; wherein the custom control inherits the custom base class;
and sequentially drawing the information of the custom base class and the target information of the custom control by rewriting a preset drawing method of the custom base class.
7. The method according to claim 6, wherein the preset drawing method comprises: dispatch draw () method.
8. The utility model provides a device of demonstration custom control information which sets up in mobile terminal, the device includes:
the client software development interface processing module is configured to obtain request information for requesting to open a client software development interface;
the display module is configured to draw target information of the custom control in the page according to the request information, and the target information at least comprises a class name of the custom control;
drawing target information of a user-defined control in a page according to the request information, wherein the drawing step comprises the following steps:
and according to the request information, a mobile terminal for installing client software acquires a page message corresponding to a client software development interface returned by a server, the mobile terminal analyzes the page message and acquires module data of each module in the page, each module corresponds to a user-defined control, and the module data comprises target information to be displayed.
9. The apparatus of claim 8, wherein the request module comprises:
the trigger submodule is configured to provide an information verification interface when detecting preset trigger information through a preset interface;
the verification submodule is configured to acquire information to be verified through the information verification interface and perform information verification on the information to be verified;
the request submodule is configured to acquire the request information under the condition that the information to be verified passes the information verification.
10. The apparatus of claim 9, wherein the display module comprises:
a control list obtaining sub-module configured to obtain a custom control list of the page, where the custom control list includes: the corresponding relation between the position information of each module and the control type of the user-defined control;
and the information drawing submodule is configured to draw the target information of the custom control in the page according to the custom control list.
11. The apparatus of claim 10, wherein the information rendering sub-module comprises:
the type determining unit is configured to determine whether the control types of the custom controls are the same according to the custom control list;
the information determining unit is configured to determine whether the target information of each custom control is the same under the condition that the control types of the custom controls are the same;
and the first drawing unit is configured to draw the target information at a preset position of the page under the condition that the target information of each custom control is the same.
12. The apparatus of claim 10, wherein the information rendering sub-module further comprises:
and the second drawing unit is configured to draw the target information of each custom control in the page under the condition that the control types of the custom controls are different or the target information of the custom controls is different.
13. The apparatus of claim 8, wherein the display module comprises:
the target data acquisition submodule is configured to acquire target data corresponding to the target information from the custom control through at least one abstract method provided by a custom base class inherited to the native control of the android system; wherein the custom control inherits the custom base class;
and the target information drawing submodule is configured to draw the information of the custom base class and the target information of the custom control in sequence by rewriting a preset drawing method of the custom base class.
14. The apparatus of claim 13, wherein the preset drawing method comprises: dispatch draw () method.
15. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the steps of the method of any of claims 1 to 7.
16. A mobile terminal, comprising:
a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring request information for requesting to open a client software development interface;
drawing target information of a user-defined control in a page according to the request information, wherein the target information at least comprises a class name of the user-defined control;
drawing target information of a user-defined control in a page according to the request information, wherein the drawing step comprises the following steps:
and according to the request information, a mobile terminal for installing client software acquires a page message corresponding to a client software development interface returned by a server, the mobile terminal analyzes the page message and acquires module data of each module in the page, each module corresponds to a user-defined control, and the module data comprises target information to be displayed.
CN201711354518.5A 2017-12-15 2017-12-15 Method and device for displaying user-defined control information Active CN108008955B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711354518.5A CN108008955B (en) 2017-12-15 2017-12-15 Method and device for displaying user-defined control information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711354518.5A CN108008955B (en) 2017-12-15 2017-12-15 Method and device for displaying user-defined control information

Publications (2)

Publication Number Publication Date
CN108008955A CN108008955A (en) 2018-05-08
CN108008955B true CN108008955B (en) 2021-01-01

Family

ID=62059481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711354518.5A Active CN108008955B (en) 2017-12-15 2017-12-15 Method and device for displaying user-defined control information

Country Status (1)

Country Link
CN (1) CN108008955B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733443A (en) * 2018-05-09 2018-11-02 成都市极米科技有限公司 A kind of APP dynamic configuration systems and its implementation, Dynamic Configuration based on android system
CN109213486A (en) * 2018-08-20 2019-01-15 北京百度网讯科技有限公司 Method and apparatus for generating customized visualization component
CN111190592B (en) * 2018-11-15 2022-06-21 武汉斗鱼网络科技有限公司 Page creation method, storage medium, electronic device and system
CN110457084B (en) * 2019-07-10 2021-11-30 五八有限公司 Loading method and device
CN112579078A (en) * 2019-09-27 2021-03-30 宝能汽车集团有限公司 Human-computer interface layout method, multimedia system and vehicle
CN110764767B (en) * 2019-10-28 2020-12-01 杭州衣科信息技术有限公司 User-defined query interface setting method based on iOS platform
CN110865799A (en) * 2019-10-31 2020-03-06 爱钱进(北京)信息科技有限公司 Control information display method and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369249A (en) * 2007-08-14 2009-02-18 国际商业机器公司 Method and apparatus for marking GUI component of software
CN103197888A (en) * 2013-03-29 2013-07-10 深圳众为兴技术股份有限公司 Display control method and device of parameter interface
CN105630290A (en) * 2015-12-24 2016-06-01 青岛海信电器股份有限公司 Interface processing method and device based on mobile device
CN105740145A (en) * 2016-01-27 2016-07-06 广州酷狗计算机科技有限公司 Method and device for locating element in control
CN106155712A (en) * 2015-03-26 2016-11-23 阿里巴巴集团控股有限公司 The acquisition methods of a kind of Windows control property and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917858B2 (en) * 2006-06-09 2011-03-29 Hewlett-Packard Development Company, L.P. Engine for rendering widgets using platform-specific attributes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369249A (en) * 2007-08-14 2009-02-18 国际商业机器公司 Method and apparatus for marking GUI component of software
CN103197888A (en) * 2013-03-29 2013-07-10 深圳众为兴技术股份有限公司 Display control method and device of parameter interface
CN106155712A (en) * 2015-03-26 2016-11-23 阿里巴巴集团控股有限公司 The acquisition methods of a kind of Windows control property and device
CN105630290A (en) * 2015-12-24 2016-06-01 青岛海信电器股份有限公司 Interface processing method and device based on mobile device
CN105740145A (en) * 2016-01-27 2016-07-06 广州酷狗计算机科技有限公司 Method and device for locating element in control

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
获取窗口与窗口中指定控件的各层级类名属性;陈金友;《绿色软件联盟》;20171211;第1-2页 *

Also Published As

Publication number Publication date
CN108008955A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
CN108008955B (en) Method and device for displaying user-defined control information
KR101770931B1 (en) Method, apparatus, program and computer-readable recording medium of generating communication module firmware and plug-in
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
EP3174249A1 (en) Network state information presentation method and apparatus, computer program and recording medium
CN110704053B (en) Style information processing method and device
EP3179749A1 (en) Device displaying method and apparatus, computer program and recording medium
CN107463372B (en) Data-driven page updating method and device
CN107450912B (en) Page layout method, device and terminal
EP3118729A1 (en) Method and device for presenting tasks
CN107402756B (en) Method, device and terminal for drawing page
CN108009269B (en) Method and device for displaying page data
CN108153540B (en) System upgrading method, device, terminal and storage medium
CN105468606B (en) Webpage saving method and device
CN113010157A (en) Code generation method and device
CN106773750B (en) Equipment image display method and device
CN106293683B (en) Project compiling method and device
CN112631695B (en) Data verification method and device, electronic equipment and storage medium
CN113590091A (en) Data processing method and device, electronic equipment and storage medium
CN110457084B (en) Loading method and device
CN109933357B (en) Application program upgrading method and device
CN108182145B (en) Method and device for verifying APP interface layout and computer readable storage medium
CN107423060B (en) Animation effect presenting method and device and terminal
CN107766722B (en) Application software installation processing method and device and electronic equipment
CN111596949B (en) Method and device for developing application program
CN113778385B (en) Component registration method, device, terminal and storage medium

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
GR01 Patent grant
GR01 Patent grant