All Projects → blipinsk → Recyclerviewheader

blipinsk / Recyclerviewheader

Licence: apache-2.0
[DEPRECATED] Super fast and easy way to create header for Android RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Recyclerviewheader

Autorecycleradapter
Automated configuration RecyclerView.Adapter for Android
Stars: ✭ 67 (-94.89%)
Mutual labels:  recyclerview
Elements
⚒ Modular components for RecyclerView development enforcing clean, reusable and testable code, with built-in support for paging and complex hierarchies of data.
Stars: ✭ 75 (-94.28%)
Mutual labels:  recyclerview
Pinnedrecyclerview Android
Add a list pinned by a floating label (text or image)
Stars: ✭ 81 (-93.83%)
Mutual labels:  recyclerview
Collapsingrefresh
AppBarLayout+ViewPager+RecyclerView的刷新功能
Stars: ✭ 69 (-94.74%)
Mutual labels:  recyclerview
Recyclerpager
Using RecyclerView and SnapHelper replace ViewPager
Stars: ✭ 73 (-94.44%)
Mutual labels:  recyclerview
Inifiniterecyclerview
Library for implementing endless loading list easily in Android applications
Stars: ✭ 79 (-93.98%)
Mutual labels:  recyclerview
Tc Material Design
Série de artigos sobre o Material Design Android
Stars: ✭ 64 (-95.12%)
Mutual labels:  recyclerview
Recyclerview Examples
Samples to learn about RecyclerView
Stars: ✭ 87 (-93.37%)
Mutual labels:  recyclerview
Gencycler
Gencycler is the fastest way to write RecyclerView adapters
Stars: ✭ 73 (-94.44%)
Mutual labels:  recyclerview
Expandable Recycler View
[DEPRECATED]
Stars: ✭ 1,234 (-5.95%)
Mutual labels:  recyclerview
Indexrecyclerview
[DEPRECATED] a Contact list implements by RecyclerView
Stars: ✭ 1,163 (-11.36%)
Mutual labels:  recyclerview
Android Cardview Recyclerview
Let's play with Android CardView, RecyclerView, Retrofit and Picasso Library. You can read details procedure about those library in my Bengali blog site.
Stars: ✭ 72 (-94.51%)
Mutual labels:  recyclerview
Multitype
【MultiType】可以轻松地实现RecyclerView显示多种数据类型,数据对应布局一对多、多对多、多对一,可以注册全局类型、局部类型、默认类型
Stars: ✭ 80 (-93.9%)
Mutual labels:  recyclerview
Horizontal Calendar
A material horizontal calendar view for Android based on RecyclerView
Stars: ✭ 1,155 (-11.97%)
Mutual labels:  recyclerview
Endless Recyclerview
Endless support for RecyclerView
Stars: ✭ 86 (-93.45%)
Mutual labels:  recyclerview
Dividers For Recyclerview
📋 A simple demo to demonstrate how to draw dividers for RecyclerView
Stars: ✭ 65 (-95.05%)
Mutual labels:  recyclerview
Rxbanner
一个灵活可制定的基于 Recyclerview 的轮播图控件,支持自动轮播,无限循环。 同时可关闭无限循环变成 引导页 ,带有引导完成接口回调
Stars: ✭ 77 (-94.13%)
Mutual labels:  recyclerview
Videolistplayer
Play video in ListView or RecyclerView
Stars: ✭ 1,308 (-0.3%)
Mutual labels:  recyclerview
Recyclerviewpresenter
RecyclerView Adapter Library with different models and different layouts as convenient as possible.
Stars: ✭ 86 (-93.45%)
Mutual labels:  recyclerview
Flexadapter
The easiest way to use a RecyclerView on Android
Stars: ✭ 80 (-93.9%)
Mutual labels:  recyclerview

DEPRECATED

I created this library back in the day when I thought RecyclerView was all new and difficult. Writing an adapter that could inflate multiple types of Views seemed like a difficult job to do. In reality, RecyclerViewHeader is just a complex solution to a simple problem. Instead of using this library, just learn how to create a multi-type RecyclerView.Adapter. It will bring you a lot of value in the long run, and it is not difficult at all. Check the Migration section for the simplest example of such Adapter.

No new development will be taking place.

Thanks for all the support!


RecyclerViewHeader

License Maven Central

If you still wanna use this library, check the old README.md.

Migration

Just use a RecyclerView.Adapter that can inflate multiple types of items.

Here's the simplest one you could use:

class ExampleAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

    companion object {
        private const val VIEW_TYPE_HEADER = 4815
        private const val VIEW_TYPE_ITEM = 1623
    }

    private val itemDataSetSize: Int get() = TODO("provide the size of your `ITEM` dataset")

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        when (viewType) {
            VIEW_TYPE_HEADER -> TODO("create your HEADER ViewHolder")
            VIEW_TYPE_ITEM -> TODO("create your ITEM ViewHolder")
            else -> error("Unhandled viewType=$viewType")
        }
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        when (val viewType = getItemViewType(position)) {
            VIEW_TYPE_HEADER -> TODO("bind your HEADER ViewHolder")
            VIEW_TYPE_ITEM -> TODO("bind your ITEM ViewHolder")
            else -> error("Unhandled viewType=$viewType")
        }
    }

    override fun getItemCount(): Int = itemDataSetSize + 1 // 1 for header

    override fun getItemViewType(position: Int) = when (position) {
        0 -> VIEW_TYPE_HEADER
        else -> VIEW_TYPE_ITEM
    }
}

Developed by

  • Bartosz Lipiński

License

Copyright 2015 Bartosz Lipiński

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].