ItemDecoration for Android Recyclerview

Overview

RecyclerView ItemDecorations

Circle CI

This project showcases some ItemDecorations for RecyclerViews. There is a blog post about the basics of drawing decorations and animating them along with the recyclerview.

Library

If you find something appealing, please go ahead and just copy it, the MIT license applies.

I don't see it fit to be published as a library since this would need to include thorough testing and clean interfaces. So instead this project is just my personal playground in which I will have my go at the RecyclerView.

Current Examples

  • A lightweight header decoration with shadow and / or parallax effect

Header Decoration

ViewPagerDecoration

  • A GridSpanDecoration that has proper vertical padding between its columns

  • A decoration for dismissing items to draw in the background like Gmail

Dismissing items

  • Some CardLayout like Decoration with some Parallax like effect on headers

Screenshot

Comments
  • Support to R2l

    Support to R2l

    thanks @bleeding182 for the cool example and proof of concept. regarding LinePagerIndicatorDecoration it works great except when screen changed to R2L it still start from left to right. I will try to fix it and send PR.

    opened by anasanasanas 2
  • How to display The Indicator over/above the RecyclerView Item

    How to display The Indicator over/above the RecyclerView Item

    Firstly, thanks for the code. Finally, find a solution to display Indicators to RecyclerView.

    Coming to the problem, everything is working fine as illustrated. However, the indicator is displayed at the bottom of the RecyclerView by offsetting the Item. How can I display the Indicator without offsetting the Item (I mean, how to display Indicator above/overlapping the RecyclerView item)

    Image Reference illustrating the issue untitled

    A little help would be appreciated. Thanks again for the awesome solution.

    PS: I am a beginner in Android. Hence no idea about how to develop libraries. If possible, please create a library for this RecyclerView Indicator. Would be helpful to many.

    Thanks.

    opened by CeJienAJPC 2
  • Header Decoration only shows after scroll

    Header Decoration only shows after scroll

    Hi, first thanks for the great samples.

    I tried your header decorator in my application, it has a tab layout and inside the tab layout there's a fragment. I'm using the header layout in the recycler view in that fragment. The problem is that when the fragment is first created the item isn't decorated, but after scrolling down and back up again the header is shown. Maybe you can shed some light why that happening.

    Here's the attached gif

    header view

    Here's the code, the initRecyclerView is called from Fragment.onCreateView(). Thanks for the help

    ``
    private void initRecyclerView(View v) { recyclerView = (RecyclerView) v.findViewById(R.id.recyclerview);

        // use this setting to improve performance if you know that changes
        // in content do not change the layout size of the RecyclerView
        recyclerView.setHasFixedSize(true);
    
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
    
        // use a linear layout manager
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    
        recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(getActivity().getApplicationContext(), new RecyclerItemClickListener.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                Trayek trayek = adapter.getItem(position);
    
                if(trayek != null) {
                    Intent intent = new Intent(getActivity().getApplicationContext(), AngkotRouteActivity.class);
                    intent.putExtra("bus_code", trayek.getVehicleNo());
                    intent.putExtra("bus_name", trayek.getVehicleName());
                    intent.putExtra("id_trayek", trayek.getId());
                    startActivity(intent);
    
                }
            }
        }));
    
        recyclerView.addItemDecoration(HeaderDecoration.with(recyclerView)
                .inflate(R.layout.header_damri)
                .parallax(1f)
                .dropShadowDp(4)
                .build());
    }
    

    ``

    opened by abangkis 2
  • View parameters not respected

    View parameters not respected

    If I try to inflate a simple LinearLayout with 2 children and their relative weight, these are not respected and the children are drawn on the far left of the layout.

    I can't find a solution to this.

    opened by lampione 0
  • Extra Highlight

    Extra Highlight

    I used display 3 cards at the same time on RecyclerView, but I always encounter extra highlight "tail" indicator even if I already moved to next card. After some debugging, I modify the progress variable in LinePagerIndicatorDecoration.java.

    ` // on swipe the active item will be positioned from [-width, 0] // interpolate offset for smooth animation float progress = mInterpolator.getInterpolation(left * -1 / (float) width);

       // extra "rounding"
        if(progress < 0.02) {
            progress = 0;
        } else if (progress > 0.98) {
            // rounding, avoid extra highlighted part
            progress = 0;
            activePosition++;
        }
    

    ` FYI.

    opened by tfe104270 0
  • Using the similar effect inside Recycler View

    Using the similar effect inside Recycler View

    https://raw.githubusercontent.com/ogaclejapan/SmartTabLayout/master/art/demo4.gif i want achieve this kind of effect in my recycler view is there any i can use the given code to achieve this. I have two recycler view, whenever i scroll 10 items in one recycler view it scroll another recycler view to one next position thats where i want to use this. Any help would be appreciated

    opened by Rudra-n-khatri 0
ItemDecoration for Android Recyclerview

RecyclerView ItemDecorations This project showcases some ItemDecorations for RecyclerViews. There is a blog post about the basics of drawing decoratio

David Medenjak 425 Nov 10, 2022
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features

ChipsLayoutManager This is ChipsLayoutManager - custom Recycler View's LayoutManager which moves item to the next line when no space left on the curre

Oleg Beloy 3.2k Dec 25, 2022
TikTok-RecyclerView - This is a demo app built using 'Koin' a new dependency injection framework for Android along with RecyclerView and ExoPlayer2.

TikTok-RecyclerView Demo About This is a demo app built using 'Koin' a new dependency injection framework for Android along with RecyclerView and ExoP

Baljeet Singh 19 Dec 28, 2022
A RecyclerView that implements pullrefresh and loadingmore featrues.you can use it like a standard RecyclerView

XRecyclerView a RecyclerView that implements pullrefresh , loadingmore and header featrues.you can use it like a standard RecyclerView. you don't need

XRecyclerView 5.3k Dec 26, 2022
A RecyclerView that implements pullrefresh and loadingmore featrues.you can use it like a standard RecyclerView

XRecyclerView a RecyclerView that implements pullrefresh , loadingmore and header featrues.you can use it like a standard RecyclerView. you don't need

XRecyclerView 5.3k Dec 26, 2022
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.

Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.

Jack and phantom 504 Dec 25, 2022
RecyclerView : SleepQualityTracker with RecyclerView app

RecyclerView - SleepQualityTracker with RecyclerView app SleepQualityTracker with RecyclerView This app builds on the SleepQualityTracker developed pr

Kevin 2 May 14, 2022
Pagination-RecyclerView - Simple and easy way to Paginating a RecyclerView

Pagination-RecyclerView Simple and easy way to Paginating a RecyclerView Android

Rakshit Nawani 0 Jan 3, 2022
An Android Animation library which easily add itemanimator to RecyclerView items.

RecyclerView Animators RecyclerView Animators is an Android library that allows developers to easily create RecyclerView with animations. Please feel

Daichi Furiya 11.2k Jan 8, 2023
A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.

UltimateRecyclerView Master branch: Dev branch: Project website:https://github.com/cymcsg/UltimateRecyclerView Description UltimateRecyclerView is a R

MarshalChen 7.2k Jan 2, 2023
[UNMAINTAINED] Sticky Headers decorator for Android's RecyclerView

This project is no longer being maintained sticky-headers-recyclerview This decorator allows you to easily create section headers for RecyclerViews us

timehop 3.7k Jan 8, 2023
[] Super fast and easy way to create header for Android 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 multipl

Bartek Lipinski 1.3k Dec 28, 2022
Android Library to provide swipe, click and other functionality to RecyclerView

RecyclerViewEnhanced Android Library to provide swipe, click and other functionality to RecyclerView Usage Add this to your build.gradle file dependen

Nikhil Panju 1k Dec 29, 2022
Android library defining adapter classes of RecyclerView to manage multiple view types

RecyclerView-MultipleViewTypeAdapter RecyclerView adapter classes for managing multiple view types Release Note [Release Note] (https://github.com/yqr

Yoshihito Ikeda 414 Nov 21, 2022
Set of plugable extenstions for Android RecyclerView

DynamicRecyclerView Set of light and non-invasive extensions for Android RecyclerView widget. Does not use custom RecyclerView or LayoutManager. With

Ilja S. 342 Nov 11, 2022
Android library for RecyclerView to manage order of items and multiple view types.

recyclerview-binder Android Library for RecyclerView to manage order of items and multiple view types. Features Insert any items to wherever you want

Satoru Fujiwara 185 Nov 15, 2022
A pull to zoom-in RecyclerView for android

PullZoomRecyclerView Using RecyclerView requires three steps: Step one: use the PullZoomRecyclerView in XML Step two: call the function setAdapter and

dinus_developer 433 Nov 10, 2022
Android Library to provide swipe, click and other functionality to RecyclerView

RecyclerViewEnhanced Android Library to provide swipe, click and other functionality to RecyclerView Usage Add this to your build.gradle file dependen

Nikhil Panju 1k Dec 29, 2022