Android custom flowchart control instance code

Effect drawing first:

As shown in the figure, settings can be realized: total process number, completed progress number, completed color, and each title

GitHub address stamp here

usage method

1. Import the dependent package of compile 'com. GitHub. Pavlospt: circleview: 1.3' (because circleview is used)

2. Directly copy and paste the following two files, one Java and one XML, into the project (the code is placed at the end of the article. It has not been made into an open source library yet. If you have time, you can directly make it into a dependency package and pour it in)

Write processimg control in XML

Instantiate processimg object in Java file

Call several methods as needed

1. Object. SetColor (int color)

Set the color of the completed progress, and pass in the integer value of the color

2. Object. Setprocess (int total, int process)

Set the total number of processes and the number of completed progress. The first parameter is the total number of processes (1 ~ 6, because more than 6 are stacked in a row, it is difficult to see), and the second is the number of completed processes, both of which are integer variables

3. Object. Settitle (int position, string text)

Set the title of each process. The first parameter is the number of processes corresponding to the title (1 ~ total), and the second parameter is the title text source code in string format

The source code is very simple and the comments are relatively clear. You should be able to understand it

process_ img.xml

ProcessImg.java

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>