This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: Felipe Herranz ([email protected]) | |
* Contributors:Francesco Verheye ([email protected]) | |
* Israel Dominguez ([email protected]) | |
*/ | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import android.os.Handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class measureSize{ | |
public void getSize1(){ | |
int w = View.MeasureSpec.makeMeasureSpec(0, | |
View.MeasureSpec.UNSPECIFIED); | |
int h = View.MeasureSpec.makeMeasureSpec(0, | |
View.MeasureSpec.UNSPECIFIED); | |
imageView.measure(w, h); | |
int height = imageView.getMeasuredHeight(); | |
int width = imageView.getMeasuredWidth(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A {@link android.support.v7.widget.RecyclerView.LayoutManager} implementation | |
* that places children in a two-dimensional grid, sized to a fixed column count | |
* value. User scrolling is possible in both horizontal and vertical directions | |
* to view the data set. | |
* | |
* <p>The column count is controllable via {@link #setTotalColumnCount(int)}. The layout manager | |
* will generate the number of rows necessary to accommodate the data set based on | |
* the fixed column count. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ItemDecoration implementation that applies and inset margin | |
* around each child of the RecyclerView. It also draws item dividers | |
* that are expected from a vertical list implementation, such as | |
* ListView. | |
*/ | |
public class GridDividerDecoration extends RecyclerView.ItemDecoration { | |
private static final int[] ATTRS = { android.R.attr.listDivider }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ItemDecoration implementation that applies and inset margin | |
* around each child of the RecyclerView. It also draws item dividers | |
* that are expected from a vertical list implementation, such as | |
* ListView. | |
*/ | |
public class DividerDecoration extends RecyclerView.ItemDecoration { | |
private static final int[] ATTRS = { android.R.attr.listDivider }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.graphics.Paint.Align; | |
import android.graphics.Paint.FontMetrics; | |
import android.graphics.Typeface; | |
import android.graphics.drawable.BitmapDrawable; |
NewerOlder