Skip to content

Instantly share code, notes, and snippets.

View ityancs's full-sized avatar
🎯
Focusing

Gekson ityancs

🎯
Focusing
View GitHub Profile
@ityancs
ityancs / EndlessRecyclerOnScrollListener.java
Created January 7, 2016 06:06 — forked from ssinss/EndlessRecyclerOnScrollListener.java
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;
@ityancs
ityancs / WaterWaveView.java
Created March 16, 2016 03:37 — forked from AvatarQing/WaterWaveView.java
水波浪效果
package com.example.glowbuttontest;
import java.lang.ref.WeakReference;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
@ityancs
ityancs / NetWorkUtils.java
Created June 3, 2016 06:53
NetWork utils for Android to get Android Network Info
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
import java.net.InetAddress;