All Projects → gejiaheng → Dividers For Recyclerview

gejiaheng / Dividers For Recyclerview

📋 A simple demo to demonstrate how to draw dividers for RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Dividers For Recyclerview

Google Books Android Viewer
Android library to bridge between RecyclerView and sources like web page or database. Includes demonstrator (Google Books viewer)
Stars: ✭ 37 (-43.08%)
Mutual labels:  recyclerview
Recyclerview Concatadapter
Sample to practice RecyclerView ConcatAdapter
Stars: ✭ 47 (-27.69%)
Mutual labels:  recyclerview
Cardswipelayout
Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)
Stars: ✭ 1,081 (+1563.08%)
Mutual labels:  recyclerview
Retrofit Recyclervew
An implementation of a RecyclerView using Retrofit and Glide to create a movie list
Stars: ✭ 40 (-38.46%)
Mutual labels:  recyclerview
Heal O Chat
Heal-O-Chat is a Social Media Application for people who have been feeling less motivated in life or are losing hope. This platform allows users to chat with people and share their thoughts and feelings with each other and thereby let go of stress, anxiety, and depression that they've been feeling for long.
Stars: ✭ 42 (-35.38%)
Mutual labels:  recyclerview
Circulerautoscrollingrecyclerview
Sample code of infinite rotation using RecyclerView. Built with Kotlin
Stars: ✭ 48 (-26.15%)
Mutual labels:  recyclerview
Focusresize
A custom animation with scroll listener to recycler views
Stars: ✭ 971 (+1393.85%)
Mutual labels:  recyclerview
Countdowntask
⌛️A countdown library for Android.
Stars: ✭ 64 (-1.54%)
Mutual labels:  recyclerview
Firestorerecycleradaptersample
Sample Android project using FirestoreRecyclerAdapter
Stars: ✭ 43 (-33.85%)
Mutual labels:  recyclerview
Chameleon
🦎Chameleoen deals with the Status of RecyclerView.
Stars: ✭ 52 (-20%)
Mutual labels:  recyclerview
Grouprecyclerviewadapter
可增删改查、可动画展开收起、可吸附悬浮动态可配置的分组列表
Stars: ✭ 41 (-36.92%)
Mutual labels:  recyclerview
Swipeablerv
Library that makes it easy to implement swipe-to-dismiss in recycler view
Stars: ✭ 41 (-36.92%)
Mutual labels:  recyclerview
Sharebox
家庭看片神器,可以用手机播放电脑里的视频,也可以用电脑播放手机里的视频,使用简单,能稳定运行在后台,目前支持的设备有Windows,Mac,Android。
Stars: ✭ 51 (-21.54%)
Mutual labels:  recyclerview
Flagchatadapter
FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction.
Stars: ✭ 39 (-40%)
Mutual labels:  recyclerview
Ultimaterefreshview
UltimateRefreshView 实现下拉刷新,上拉加载更多的轻量级库;支持RecyclerView ,ListView ,ScrollView & WebView
Stars: ✭ 64 (-1.54%)
Mutual labels:  recyclerview
Autoplayvideos
Android library to auto-play/pause videos from url in recyclerview.
Stars: ✭ 981 (+1409.23%)
Mutual labels:  recyclerview
Multi type list view
A flutter customer ListView that displays multiple widget types.
Stars: ✭ 47 (-27.69%)
Mutual labels:  recyclerview
Tc Material Design
Série de artigos sobre o Material Design Android
Stars: ✭ 64 (-1.54%)
Mutual labels:  recyclerview
Verticalviewpager
A vertical scroll ViewPager implementation. Use with scrollable views(ListView, ScrollView, RecyclerView).
Stars: ✭ 64 (-1.54%)
Mutual labels:  recyclerview
Rendererrecyclerviewadapter
A single adapter with multiple view types for the whole project
Stars: ✭ 1,061 (+1532.31%)
Mutual labels:  recyclerview

Dividers for RecyclerView

Attention

There is an official implementation which is DividerItemDecoration. You should use this one.

Intention

This is just a simple demo app to demonstrate how to draw dividers for RecyclerView.

RecyclerView doesn't provide a straightforward interface for drawing dividers of lists. But actually it provides us a much more flexible way to draw dividers. We use RecyclerView.ItemDecoration to decorate RecyclerView's tiles with dividers or anything you want. That is also why it is called ItemDecoration.

Implementions

There are three different implemetations of dividers.

As described in Meterial Design Guidelines:

The divider sits within the baseline of the tile.

So I would suggest using OverlayDivider or InsetDivider. OverlayDivider draws dividers on the tiles, needing no extra inset. InsetDivider can draw dividers on or underneath the tiles.

Usage

  • UnderneathDivider
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new UnderneathDivider(this, UnderneathDivider.VERTICAL_LIST));
  • OverlayDivider
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new OverlayDivider(this, OverlayDivider.VERTICAL_LIST));
  • InsetDivider
ItemDecoration divider = new InsetDivider.Builder(this)
                            .orientation(InsetDivider.VERTICAL_LIST) 
                            .dividerHeight(getResources().getDimensionPixelSize(R.dimen.divider_height))
                            .color(getResources().getColor(R.color.colorAccent))
                            .insets(getResources().getDimensionPixelSize(R.dimen.divider_inset), 0)
                            .overlay(true)
                            .build(); 
                            
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(divider);

License

Copyright 2020 Jiaheng Ge

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].