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.animation.LayoutTransition; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; | |
import android.widget.LinearLayout; | |
import android.widget.LinearLayout.LayoutParams; |
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.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.drawable.AnimationDrawable; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.ImageView; |
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
.decode('unicode_escape').encode('iso8859-1').decode('utf8') |
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.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.CheckBox; | |
import android.widget.ImageView; | |
import android.widget.TextView; | |
/** |
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
#coding=utf-8 | |
# This is a small python script to help you synchronize two folders | |
# Compatible with Python 2.x and Python 3.x | |
import filecmp, shutil, os, sys | |
SRC = r'C:/a' | |
DEST = r'C:/b' | |
IGNORE = ['Thumbs.db'] |
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
/* Checks if external storage is available for read and write */public boolean isExternalStorageWritable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { return true; } return false;}/* Checks if external storage is available to at least read */public boolean isExternalStorageReadable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { return true; } return false;} |
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
private View mContentView; | |
private View mLoadingView; | |
private int mShortAnimationDuration; | |
... | |
private void crossfade() { | |
// Set the content view to 0% opacity but visible, so that it is visible | |
// (but fully transparent) during the animation. |
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 ZoomOutPageTransformer implements ViewPager.PageTransformer { | |
private static final float MIN_SCALE = 0.85f; | |
private static final float MIN_ALPHA = 0.5f; | |
public void transformPage(View view, float position) { | |
int pageWidth = view.getWidth(); | |
int pageHeight = view.getHeight(); | |
if (position < -1) { // [-Infinity,-1) | |
// This page is way off-screen to the left. |
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 DepthPageTransformer implements ViewPager.PageTransformer { | |
private static final float MIN_SCALE = 0.75f; | |
public void transformPage(View view, float position) { | |
int pageWidth = view.getWidth(); | |
if (position < -1) { // [-Infinity,-1) | |
// This page is way off-screen to the left. | |
view.setAlpha(0); |