Coder Social home page Coder Social logo

stickyheaderdecoration's Introduction

StickyHeaderDecoration

A sticky header decoration, use for recyclerview,when use GridLayoutManager auto set group`s span.
image

天气热,本github已安装空调,star即可免费享用...


Download

https://fir.im/fzqr


集成方式

  • 注入依赖 Step 1. Add the JitPack repository to your build file Step 2. Add the dependency
	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
	dependencies {
 	   compile 'com.github.qdxxxx:StickyHeaderDecoration:1.0.1'
	}

Version


  • v1.0.1  : 配合RecyclerView使用的悬浮头部和标题头部,目前支持文字和自定义layout两种头部,LinearLayoutManager【竖直】及GridLayoutManager【竖直】可用,暂不支持StaggeredGridLayoutManager。

Activity里面集成代码

  • 分组头部
        NormalDecoration decoration = new NormalDecoration() {
            @Override
            public String getHeaderName(int pos) {
                return //返回每个分组头部名称;
            }
        };
  • 自定义头部/悬浮头部layout【自定义头部加载图片请用 loadImage() 方法】
       decoration.setOnDecorationHeadDraw(new NormalDecoration.OnDecorationHeadDraw() {
           @Override
           public View getHeaderView(int pos) {
               return //返回自定义头部view;
           }
       });
  • 头部点击事件
     decoration.setOnHeaderClickListener(new NormalDecoration.OnHeaderClickListener() {
         @Override
         public void headerClick(int pos) {
         }
     });

GridLayoutManager请配合GridDecoration使用。

方法及属性介绍


name format 中文解释
setHeaderHeight         integer   分组头部高度
setTextPaddingLeft     integer   普通分组头部【只含文字】文字左边距
setTextSize           integer 普通分组头部【只含文字】文字大小
setTextColor           integer 普通分组头部【只含文字】文字颜色
setHeaderContentColor integer 普通分组头部【只含文字】文字背景颜色
onDestory                     清空数据集合/监听等
*loadImage             String,integer,ImageView 用来加载并刷新图片到分组头部【自定义头部很重要的方法!】

Article


博客详解文章 http://blog.csdn.net/qian520ao/article/details/76167193

License


MIT License

Copyright (c) 2017 qdx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

stickyheaderdecoration's People

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.