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 LoadMoreView extends LinearLayout { | |
private TextView mTipText; | |
private ProgressBar mProgressBar; | |
private boolean mIsLoading; | |
private boolean mIsDone; | |
private int mLimit = 20; | |
private String mCursor = null; | |
private int mPage = 1; |
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 Utils { | |
/** | |
* To record the user click time. | |
*/ | |
private static long sLastClickTime = 0L; | |
/** | |
* Get device unique identify. | |
* | |
* @param context |
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.os.AsyncTask; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; |
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.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.support.annotation.NonNull; | |
import android.util.AttributeSet; | |
import android.view.View; |
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.os.Handler; | |
/** | |
* A helper class can toggle target object visibility automatically. | |
* It is very useful for MediaController (or ActionBar) when play video in Activity. | |
*/ | |
public abstract class ToggleVisibilityHelper { | |
/** | |
* Record the time while user lasted click. |
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.util.AttributeSet; | |
import android.widget.GridView; | |
/** | |
* A custom GridView which can wrap content. | |
*/ | |
public class WrapGridView extends GridView { | |
public WrapGridView(Context context) { |
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.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import com.folyd.app.R; | |
public class NonSwipeableViewPager extends ViewPager { |
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.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import com.theonepiano.smartpiano.R; |
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.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.AsyncTask; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
public class SimpleBitmapAsyncTask extends AsyncTask<String, Void, Bitmap> { |
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.widget.AbsListView; | |
import android.widget.AbsListView.OnScrollListener; | |
public abstract class OnLastItemVisibleListener implements AbsListView.OnScrollListener { | |
private boolean mLastItemVisible = false; | |
@Override | |
public void onScrollStateChanged(AbsListView view, int scrollState) { | |
/** | |
* Check that the scrolling has stopped, and that the last item is |