All Projects → hymanme → Tagflowlayout

hymanme / Tagflowlayout

Licence: apache-2.0
支持多选的自定义标签View,可展开收起,标签样式可自定义。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Tagflowlayout

Release Man
听说你发新版总忘记打 Tag 和改 package.json?
Stars: ✭ 14 (-79.41%)
Mutual labels:  tags
V Tag Suggestion
A simple tag component with typeahead
Stars: ✭ 40 (-41.18%)
Mutual labels:  tags
Framelayoutkit
FrameLayoutKit is a super fast and easy to use autolayout kit
Stars: ✭ 53 (-22.06%)
Mutual labels:  autolayout
Nb Choices
Angular wrapper for choices.js, vanilla, lightweight, configurable select box/text input plugin
Stars: ✭ 32 (-52.94%)
Mutual labels:  tags
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (+1347.06%)
Mutual labels:  autolayout
Wstagsfield
An iOS text field that represents tags, hashtags, tokens in general.
Stars: ✭ 1,013 (+1389.71%)
Mutual labels:  tags
React Input Tags
React component for tagging inputs.
Stars: ✭ 10 (-85.29%)
Mutual labels:  tags
Django Taggit Labels
Clickable label widget for django-taggit
Stars: ✭ 62 (-8.82%)
Mutual labels:  tags
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-41.18%)
Mutual labels:  autolayout
Keyboardlayoutguide
⌨️ Manage iOS keyboard with Apple's missing KeyboardLayoutGuide
Stars: ✭ 1,054 (+1450%)
Mutual labels:  autolayout
Leego
Declarative, configurable & highly reusable UI development as making Lego bricks.
Stars: ✭ 967 (+1322.06%)
Mutual labels:  autolayout
Purelayout
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.
Stars: ✭ 7,548 (+11000%)
Mutual labels:  autolayout
Laravel Tags
Add tags and taggable behaviour to your Laravel app
Stars: ✭ 1,026 (+1408.82%)
Mutual labels:  tags
Js Cumulus
JS-Cmulus - WP-Cumulus in JavaScript
Stars: ✭ 20 (-70.59%)
Mutual labels:  tags
Blog Generator
static blog generator for my blog at https://zupzup.org/
Stars: ✭ 57 (-16.18%)
Mutual labels:  tags
Whc autolayoutkit
iOS and Mac OS X platforms currently in use the fastest the simplest development to build the UI layout automatically open source library, strong dynamic layout constraint handling capacity,iOS/Mac OS X平台上目前使用最简单开发构建UI速度最快的自动布局开源库,强悍的动态布局约束处理能力
Stars: ✭ 858 (+1161.76%)
Mutual labels:  autolayout
Hangfire.tags
Add tags to Hangfire backgroundjobs
Stars: ✭ 42 (-38.24%)
Mutual labels:  tags
Mailpile
A free & open modern, fast email client with user-friendly encryption and privacy features
Stars: ✭ 8,533 (+12448.53%)
Mutual labels:  tags
Dzhtmltext
Delphi and Lazarus HTML Label component
Stars: ✭ 60 (-11.76%)
Mutual labels:  tags
Redis Tag Cache
Cache and invalidate records in Redis with tags
Stars: ✭ 48 (-29.41%)
Mutual labels:  tags

TagFlowLayout

单选,多选,多行展开缩回,tag高度自定义 GIF图演示,请戳我

tagFlowLayout2

##How to use Add this to your build.gradle:

	dependencies {
		compile 'com.github.hymanme.tagflowlayout:tagflowlayout:0.3.0'
	}

1. 定义xml布局

    <com.github.hymanme.tagflowlayout.TagFlowLayout
        android:id="@+id/tag_flow_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        app:expandHint="查看更多"
        app:foldHint="点击缩回">

2. 初始化

     mTagFlowLayout = (TagFlowLayout) findViewById(R.id.tag_flow_layout);
     mTagFlowLayout.setTitle("大家都不想搜");
     mTagFlowLayout.setTitleTextColor(getResources().getColor(R.color.colorPrimaryDark)
     mTagFlowLayout.setTitleTextSize(12);
     //最小显示高度(单位dp)
     mTagFlowLayout.setMinVisibleHeight(100);
     //最大显示高度(单位dp)
     mTagFlowLayout.setMaxVisibleHeight(400);
     mTagFlowLayout.setAnimationDuration(600);
     //设置背景颜色
     mTagFlowLayout.setBackGroundColor(getResources().getColor(R.color.primary_text));

3. 设置adapter和监听,最好先设置监听后设置adapter

    //设置监听(单击和长按事件)
    mTagFlowLayout.setTagListener(new OnTagClickListener() {
            @Override
            public void onClick(TagFlowLayout parent, View view, int position) {
                Toast.makeText(MainActivity.this, "click==" + ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onLongClick(TagFlowLayout parent, View view, int position) {
                Toast.makeText(MainActivity.this, "long click==" + ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
            }
        });

    //设置adapter
    MyTagAdapter tagAdapter = new MyTagAdapter();
    mTagFlowLayout.setTagAdapter(tagAdapter);

    //给adapter绑定数据
    tagAdapter.addAllTags(tagBeans);

    //自定义Adapter:MyTagAdapter,其中TagBean为泛型类,即每一个tag的实体类
    //在getView()里面自定义tag标签的样式
    //默认提供了两个实例tag:DefaultTagView,ColorfulTagView
    //DefaultTagView:默认tag
    //ColorfulTagView:彩色的tag
    //当然还可以自己自定义
    class MyTagAdapter extends TagAdapter<TagBean> {

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
			//定制tag的样式,包括背景颜色,点击时背景颜色,背景形状等
            DefaultTagView textView = new ColorfulTagView(MainActivity.this);
            textView.setText(((TagBean) getItem(position)).getName());
            return textView;
        }
    }

##默认tag样式

  1. DefaultTagView (默认实心tag)
  2. ColorfulTagView (彩色背景实心tag)
  3. StrokeTagView (空心带边框的tag)
  4. ColorfulStrokeTagView (空心彩色边框tag)
  5. 自定义tag,继承以上tag或者自定义View

muti_tags

##可选项(部分属性可直接在xml布局中指定)

//标题
private String title;
//展开后显示的提示文字
private String foldHint;
//折叠起来后显示的提示文字
private String expandHint;
//标题文字颜色
private int titleTextColor;
//控件背景颜色
private int backGroundColor;
//查看更多文字颜色
private int hintTextColor;
//分割线颜色
private int dividerColor;
//标签之间的横向间距
private int tagsHorizontalSpace;
//标签之间的纵向间距
private int tagsVerticalSpace;
//查看更多前面显示的小图标
private Drawable indicateImage;
//内容区域最少显示高度(px)
private int minVisibleHeight;
//内容区域最大显示高度
private int maxVisibleHeight;
//标题字体大小(单位sp)
private float titleTextSize;
//提示字体大小
private float hintTextSize;
//展开和折叠动画持续时间
private int animationDuration;

//点击监听事件
private OnTagClickListener mListener;
//设置adapter
private TagAdapter mTagAdapter;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].