Skip to content

Instantly share code, notes, and snippets.

View rameshvoltella's full-sized avatar
🏠
Working from home

Ramesh M Nair rameshvoltella

🏠
Working from home
View GitHub Profile
@rameshvoltella
rameshvoltella / MiddleDividerItemDecoration.kt
Created May 29, 2020 05:26 — forked from Veeyikpong/MiddleDividerItemDecoration.kt
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 The Android Open Source Project
*
* 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
@rameshvoltella
rameshvoltella / CustomSwipeableViewPager.java
Created January 12, 2022 12:20 — forked from JafarKhQ/CustomSwipeableViewPager.java
A Custom ViewPager for Android with an option to make it swipe to left only, swipe to right only or completely disbale the swipe
import android.content.Context;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
public class CustomSwipeableViewPager extends ViewPager {
private static final String TAG = "CustomSwipeableViewPager";
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;