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
package annotations; | |
import android.os.Build; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
/** |
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
#!/bin/bash | |
# Script adb+ | |
# Usage | |
# You can run any command adb provides on all your currently connected devices | |
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
# | |
# Examples | |
# ./adb+ version | |
# ./adb+ install apidemo.apk | |
# ./adb+ uninstall com.example.android.apis |
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.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.ViewConfiguration; | |
import android.widget.LinearLayout; | |
public class SwipeLinearLayout extends LinearLayout { | |
private GestureDetector gestureDetector; | |
private OnSwipeListener listener; |
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
// In ResourceLoader.java I added the following method: | |
// | |
public void loadLibraryProjectResources(File libraryProjectRoot) throws Exception { | |
File systemResourceDir = getSystemResourceDir(getPathToAndroidResources()); | |
File localValueResourceDir = getValueResourceDir(libraryProjectRoot); | |
File systemValueResourceDir = getValueResourceDir(systemResourceDir); | |
loadStringResources(localValueResourceDir, systemValueResourceDir); | |
loadPluralsResources(localValueResourceDir, systemValueResourceDir); | |
loadValueResources(localValueResourceDir, systemValueResourceDir); |
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.graphics.drawable.Drawable; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Checkable; | |
import android.widget.LinearLayout; |
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
<input type="file" name="files[]" multiple directory webkitdirectory mozdirectory> |
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
^(.*(ClassNameOne|ClassNameTwo|ClassNameThree)).*$ |
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
Set VM options to: -ea -Xms800m -Xmx800m -XX:MaxPermSize=500m |
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.SystemClock; | |
import android.support.v4.util.LruCache; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* An Lru Cache that allows entries to expire after | |
* a period of time. Items are evicted based on a combination | |
* of time, and usage. Adding items past the {@code maxSize} |
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
@Test | |
public void happyDebuggingSuckers() throws SecurityException, NoSuchFieldException, IllegalAccessException { | |
Field value = Boolean.class.getDeclaredField("value"); | |
value.setAccessible(true); | |
Boolean trueBool = true; | |
Boolean falseBool = false; | |
value.setBoolean(trueBool, false); |
OlderNewer