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.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
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
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 VideoPickerActivity extends Activity{ | |
private final int REQUEST_PICK_VIDEO = 1; | |
public void onVideoPickClick(View view) { | |
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI); | |
startActivityForResult(intent, REQUEST_PICK_VIDEO); | |
} | |
@Override |
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
/* | |
* Copyright 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 abstract class IncrementTimer { | |
/** | |
* Millis since epoch when alarm should stop. | |
*/ | |
private final long mMillisInFuture; | |
/** | |
* The interval in millis that the user receives callbacks | |
*/ | |
private final long mIncrementInterval; |
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.view.KeyEvent; | |
import android.widget.SeekBar; | |
/** | |
* This is workaround version for SeekBar which didn't detect the progress changed | |
* by arrow key pressed. | |
* | |
*/ |
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 java.lang.ref.WeakReference; | |
public abstract class WeakAsyncTask<Params, Progress, Result, WeakTarget> extends | |
AsyncTask<Params, Progress, Result> { | |
protected WeakReference<WeakTarget> mTarget; | |
public WeakAsyncTask(WeakTarget target) { | |
mTarget = new WeakReference<WeakTarget>(target); | |
} | |
/** {@inheritDoc} */ | |
@Override |
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 TextBadgeDrawable extends Drawable { | |
private Paint mPaint; | |
private Rect mBounds; | |
private Rect mTextBounds; | |
private RectF mRectF; | |
private int mColor; | |
private String mText; | |
public TextBadgeDrawable() { | |
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); |