Skip to content

Instantly share code, notes, and snippets.

View sagar2093's full-sized avatar

Sagar Chapagain sagar2093

View GitHub Profile
@sagar2093
sagar2093 / EqualSpacingItemDecoration.java
Created January 12, 2018 17:37 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
@sagar2093
sagar2093 / IntroActivity.java
Created February 16, 2017 05:00 — forked from MizzleDK/IntroActivity.java
Android intro screen
public class IntroActivity extends ActionBarActivity {
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.intro_layout);
@sagar2093
sagar2093 / Readme.md
Created December 27, 2015 17:22 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example: