CN113867857A - Progress bar display method, device and equipment based on Android system - Google Patents

Progress bar display method, device and equipment based on Android system Download PDF

Info

Publication number
CN113867857A
CN113867857A CN202111036267.2A CN202111036267A CN113867857A CN 113867857 A CN113867857 A CN 113867857A CN 202111036267 A CN202111036267 A CN 202111036267A CN 113867857 A CN113867857 A CN 113867857A
Authority
CN
China
Prior art keywords
layer
progress bar
progress
image
image layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111036267.2A
Other languages
Chinese (zh)
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.)
Guiyang Yuwan Technology Co ltd
Original Assignee
Guiyang Yuwan Technology 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 Guiyang Yuwan Technology Co ltd filed Critical Guiyang Yuwan Technology Co ltd
Priority to CN202111036267.2A priority Critical patent/CN113867857A/en
Publication of CN113867857A publication Critical patent/CN113867857A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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

Abstract

The application provides a progress bar display method, device and equipment based on an Android system, and the method comprises the following steps: the method comprises the steps of obtaining a first image layer and a second image layer, wherein the first image layer comprises a hollow-out pattern, the second image layer comprises a pattern progress bar, the first image layer is overlapped with the second image layer, the first image layer is positioned on the upper layer of the second image layer, and the projection of the hollow-out pattern of the first image layer on the second image layer is positioned in the coverage range of the pattern progress bar; and acquiring a target progress associated with the second image layer in real time, and controlling the display of the graphic progress bar in the second image layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow graphic is consistent with the target progress. And a simple graph progress bar is drawn on the first graph layer, and the hollow graph is used for realizing a complex progress bar (mainly an irregular progress bar), so that the development difficulty of the complex progress bar can be greatly reduced, and the development cost is reduced.

Description

Progress bar display method, device and equipment based on Android system
Technical Field
The application relates to the field of Android system development, in particular to a progress bar display method, device and equipment based on an Android system.
Background
In Android development, service scenes often meet the progress that progress bars are needed to show some things, and in most cases, the progress bar style of the Android system can meet the requirement, and the progress bars are generally square or square with round corners. However, in some richer application scenarios, some progress bars with irregular patterns need to be implemented by developers themselves, but cannot depend on progress bars with existing patterns of the system, such as a heart-shaped gradual change progress bar, a cartoon head portrait progress bar, and the like, and the progress bars with irregular patterns often make the developers have great difficulty or even have no choice in the implementation process.
At present, most of schemes for drawing irregular-style progress bars in an Android system adopt Bezier curves, the Bezier curves usually use three orders, and the coordinates of four points are determined in advance according to a graph to be drawn by using the three orders of the Bezier curves: one starting point, two control points, one end point, and then the result calculated using the third order bessel formula, is to draw a graph on a Canvas, which is currently a relatively common practice. The existing Bezier curve is used for drawing irregular graphs and has the following defects:
(1) the principle and the learning difficulty of the Bezier curve are high, and the problem is not easy to solve;
(2) before the third-order bezier curve is used, the coordinates of four points on the graph to be drawn need to be determined, and if the graph is a regular graph such as a circle, a rectangle and a square, the coordinates of the four points are easy to determine, but for an irregular graph such as a heart, the coordinates of the four points are difficult to determine, and a third-party tool is usually needed, so that the three-order bezier curve is obviously very unfriendly for developers, and the development cost is high.
Disclosure of Invention
An object of the embodiment of the application is to provide a progress bar display method, device and equipment based on an Android system, so that various progress bars can be drawn and displayed in a simple manner, development difficulty is greatly reduced, and development cost is saved.
In order to achieve the above object, embodiments of the present application are implemented as follows:
in a first aspect, an embodiment of the present application provides a progress bar display method based on an Android system, including: the method comprises the steps of obtaining a first image layer and a second image layer, wherein the first image layer comprises a hollow-out figure, the second image layer comprises a figure progress bar, the first image layer is overlapped with the second image layer, the first image layer is positioned on the upper layer of the second image layer, and the projection of the hollow-out figure of the first image layer on the second image layer is positioned in the coverage range of the figure progress bar; and acquiring a target progress associated with the second layer in real time, and controlling the display of the graphic progress bar in the second layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow graphic is consistent with the target progress.
In the embodiment of the application, through obtaining first map layer and second map layer, utilize first map layer to superpose on the second map layer, the projection of fretwork figure is located the coverage of figure progress bar, make the figure progress bar accessible of second map layer the fretwork figure part of first map layer demonstrate (the appearance of the progress bar that demonstrates is also the appearance of fretwork figure), thereby can draw simple figure progress bar (for example circular, rectangle, sectorial progress bar etc.) on first map layer, utilize the realization that the fretwork figure accomplished complicated progress bar (mainly be irregular progress bar, for example heart-shaped progress bar, cartoon head portrait progress bar etc.), greatly reduced complicated progress bar's the development degree of difficulty, reduce development cost.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the obtaining the first layer includes: acquiring a layer to be processed, and defining a display level of the layer; and preparing a hollow pattern with a required shape on the layer to be processed to obtain the first layer.
In the implementation mode, the display level of the layer is defined by obtaining the layer to be processed, and then the hollow-out pattern in the required shape is prepared on the layer to be processed, so that the first layer is obtained. The method can simply and conveniently prepare the hollow-out pattern with the complicated required shape, and is favorable for greatly reducing the development difficulty.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the preparing a hollow pattern with a desired shape on the layer to be processed includes: determining a graphic area on the layer to be processed; and preparing a hollow pattern with a required shape in the pattern area, and determining a reference point position of the hollow pattern.
In the implementation mode, a graph area is determined on the graph layer to be processed, then the hollow graph with the required shape is prepared in the graph area, and the reference point position of the hollow graph is determined, so that the hollow graph of the first graph layer and the graph progress bar of the second graph layer can be accurately corresponding with the help of the graph area, the reference point position and the like when the first graph layer and the second graph layer are superposed in the follow-up process.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, before obtaining the first layer, the method further includes: acquiring a background color of a display page of an Android system; and setting the color of the layer to be processed as the background color.
In the implementation mode, the background color of the display page of the Android system is obtained, and the color of the layer to be processed is set as the background color, so that the display effect is more harmonious.
With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the obtaining the second layer includes: acquiring a layer to be drawn, and defining a display level of the layer, wherein the layer to be drawn is a layer inheriting a layer class of an Android system; and drawing a graph progress bar on the graph layer to be drawn by using a Canvas to obtain the second graph layer.
In the implementation mode, a layer to be drawn (a layer inheriting a layer class of an Android system) is obtained, a display level of the layer is defined, and then a Canvas is used for drawing a graph progress bar on the layer to be drawn, so that a second layer is obtained. By the method, a Canvas of an Android system can be used for drawing a simple graph progress bar simply and conveniently, development difficulty is greatly reduced, and learning cost of developers is reduced.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the drawing, by using a Canvas, a graph progress bar on the layer to be drawn includes: determining a progress bar area on the layer to be processed, and determining a reference point position of a graphic progress bar in the progress bar area; and drawing the graph progress bar in the progress bar area by using Canvas based on the reference point position of the graph progress bar.
In the implementation mode, the progress bar area is determined on the layer to be processed, the reference point position of the graphic progress bar is determined in the progress bar area, and then based on the reference point position of the graphic progress bar, the Canvas is used for drawing the graphic progress bar in the progress bar area, so that the hollow graphic of the first layer and the graphic progress bar of the second layer can be accurately corresponding with the help of the progress bar area, the reference point position and the like when the first layer and the second layer are superposed in the follow-up process.
With reference to the first aspect, in a sixth possible implementation manner of the first aspect, the first layer includes a reference point location of the hollow graph, the second graph includes a reference point location of the graph progress bar, and after the first layer and the second layer are obtained, the method further includes: and superposing the first image layer on the second image layer, and aligning the reference point position of the hollow-out image with the reference point position of the image progress bar, so that the projection of the hollow-out image on the second image layer is positioned in the coverage range of the image progress bar, and the image progress bar is carried out based on the reference point position of the image progress bar and the reference point position of the hollow-out image when displaying the progress.
In the implementation mode, the first layer is superposed on the second layer, and the reference point location of the hollow-out figure is aligned with the reference point location of the figure progress bar, so that the projection of the hollow-out figure on the second layer is located in the coverage range of the figure progress bar, and the figure progress bar is carried out based on the reference point location of the figure progress bar and the reference point location of the hollow-out figure when showing progress. Therefore, the progress bar can use the reference point position of the hollow graph and the reference point position of the graph progress bar as the benchmark in the display process, and the graph progress bar of the second graph layer is guaranteed to be displayed through the hollow graph of the first graph layer (on the basis of the reference point positions of the two, such as the starting point and the end point which are respectively in one-to-one correspondence). Thus, a good progress display effect can be ensured.
In a second aspect, an embodiment of the present application provides a progress bar display device based on an Android system, including: the image layer obtaining unit is used for obtaining a first image layer and a second image layer, wherein the first image layer comprises a hollow pattern, the second image layer comprises a pattern progress bar, the first image layer is overlapped with the second image layer, the first image layer is positioned on the upper layer of the second image layer, and the projection of the hollow pattern of the first image layer on the second image layer is positioned in the coverage range of the pattern progress bar; and the progress display unit is used for acquiring the target progress associated with the second layer in real time and controlling the display of the graphic progress bar in the second layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow-out graphic is consistent with the target progress.
In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device where the storage medium is located is controlled to execute the method for displaying a progress bar based on an Android system according to the first aspect or any one of possible implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is configured to store information including program instructions, and the processor is configured to control execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the method for displaying a progress bar based on an Android system according to any one of the first aspect or possible implementation manners of the first aspect.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of a progress bar display method based on an Android system according to an embodiment of the present application.
FIG. 2 is a schematic diagram of a View with a heart-shaped hollow pattern according to an embodiment of the present disclosure.
FIG. 3 is a schematic diagram of a View with a progress bar according to an embodiment of the present application.
FIG. 4 is a schematic diagram illustrating a View with a heart-shaped hollow pattern and a View with a progress bar which are superimposed according to an embodiment of the present application.
Fig. 5 is a block diagram of a structure of a progress bar display device based on an Android system according to an embodiment of the present application.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present application.
Icon: 10-progress bar display device based on Android system; 11-a layer obtaining unit; 12-a progress presentation unit; 20-an electronic device; 21-a memory; 22-a communication module; 23-a bus; 24-a processor.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a progress bar display method based on an Android system according to an embodiment of the present application.
In this embodiment, the Android system-based progress bar display method may include step S10 and step S20. The progress bar display method based on the Android system is mainly applied to electronic equipment, namely an intelligent terminal with the Android system, such as a smart phone, a tablet computer and the like, and is not limited herein.
In order to simplify the difficulty of drawing a complex progress bar (mainly an irregular progress bar, such as a heart-shaped progress bar, a cartoon avatar progress bar, etc.) in the Android development, step S10 may be performed.
Step S10: the method comprises the steps of obtaining a first layer and obtaining a second layer, wherein the first layer contains a hollow-out pattern, the second layer contains a pattern progress bar, the first layer is overlapped with the second layer, the first layer is located on the upper layer of the second layer, and the projection of the hollow-out pattern on the second layer of the first layer is located in the coverage range of the pattern progress bar.
In this embodiment, a first layer and a second layer may be obtained. Here, the obtained first image layer contains a hollow-out pattern, the second image layer contains a pattern progress bar, the first image layer is overlapped with the second image layer, the first image layer is located on the upper layer of the second image layer, and the projection of the hollow-out pattern of the first image layer on the second image layer is located in the coverage range of the pattern progress bar. In short, the figure progress bar on second picture layer can see through the fretwork figure on first picture layer and demonstrate, and other parts are then sheltered from by first picture layer to make figure progress bar and fretwork figure combine together, the progress bar of this kind of shape of fretwork figure is seen to the vision, and can demonstrate according to the anticipated progress.
For example, the Android system includes a first map library and a second map library, the first map library includes a plurality of pre-prepared first map layers, each of the first map layers has various hollow patterns, the second map library includes a plurality of pre-prepared second map layers, and each of the second map layers has various pattern progress bars. Of course, if the hollow pattern of each first layer is convenient to match, the hollow pattern of each first layer can be located in the coverage range of the pattern progress bar of each second layer.
It should be noted that the layers (the first layer, the second layer, and the like) mentioned in this embodiment belong to views that can be seen by naked eyes in the screen in Android, and the layout manner of the views may be composed of multiple views, the views and the views are in a hierarchical relationship, and they may be arranged horizontally, vertically, or overlapped, and for the overlapped views, two graphics will be seen by naked eyes of people to be overlapped. Therefore, the layer referred to in this embodiment is View.
Of course, the first layer and/or the second layer may also be temporarily prepared, and for the convenience of understanding of the present solution, the preparation of the first layer and the second layer will be separately described below.
Aiming at the preparation of the first layer: in this embodiment, an image layer to be processed may be obtained, and a display level of the image layer may be defined (for example, a level is defined as a level n +1, and n is a positive integer). The display hierarchy is mainly used for defining the hierarchy of layers, and the representation of the uppermost layer can be comprehensively displayed to a user.
And then, preparing a hollow pattern with a required shape on the layer to be processed to obtain a first layer.
The method can simply and conveniently prepare the hollow-out pattern with the complicated required shape, and is favorable for greatly reducing the development difficulty.
For example, a graphic region may be determined on the layer to be processed, a hollow graphic with a desired shape may be prepared in the graphic region, and a reference point location of the hollow graphic may be determined.
It should be noted that the graphic area is mainly used to determine the range of the hollow graphic, and of course, the graphic area may also be used to limit the range of the graphic progress bar matched with the hollow graphic. Even, a simple manner may be adopted, that is, the outline of the progress bar of the graph in the second layer is determined first, and then the graph area is determined correspondingly based on the coordinates of the progress bar area occupied by the progress bar of the graph (usually, the progress bar of a regular graph, which is simpler, such as a circle, a rectangle, a bar row, etc.) in the second layer, so as to limit the range of the hollow graph. Or, determining a graph area, and preparing a hollow graph in the graph area to use the graph area as a reference for drawing the progress bar, so that the range occupied by the graph progress bar drawn on the second graph layer needs to cover the range of the hollow graph projected on the second graph layer.
The reference point location may be used as a point location reference when the progress bar starts and ends, for example, a start point location, a 10% point location, a 40% point location, a 100% point location (i.e., an end point location), and the like. Of course, there are some special reference points, for example, for the case that the circular progress bar represents progress in circular motion, only one reference point (only the start point) may be set to indicate the start part of the progress display, which is not limited herein.
The second image layer with the required hollow shape is prepared in the mode, so that the hollow-out pattern of the first image layer can accurately correspond to the pattern progress bar of the second image layer by means of a pattern area, a reference point position and the like when the first image layer and the second image layer are superposed in the follow-up process, and the display function of the progress bar is guaranteed.
In this embodiment, in order to ensure the display effect of the page, the background color of the display page of the Android system may also be obtained, and the color of the layer to be processed is set as the background color, so that the display effect is more harmonious and unobtrusive.
Aiming at the preparation of the second layer: in this embodiment, a layer to be drawn (a layer that inherits a layer class of an Android system) may be obtained, and a presentation level of the layer is defined (for example, the level is defined as a level n, where n is a positive integer). In contrast, the second layer is located on the lower layer of the first layer, the first layer can shield (partially shield) the second layer, and certainly, the hollow-out pattern portion of the first layer can expose the content (a part of the pattern progress bar) on the corresponding position of the second layer, so that the content displayed on the screen through the electronic device is the progress bar in the hollow-out pattern.
And then, drawing a graph progress bar on the graph layer to be drawn by using Canvas to obtain a second graph layer.
By the method, a Canvas of an Android system can be used for drawing a simple graph progress bar simply and conveniently, development difficulty is greatly reduced, and learning cost of developers is reduced.
For example, a progress bar region may be determined on the layer to be processed, where the progress bar region is generally larger than the graphic region on the first layer (because the graphic progress bar drawn on the progress bar region needs to cover the projection of the hollow graphic on the second layer). Of course, it can also be provided that: the size, the shape and the position of the graph area are consistent with those of the graph progress bar area, the hollow graph is prepared in the graph area, the graph progress bar area is filled with the graph progress bar area as far as possible, so that the graph area and the progress bar area can be used as positioning reference when the first graph layer and the second graph layer are stacked, drawing reference of the hollow graph and the graph progress bar can be guided, and the fact that the projection of the hollow graph on the second graph layer can be always located in the coverage range of the graph progress bar can be guaranteed.
Then, the reference point position of the graphic progress bar can be determined in the progress bar area, the reference point position of the graphic progress bar can be determined by taking the reference point position of the hollow graphic as a reference, (the starting point position, the ending point position and the like can be in one-to-one correspondence, and therefore the synchronous progress display effect is guaranteed).
After the reference point location of the graph progress bar is determined, the graph progress bar can be drawn in the progress bar area by using Canvas based on the reference point location of the graph progress bar.
The progress bar area is determined on the graph layer to be processed, the reference point position of the graph progress bar is determined in the progress bar area, then the graph progress bar is drawn in the progress bar area by means of Canvas based on the reference point position of the graph progress bar, so that the hollow graph of the first graph layer accurately corresponds to the graph progress bar of the second graph layer by means of the progress bar area, the reference point position and the like when the first graph layer and the second graph layer are superposed, and the display effect of the progress bar is guaranteed.
Because the mode of preparing the progress bar (usually the progress bar of the regular graph) by using the Canvas is simple and convenient, is generally known by Android developers, and does not need to perform additional learning or only needs to perform a small amount of learning, the learning difficulty and the time cost of the developers can be greatly reduced, thereby reducing the research and development cost.
In addition, the above is an exemplary description of a process for preparing the first layer and the second layer, and the preparation of the first layer and the second layer may also be performed in other manners, which is not limited herein.
After the first image layer and the second image layer are obtained, the first image layer can be overlapped on the second image layer, and the reference point position of the hollow-out image is aligned with the reference point position of the image progress bar, so that the projection of the hollow-out image on the second image layer is located in the coverage range of the image progress bar, and the image progress bar is based on the reference point position of the image progress bar and the reference point position of the hollow-out image when displaying progress.
For example, if a first layer (an n +1 th layer) includes reference points (a start point and an end point) of a hollow graphic, and a second layer (an n th layer) includes reference points (a start point and an end point) of a graphic progress bar, where shapes, sizes, and positions of progress bar regions in the second layer are all consistent with those of the graphic region in the first layer (of course, the positions of the reference points of the hollow graphic in the first layer are consistent with those of the reference points of the graphic progress bar in the second layer), when the first layer and the second layer are superimposed, the reference points of the hollow graphic and the reference points of the graphic progress bar may be corresponded by corresponding the graphic regions to the progress bar regions, so as to superimpose the first layer on the second layer.
Therefore, the accuracy of superposition of the first image layer and the second image layer can be guaranteed, the progress bar can use the reference point position of the hollow-out pattern and the reference point position of the graphic progress bar as a reference in the display process, and the graphic progress bar of the second image layer can be guaranteed to be subjected to progress display through the hollow-out pattern of the first image layer (based on the reference point positions of the first image layer and the second image layer, for example, the starting point and the terminal point are in one-to-one correspondence respectively). Thus, a good progress display effect can be ensured.
Then, step S20 may be performed.
Step S20: and acquiring a target progress associated with the second layer in real time, and controlling the display of the graphic progress bar in the second layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow graphic is consistent with the target progress.
In this embodiment, in order to achieve the display function of the progress bar, the progress is displayed in real time, the target progress (for example, transmission progress, loading progress, and the like) associated with the second image layer may be obtained in real time, and the display of the graphic progress bar in the second image layer is controlled according to the target progress, so that the progress displayed after the graphic progress bar penetrates through the hollow graphic is consistent with the target progress.
By acquiring a first layer and a second layer, and superposing the first layer on the second layer, the projection of the hollow pattern is positioned in the coverage range of the pattern progress bar, so that the graphic progress bar of the second layer can be displayed through the hollow graphic part of the first layer (the displayed progress bar is also the hollow graphic), therefore, simple graph progress bars (such as round, rectangular and fan-shaped progress bars) can be drawn on the first graph layer, the complex progress bars (mainly irregular progress bars, such as heart-shaped progress bars and cartoon head portrait progress bars) are achieved by means of the hollow graphs (the difficulty in preparing the hollow graphs with complex shapes is far lower than that in drawing the progress bars with the same shapes by means of Bezier curves), the development difficulty of the complex progress bars is greatly reduced, and the development cost is reduced.
In the following, an example of applying the present scheme to prepare a complex progress bar will be described as an example:
firstly, the native View class of the Android can be inherited to realize a View (namely, the second layer, the native Canvas can be used to draw a graph progress bar), which may be called as: circumflex AndSectorProgressView. The responsibility of this custom View is to draw regular graphics, such as rectangles, circles or sectors, based on the progress value and provide the functions of progress bar color gradient and background.
The user-defined View is then overlaid with the View (i.e., the first layer) of the skeleton picture, which provides irregular graphics, such as a heart (as shown in fig. 2). The irregular figure in the picture needs to be completely transparent, and the area outside the irregular figure can be white or other colors, which needs to be determined according to the color of a specific page (usually, but not limited to, the background color of the displayed page).
After the above two steps are done, a regular graph can be drawn on the CircleAndSectorProgressView according to different progress values. For example 50% of the current progress, a half circle with a given color (shown as a line overlay) may be drawn (as shown in fig. 3). The picture View (the first layer) covering the View (the second layer) shows a half circle just drawn through the hollowed part of the picture, at this time, only the hollowed part will expose the color of the View below, because the other part of the picture is not transparent, the View below cannot be seen, the color of the exposed half circle is the current progress of the irregular figure, and the background color is the progress of the progress bar which has not been run (as shown in fig. 4).
According to the scheme, the very complicated rendering and drawing of the irregular pattern progress bar are ingeniously realized by means of the characteristic that two views can be overlapped and the mode that the drawing of the regular pattern is combined with the hollow-out picture, the drawing work of the irregular pattern is moved to the picture manufacturing, the hollow-out picture of the irregular pattern is relatively simple to manufacture and is relatively easy to realize. In addition, the scheme can deal with progress bars with various irregular patterns, and only the hollow-out pictures with different patterns need to be provided, so that the development difficulty of developers is greatly simplified.
Referring to fig. 5, based on the same inventive concept, an embodiment of the present application further provides a progress bar display device 10 based on an Android system, including:
the image layer obtaining unit 11 is configured to obtain a first image layer and a second image layer, where the first image layer includes a hollow pattern, the second image layer includes a pattern progress bar, the first image layer overlaps the second image layer, the first image layer is located on an upper layer of the second image layer, and a projection of the hollow pattern on the second image layer on the first image layer is located in a coverage range of the pattern progress bar.
And the progress display unit 12 is configured to obtain a target progress associated with the second layer in real time, and control display of a graphic progress bar in the second layer according to the target progress, so that the progress displayed by the graphic progress bar after penetrating through the hollow graphic is consistent with the target progress.
In this embodiment, the layer obtaining unit 11 is further configured to obtain a layer to be processed, and define a display level of the layer; and preparing a hollow pattern with a required shape on the layer to be processed to obtain the first layer.
In this embodiment, the layer obtaining unit 11 is further configured to determine a graphic area on the layer to be processed; and preparing a hollow pattern with a required shape in the pattern area, and determining a reference point position of the hollow pattern.
In this embodiment, the layer obtaining unit 11 is further configured to obtain a background color of a display page of an Android system before the first layer is obtained; and setting the color of the layer to be processed as the background color.
In this embodiment, the layer obtaining unit 11 is further configured to obtain a layer to be drawn, and define a display level of the layer, where the layer to be drawn is a layer that inherits a layer class of an Android system; and drawing a graph progress bar on the graph layer to be drawn by using a Canvas to obtain the second graph layer.
In this embodiment, the layer obtaining unit 11 is further configured to determine a progress bar area on the layer to be processed, and determine a reference point location of a graphic progress bar in the progress bar area; and drawing the graph progress bar in the progress bar area by using Canvas based on the reference point position of the graph progress bar.
In this embodiment, the first layer includes the reference point location of the hollow-out pattern, the second pattern includes the reference point location of the pattern progress bar, the Android system-based progress bar display device 10 further includes a layer stacking unit, configured to align the reference point location of the hollow-out pattern with the reference point location of the pattern progress bar after the layer acquisition unit 11 acquires the first layer and the second layer, so that the projection of the hollow-out pattern on the second layer is located within the coverage of the pattern progress bar, and the pattern progress bar is performed based on the reference point location of the pattern progress bar and the reference point location of the hollow-out pattern when displaying the progress.
The embodiment of the application further provides a storage medium, where the storage medium includes a stored program, and when the program runs, the device where the storage medium is located is controlled to execute the Android system-based progress bar display method in the embodiment.
Referring to fig. 6, fig. 6 is a block diagram of an electronic device 20 according to an embodiment of the present disclosure.
In this embodiment, the electronic device 20 is a terminal with an Android system, such as a smart phone, a tablet computer, and the like, which is not limited herein.
Illustratively, the electronic device 20 may include: a communication module 22 connected to the outside world via a network, one or more processors 24 for executing program instructions, a bus 23, and a different form of memory 21, such as a disk, ROM, or RAM, or any combination thereof. The memory 21, the communication module 22, and the processor 24 may be connected by a bus 23. In addition, the electronic device 20 may further include a display screen (e.g., an OLED display screen, a liquid crystal display screen, etc.) that may display a user interface of a specific client, which is not limited herein.
Illustratively, the memory 21 has stored therein a program. The processor 24 may call and run the programs from the memory 21, so that the Android system-based progress bar presentation method may be implemented by running the programs.
To sum up, the embodiment of the application provides a progress bar display method, device and equipment based on an Android system, through obtaining a first image layer and a second image layer, the first image layer is superposed on the second image layer, and the projection of a hollow-out figure is located in the coverage range of the progress bar of the figure, so that the progress bar of the figure of the second image layer can be displayed through the hollow-out figure part of the first image layer (the displayed progress bar is also the hollow-out figure), and thus a simple progress bar of the figure (such as a round progress bar, a rectangular progress bar, a fan-shaped progress bar and the like) can be drawn on the first image layer, and the realization of a complex progress bar (mainly an irregular progress bar, such as a heart-shaped progress bar and a cartoon head-portrait progress bar) is completed by utilizing the hollow-out figure, thereby greatly reducing the development difficulty of the complex progress bar and reducing the development cost.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A progress bar display method based on an Android system is characterized by comprising the following steps:
the method comprises the steps of obtaining a first image layer and a second image layer, wherein the first image layer comprises a hollow-out figure, the second image layer comprises a figure progress bar, the first image layer is overlapped with the second image layer, the first image layer is positioned on the upper layer of the second image layer, and the projection of the hollow-out figure of the first image layer on the second image layer is positioned in the coverage range of the figure progress bar;
and acquiring a target progress associated with the second layer in real time, and controlling the display of the graphic progress bar in the second layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow graphic is consistent with the target progress.
2. The Android system-based progress bar display method of claim 1, wherein the obtaining of the first layer comprises:
acquiring a layer to be processed, and defining a display level of the layer;
and preparing a hollow pattern with a required shape on the layer to be processed to obtain the first layer.
3. The Android system-based progress bar display method according to claim 2, wherein the preparing of the hollow pattern with the required shape on the layer to be processed includes:
determining a graphic area on the layer to be processed;
and preparing a hollow pattern with a required shape in the pattern area, and determining a reference point position of the hollow pattern.
4. The Android system-based progress bar display method of claim 2, wherein before the obtaining of the first layer, the method further comprises:
acquiring a background color of a display page of an Android system;
and setting the color of the layer to be processed as the background color.
5. The Android system-based progress bar display method of claim 1, wherein the obtaining of the second layer comprises:
acquiring a layer to be drawn, and defining a display level of the layer, wherein the layer to be drawn is a layer inheriting a layer class of an Android system;
and drawing a graph progress bar on the graph layer to be drawn by using a Canvas to obtain the second graph layer.
6. The Android system-based progress bar display method of claim 5, wherein the drawing of the graphic progress bar on the layer to be drawn by using a Canvas comprises:
determining a progress bar area on the layer to be processed, and determining a reference point position of a graphic progress bar in the progress bar area;
and drawing the graph progress bar in the progress bar area by using Canvas based on the reference point position of the graph progress bar.
7. The Android system-based progress bar display method of claim 1, wherein the first image layer includes reference points of the hollow graphic, the second graphic includes reference points of the graphic progress bar, and after the first image layer and the second image layer are obtained, the method further comprises:
and superposing the first image layer on the second image layer, and aligning the reference point position of the hollow-out image with the reference point position of the image progress bar, so that the projection of the hollow-out image on the second image layer is positioned in the coverage range of the image progress bar, and the image progress bar is carried out based on the reference point position of the image progress bar and the reference point position of the hollow-out image when displaying the progress.
8. The utility model provides a progress bar display device based on Android system which characterized in that includes:
the image layer obtaining unit is used for obtaining a first image layer and a second image layer, wherein the first image layer comprises a hollow pattern, the second image layer comprises a pattern progress bar, the first image layer is overlapped with the second image layer, the first image layer is positioned on the upper layer of the second image layer, and the projection of the hollow pattern of the first image layer on the second image layer is positioned in the coverage range of the pattern progress bar;
and the progress display unit is used for acquiring the target progress associated with the second layer in real time and controlling the display of the graphic progress bar in the second layer according to the target progress so that the displayed progress of the graphic progress bar after penetrating through the hollow-out graphic is consistent with the target progress.
9. A storage medium, characterized in that the storage medium includes a stored program, and when the program runs, the device where the storage medium is located is controlled to execute the Android system based progress bar display method according to any one of claims 1 to 7.
10. An electronic device, comprising a memory for storing information including program instructions and a processor for controlling execution of the program instructions, wherein the program instructions are loaded and executed by the processor to implement the Android system based progress bar presentation method of any one of claims 1 to 7.
CN202111036267.2A 2021-09-06 2021-09-06 Progress bar display method, device and equipment based on Android system Pending CN113867857A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111036267.2A CN113867857A (en) 2021-09-06 2021-09-06 Progress bar display method, device and equipment based on Android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111036267.2A CN113867857A (en) 2021-09-06 2021-09-06 Progress bar display method, device and equipment based on Android system

Publications (1)

Publication Number Publication Date
CN113867857A true CN113867857A (en) 2021-12-31

Family

ID=78989542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111036267.2A Pending CN113867857A (en) 2021-09-06 2021-09-06 Progress bar display method, device and equipment based on Android system

Country Status (1)

Country Link
CN (1) CN113867857A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024032139A1 (en) * 2022-08-09 2024-02-15 惠州Tcl移动通信有限公司 Interface display method and apparatus, computer device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295244A (en) * 2007-04-29 2008-10-29 鸿富锦精密工业(深圳)有限公司 Progress bar design system and method
CN105608161A (en) * 2015-12-18 2016-05-25 北京金山安全软件有限公司 Loading progress display method and terminal
CN106970868A (en) * 2017-04-10 2017-07-21 广东欧珀移动通信有限公司 Method for information display, device and terminal
CN107256164A (en) * 2017-07-31 2017-10-17 北京酷我科技有限公司 The optimization processing algorithm of self-defined shape progress bar under a kind of Mac
CN108255387A (en) * 2016-12-29 2018-07-06 广东中科遥感技术有限公司 Touch screen mobile terminal image rapid comparison exchange method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295244A (en) * 2007-04-29 2008-10-29 鸿富锦精密工业(深圳)有限公司 Progress bar design system and method
CN105608161A (en) * 2015-12-18 2016-05-25 北京金山安全软件有限公司 Loading progress display method and terminal
CN108255387A (en) * 2016-12-29 2018-07-06 广东中科遥感技术有限公司 Touch screen mobile terminal image rapid comparison exchange method
CN106970868A (en) * 2017-04-10 2017-07-21 广东欧珀移动通信有限公司 Method for information display, device and terminal
CN107256164A (en) * 2017-07-31 2017-10-17 北京酷我科技有限公司 The optimization processing algorithm of self-defined shape progress bar under a kind of Mac

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024032139A1 (en) * 2022-08-09 2024-02-15 惠州Tcl移动通信有限公司 Interface display method and apparatus, computer device and storage medium

Similar Documents

Publication Publication Date Title
US11217015B2 (en) Method and apparatus for rendering game image
CA1246239A (en) System and method for displaying and interactively excavating and examining a three dimensional volume
CN102356375B (en) Smooth layout animation of continuous and non-continuous properties
US11113876B2 (en) Method for displaying a 3D scene graph on a screen
CN111324837B (en) Three-dimensional chart visualization method and device based on GIS system at web front end
CN108939556B (en) Screenshot method and device based on game platform
CN111803945B (en) Interface rendering method and device, electronic equipment and storage medium
CN105389090B (en) Method and device, mobile terminal and the computer terminal of game interaction interface display
CN106873863A (en) The method to set up and device of a kind of changing interface animation
CN111583379B (en) Virtual model rendering method and device, storage medium and electronic equipment
CN113867857A (en) Progress bar display method, device and equipment based on Android system
CN106033334A (en) An interface element drawing method and device
CN112274934A (en) Model rendering method, device, equipment and storage medium
CN111930291A (en) Method and system for realizing personalized shadow on Android platform
CN109840929B (en) Method and device for realizing dynamic base line drawing based on Echarts
KR20040011525A (en) Drawing method
WO2023173828A1 (en) Scene element processing method and apparatus, device, and medium
CN115081384B (en) EDA-based data dynamic visualization system
CN113192173B (en) Image processing method and device of three-dimensional scene and electronic equipment
CN106846449B (en) Rendering method and device for visual angle material or map
CN112001995B (en) Rendering apparatus, method, electronic device, and readable storage medium
CN115965731A (en) Rendering interaction method, device, terminal, server, storage medium and product
CN108830928A (en) Mapping method, device, terminal device and the readable storage medium storing program for executing of threedimensional model
WO2022100059A1 (en) Data storage management method, object rendering method, and device
CN114419226A (en) Panorama rendering method and device, computer equipment 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