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 | |
# How to install: | |
# exo-open "http://developer.android.com/sdk/index.html#Other" | |
# sudo apt-get install libav-tools imagemagick | |
# wget https://gist.githubusercontent.com/lorenzos/e8a97c1992cddf9c1142/raw/android-screen-to-gif.sh | |
# chmod a+x android-screen-to-gif.sh | |
# Help message | |
function usage() { |
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) 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 class CircularProgressDrawable extends Drawable | |
implements Animatable { | |
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
private static final int SWEEP_ANIMATOR_DURATION = 600; | |
private static final int MIN_SWEEP_ANGLE = 30; | |
private final RectF fBounds = new RectF(); |
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 com.alejandrogr.gists.ofylistref; | |
import com.googlecode.objectify.Ref; | |
import com.googlecode.objectify.annotation.Entity; | |
import com.googlecode.objectify.annotation.Id; | |
import com.googlecode.objectify.annotation.Ignore; | |
import com.googlecode.objectify.annotation.Load; | |
import com.googlecode.objectify.annotation.OnLoad; | |
import java.util.ArrayList; | |
import java.util.List; |
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 com.cyrilmottier.android.resourcesadditions; | |
import android.content.res.Resources; | |
import android.content.res.XmlResourceParser; | |
import android.os.Bundle; | |
import org.xmlpull.v1.XmlPullParser; | |
import org.xmlpull.v1.XmlPullParserException; | |
/** | |
* @author Cyril Mottier |
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.view.View; | |
import android.view.ViewGroup; | |
/** | |
* A {@link ViewGroup.OnHierarchyChangeListener hierarchy change listener} which recursively | |
* monitors an entire tree of views. | |
*/ | |
public final class HierarchyTreeChangeListener implements ViewGroup.OnHierarchyChangeListener { | |
/** | |
* Wrap a regular {@link ViewGroup.OnHierarchyChangeListener hierarchy change listener} with one |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.5.6' | |
} | |
} | |
task wrapper(type: Wrapper) { |
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
/** | |
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). | |
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while | |
* the alpha values are derived from the source's grayscaled RGB values. The effect is that | |
* you can see through darker parts of the source bitmap, while lighter parts show up as | |
* the given color. The 'invert' argument inverts the computation of alpha values, and looks | |
* best when the given color is a dark. | |
*/ | |
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) { | |
int width = src.getIntrinsicWidth(); |
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/mkdir /tmp/rip 2> /dev/null | |
javac -d /tmp/rip $0 | |
java -cp /tmp/rip Rip "$@" | |
exit | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.*; | |
import java.util.regex.Matcher; |
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) 2012 readyState Software Ltd | |
* | |
* 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 | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
NewerOlder