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.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentTransaction; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.inputmethod.InputMethodManager; | |
import java.util.HashMap; |
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.app.Notification; | |
import android.app.NotificationChannel; | |
import android.app.NotificationManager; | |
import android.app.Service; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.BitmapFactory; | |
import android.location.Location; | |
import android.os.Build; | |
import android.os.IBinder; |
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.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentSender; | |
import android.content.pm.PackageManager; | |
import android.location.Location; | |
import android.location.LocationManager; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.ActivityCompat; |
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.os.Handler; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
public abstract class DelayTextWatcher implements TextWatcher { | |
private final long DELAY = 300; // milliseconds | |
private Handler handler = new Handler(); | |
private Runnable runnable = new Runnable() { | |
@Override |
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
protected fun setStatusBarTranslucent(makeTranslucent: Boolean) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
if (makeTranslucent) { | |
window.setFlags( | |
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, | |
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | |
) | |
window.setFlags( | |
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, | |
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION |
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
//SOURCE: http://stackoverflow.com/questions/16889502/how-to-mask-an-edittext-to-show-the-dd-mm-yyyy-date-format | |
EditText date; | |
date = (EditText)findViewById(R.id.whichdate); | |
date.addTextChangedListener(tw); | |
TextWatcher tw = new TextWatcher() { | |
private String current = ""; |
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.TargetApi; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.pdf.PdfDocument; | |
import android.graphics.pdf.PdfRenderer; | |
import android.os.AsyncTask; | |
import android.os.Build; | |
import android.os.ParcelFileDescriptor; | |
import android.util.Log; |
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
/** | |
* Util class for converting between dp, px and other magical pixel units | |
*/ | |
public class PixelUtil { | |
private PixelUtil() { | |
} | |
public static int dpToPx(Context context, int dp) { | |
int px = Math.round(dp * getPixelScaleFactor(context)); |
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.animation.ObjectAnimator; | |
import android.animation.TypeEvaluator; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.util.AttributeSet; | |
import android.view.animation.LinearInterpolator; |
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 HomeActivity extends BaseAppCompatActivity { | |
// Used to load the 'native-lib' library on application startup. | |
static { | |
System.loadLibrary("native-lib"); | |
} | |
public native Object[] getMediaFiles(String root); | |
@Override |