Skip to content

This is a library and demo about the FlowView, which can show the tags whith multi type.

Notifications You must be signed in to change notification settings

liangzhongtai/FlowView

Repository files navigation

abstract

This project will be display how to use the widget FlowView.

FlowView


About me, Blog:jianshu wechat:lzt橘子

Photo sample:

Caracter

  • FlowViewView offer 17way show type;

  • COMMON_WITH_CLOSE = -2 can't select , offer a close tag to hide the FlowView;

  • SINGLE = 0 can select only one tag;

  • SINGLE_WITH_CLOSE = 1 can select only one tag, offer a close tag to hide the FlowView;

  • SINGLE_WITH_CONFIRM = 2 can select only one tag, offer a confirm tag to hide the FlowView;

  • SINGLE_WITH_TITLE = 3 can select only one tag, offer a title tag at the first index or first line;

  • SINGLE_WITH_TITLE_CLOSE = 4 can select only one tag, offer a title tag and a close tag;

  • SINGLE_WITH_TITLE_CONFIRM = 5 can select only one tag, offer a title tag and a confirm tag;

  • MULTIPLE = 6 can select multi tags;

  • MULTIPLE_WITH_CLOSE = 7 can select multi tags, offer a close tag for hide the FlowView;

  • MULTIPLE_WITH_ALL = 8 can select multi tags, offer a select all tag at the first index or last line;

  • MULTIPLE_WITH_TITLE = 9 can select multi tags, offser a title tag at the first index or first line;

  • MULTIPLE_WITH_TITLE_CLOSE = 10 can select multi tags, offer a title tag and a close tag;

  • MULTIPLE_WITH_TITLE_ALL = 11 can select multi tags, offer a title tag and a select all tag;

  • MULTIPLE_WITH_TWO_BUTTON = 12 can select multi tags,offer a select tag and a revers select tag;

  • MULTIPLE_WITH_THREE_BUTTON = 13 can select multi tags,offer a select tag , a revers select tag and a confirm tag;

  • MULTIPLE_WITH_TITLE_TWO_BUTTON = 14 can select multi tags,offer a title tag,a select all tag and a revers tag;

  • MULTIPLE_WITH_TITLE_THREE_BUTTON = 15 can select multi tags,offer a title tag,a select all tag,a revers tag and a confirm tag;

Theory explain

FlowView first int the onMeasure(), meaure the text width of child view, and count the eatch line can fill how many childs and the how many lines can fill all the tag, then int the layout(), count the eatch view's left ,top,right,bottom by the first step's result, last use the child's layout to fill the child into their parent.

download install

Project_Gradle

allprojects {
		    repositories {
			    maven { url 'https://jitpack.io' }
		    }
	}

App_Gradle:

dependencies {
	         compile 'com.github.liangzhongtai:FlowView:v1.1'
	}

how to use

1.attrs

(1).This attrs can define int the res file //if true , the FlowView will auto count the max childs in eatch line; //if true , you must set the fv_onrLineCount a value which > 0, this priority higher the fv_useAutoGrid; //you can set how many childs et eatch line; //you can set how many line in the FlowView, but first ni must layout the FlowView whitd the HoriztionScroollView; //you can set how width the horizion; //this attr is not effetive for the moment //if true ,will draw the horizion line int the FlowView. //if true ,will draw the vertical line int the FlowView. //the horizion line padding left. //the horizion line padding right. //the vertical line padding top. //the vertical line padding bottom. //the horizion line's' color. //the vertical line's color. //the horizion line's stroke width. //the vertical line's stroke width. //if true, the first horizion line will draw. //if true,the last horizion line will draw. //if true,the first vertical line will draw. //if true,the last vertical line will draw. //if true,the horizion line will draw under all the tag, include the close tag, confirm tag ,select all tag or rever tag.; //if true, the verticall line will draw heigher all the tag; //if true the horizion line and vertical line will draw the title tag; //you can set the line to solid or dash,now circle is has issue. //you can set the dash interval,like value:'4,4,4,4' //you can set the circle's radius ,now this attr is has a issue. //you can set the circle's interval. //this is the child tag bg res shape at the not select state. //this is the child tag bg res color at the not select state. //this is the child tag text color at the not select state. //this is the child tag bg res shape at the select state. //this is the child tag bg res color at the select state. //this is the child tag text color at the select sttae. //this is the button bg res shape like close tag,confirm tag,all select tag and revers tag. //this is the button bg res color like close tag,confirm tag,all select tag and revers tag. //this is the button text color like close tag,confirm tag,all select tag and revers tag. //this is the hot tag bg res shape //this is the hot tag bg res color //this is the hot tag text color. //if true, the tag will has the select state. //this four attr is the padding of the FlowView //this is horizion interval between the child tag. //this is vertical interval between the child tag. //if true ,the all select tag will at the first index; //if true, the colse tag will at the first index. //if true, the confir, will at the first index. //this attr will affect the horition type how many child tags at the eatch line. //if true, the title tag will alone at the first line. //you can set the animation when add the tags. //this 0~15 is effective.

(2).You can set the attr of the FlowView in the java,eatch Type will has the corresponding method,like this: SINGLE: image MULTIPLE: image MULTIPLE and useGrid: image MULTIPLE and useHorizion: image

Matters need attention

-if you want to tht FlowView show like the Horiztion,must layout it into the HorizionScrollView. image

License

About

This is a library and demo about the FlowView, which can show the tags whith multi type.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages