Skip to content

Instantly share code, notes, and snippets.

View s0nerik's full-sized avatar
🇺🇦

Alex Isaienko s0nerik

🇺🇦
View GitHub Profile
@fdoyle
fdoyle / FixedTransformerViewPager.java
Last active August 22, 2022 11:02
PageTransform + padding on viewpager doesn't work. this fixes it
package com.foo.ui.view;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Created by fdoyle on 11/2/15.
*/
@MariusBudin-zz
MariusBudin-zz / RxBoolean.java
Created September 1, 2015 09:57
Some simple Rx bindings on primitives based on android.databinding library. This allows you to apply, maps, filters and all the goodies in rxJava/rxAndroid on simple primitive data observers.
import android.databinding.ObservableBoolean;
import rx.Observable;
import rx.subjects.BehaviorSubject;
/**
* Created by marius on 31/8/15.
*
* @music Antonia Font - Me sobren paraules
*/
@ssinss
ssinss / EndlessRecyclerOnScrollListener.java
Last active January 19, 2024 08:52
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@cbeyls
cbeyls / WindowInsetsFrameLayout.java
Last active February 5, 2020 10:58
A fragment container enabling the use of android:fitsSystemWindows in fragment layouts.
package be.digitalia.common.widgets;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.support.v4.util.ObjectsCompat;
import android.util.AttributeSet;
import android.view.View;
@daniellevass
daniellevass / android_material_design_colours.xml
Last active March 26, 2024 15:48
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>