Code Monkey home page Code Monkey logo

flowtag's Introduction

FlowTagLayout

Android流式布局,支持点击、单选、多选等,适合用于产品标签等,用法采用Adapter模式,和ListView、GridView用法一样!

2016/6/26号新添加初始化标签功能,使用非常简单,只要你的Adapter实现OnInitSelectedPosition即可,对于点击模式是不存在初始化标签一说的;对于单选模式来说,如果有多个初始化选择,则默认去第一个;对于多选来说正常使用!!!


特色

  • 填充数据和ListView、GridView用法一样使用Adapter,更新数据直接通过adapter.notifyDataChanged来更新
  • 支持点击、单选、多选事件
  • 三种模式:FLOW_TAG_CHECKED_NONE、FLOW_TAG_CHECKED_SINGLE、FLOW_TAG_CHECKED_MULTI
  • 支持OnTagClickListener单点事件
  • 支持OnTagSelectListener单选、多选事件

效果图

image

版本更新

2016/6/26

  • 添加初始化选中标签
    • 单选模式下初始化标签只有第一个起作用
    • 多选模式下只要设置初始化选中就可以
  • 添加初始化选中标签代码示例
    • Adapter实现OnInitSelectedPosition接口

    • 实现接口中isSelectedPosition方法就可以,选中返回true,不选中默认返回false

        public class TagAdapter<T> extends BaseAdapter implements OnInitSelectedPosition {
        @Override
       		public boolean isSelectedPosition(int position) {
           	if (position % 2 == 0) {
               	return true;
           	}
           	return false;
       	}
        }
      

TODO

  • 复用View...

联系我

如果大家在使用过程中遇到任何问题都可以联系我,谢谢!!!最好是发邮件,我每天都会抽时间看一下我的邮箱:[email protected]

flowtag's People

Contributors

hanhailong avatar bryant1410 avatar wanyt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.