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 (C) ${year} 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
/* | |
* A user-agent string that's sent to the HTTP site. It includes information about the device | |
* and the build that the device is running. | |
*/ | |
public static final String USER_AGENT = "Mozilla/5.0 (Linux; U; Android " | |
+ android.os.Build.VERSION.RELEASE + ";" | |
+ Locale.getDefault().toString() + "; " + android.os.Build.DEVICE | |
+ "/" + android.os.Build.ID + ")"; |
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
/** | |
* Sets full screen mode on the device, by setting parameters in the current | |
* window and View | |
* @param fullscreen | |
*/ | |
public void setFullScreen(boolean fullscreen) { | |
// If full screen is set, sets the fullscreen flag in the Window manager | |
getWindow().setFlags( | |
fullscreen ? WindowManager.LayoutParams.FLAG_FULLSCREEN : 0, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); |
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 void flipCard() { | |
if (mShowingBack) { | |
getFragmentManager().popBackStack(); | |
return; | |
} | |
// Flip to the back. | |
mShowingBack = true; |
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); |
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
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
/* 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
#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'] |