Skip to content

Instantly share code, notes, and snippets.

View wbinarytree's full-sized avatar

Phoenix wbinarytree

  • https://wbinarytree.github.io/
View GitHub Profile
package fr.airweb.tixipass.ui;
import org.jetbrains.annotations.Nullable;
public class Merge2List {
static class Node {
int data;
@Nullable
@wbinarytree
wbinarytree / NoScrollViewPager.kt
Created December 4, 2018 10:10
ViewPager that can disable scroll.
package fr.airweb.dood.widgets
import android.annotation.SuppressLint
import android.content.Context
import android.support.v4.view.ViewPager
import android.util.AttributeSet
import android.view.MotionEvent
class NoScrollViewPager : ViewPager {
@wbinarytree
wbinarytree / PeekingLinearLayoutManager.kt
Created March 20, 2019 10:45 — forked from bolot/PeekingLinearLayoutManager.kt
LinearLayoutManager subclass that "peeks", shows a portion of the adjacent child views.
class PeekingLinearLayoutManager : LinearLayoutManager {
@Suppress("Unused")
@JvmOverloads
constructor(context: Context?, @RecyclerView.Orientation orientation: Int = RecyclerView.VERTICAL, reverseLayout: Boolean = false) : super(context, orientation, reverseLayout)
@Suppress("Unused")
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
override fun generateDefaultLayoutParams() =
scaledLayoutParams(super.generateDefaultLayoutParams())