This file contains hidden or 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.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v4.view.MotionEventCompat; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.widget.ViewDragHelper; | |
import android.support.v4.widget.ViewDragHelper.Callback; | |
import android.util.AttributeSet; |
This file contains hidden or 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.BitmapFactory; | |
import android.net.Uri; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class BitmapResize { |
This file contains hidden or 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.net.Uri; | |
import java.io.IOException; | |
import java.lang.ref.WeakReference; | |
import co.wardrope.android.util.BitmapResize; | |
import okhttp3.MediaType; | |
import okhttp3.RequestBody; |
This file contains hidden or 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.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public class GridEndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener { | |
private GridLayoutManager gridLayoutManager; | |
private DataLoader dataLoader; | |
private int previousItemCount; | |
private boolean loading; | |
public GridEndlessRecyclerViewScrollListener(GridLayoutManager gridLayoutManager, DataLoader dataLoader) { |
This file contains hidden or 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 Stack { | |
private int[] data; | |
private int size = 0; | |
private int cursor = -1; | |
private int min = 0; | |
private final static float LOAD_FACTOR = 1.4f; | |
public Stack() { | |
data = new int[10]; |
This file contains hidden or 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 LinkedList { | |
private Node head = null; | |
public LinkedList() { | |
head = null; | |
} | |
public void reverse() { | |
if (head == null) { |
This file contains hidden or 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 static int quickSelect(int[] a, int k) { | |
int pivot = a[0]; | |
int lenOfMinThanPivot = 0; | |
for (int i = 1; i < a.length; i++) { | |
if (a[i] < pivot) { | |
lenOfMinThanPivot++; | |
} | |
} | |
This file contains hidden or 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 LinkedList { | |
private Node head = null; | |
public LinkedList() { | |
head = null; | |
} | |
public void add(int x) { | |
if (head == null) { |