Skip to content

nurmemet209/TagLayout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TagLayout

taglayout

属性

  • horizontal_space 水平间距,tag与tag的距离
  • vertical_space 垂直距离,上下tag的距离

方法

  • setCheckable 是否具有选中功能
  • vertical_space 垂直距离,上下tag的距离
  • setPadding(int lr, int tp) lr 左右padding,tp 上下padding (都是以dp为单位)
  • setOnItemClick(OnItemClick mOnItemClick) tag点击事件
  • setTags(List<? extends Object> list, BindProperty onBindProperty) list中的对象必须覆写toString 方法 public interface BindProperty { void OnBindProperty(TextView view); } 接口你可以给tag赋予想要的样式 ,字体颜色等
mTagGroupSelecable.setTags(getList(), new TagGroupLayout.BindProperty() {
            @Override
            public void OnBindProperty(TextView view) {
                view.setBackground(drawableUtil.getStateListDrawable());
                view.setTextColor(drawableUtil.getColorStateList());
            }
        });

screenshot

Discussing

About

仿京东魅族应用市场热搜布局的实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages