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
Bitmap markerBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.mapmarker); | |
Bitmap resultBitmap = Bitmap.createBitmap(markerBitmap, 0, 0, markerBitmap.getWidth() - 1, markerBitmap.getHeight() - 1); | |
ColorFilter filter = new PorterDuffColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN); | |
Paint markerPaint = new Paint(); | |
markerPaint.setColorFilter(filter); | |
Canvas canvas = new Canvas(resultBitmap); | |
canvas.drawBitmap(resultBitmap, 0, 0, markerPaint); | |
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(resultBitmap)); |
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.graphics.Color; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.FloatRange; | |
public final class ColorUtils { | |
public static int blendColors( | |
@ColorInt int firstColor, | |
@ColorInt int secondColor, | |
@FloatRange(from = 0.0, to = 1.0f) float percentage) { | |
int firstAlpha = Color.alpha(firstColor); |
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.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.util.SparseArrayCompat; | |
import android.view.ViewGroup; | |
public abstract class IndexedFragmentPagerAdapter<T> extends FragmentPagerAdapter { | |
private SparseArrayCompat<T> fragments = new SparseArrayCompat<>(); | |
public IndexedFragmentPagerAdapter(FragmentManager fm) { | |
super(fm); |
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 MainActivity extends ActionBarActivity { | |
private static final String QUANTITY = "quantity"; | |
private int quantity = 1; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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
# Joining video files | |
ls *.MP4 | sort | awk '{print "file \x27" $0 "\x27"}' > concat.txt | |
ffmpeg -f concat -i concat.txt -c copy output.mp4 | |
# Quicktime to MP4 | |
ffmpeg -i Untitled.mov -vcodec copy -acodec copy out.mp4 |
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 java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
/** | |
* The smarter thing to do would be to use what is Guava, etc...but Guava is a big fat library that | |
* will blow the dex count and this is pretty much the only thing we are using out of it. | |
* |
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
android { | |
lintOptions { | |
abortOnError true | |
lintConfig file("${project.rootDir}/config/lint/lint.xml") | |
htmlReport 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
StrictMode policy violation; ~duration=1436 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=1114143 violation=2 | |
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263) | |
at libcore.io.BlockGuardOs.access(BlockGuardOs.java:67) | |
at java.io.File.doAccess(File.java:281) | |
at java.io.File.exists(File.java:361) | |
at android.app.ContextImpl.createFilesDirLocked(ContextImpl.java:418) | |
at android.app.ContextImpl.getCacheDir(ContextImpl.java:503) | |
at android.content.ContextWrapper.getCacheDir(ContextWrapper.java:233) |
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
export PS1="\[$(tput bold)\]\[$(tput setaf 6)\]\t \[$(tput setaf 2)\][\[$(tput setaf 3)\]\u\[$(tput setaf 1)\]@\[$(tput setaf 3)\]\h \[$(tput setaf 6)\]\W\[$(tput setaf 2)\]]\[$(tput setaf 4)\]\\$ \[$(tput sgr0)\]" | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home # Update to latest | |
export ANDROID_HOME=~/Library/Android/sdk | |
export PATH=$ANDROID_HOME/tools:$PATH | |
export PATH=$ANDROID_HOME/platform-tools:$PATH | |
export PATH=$ANDROID_HOME/build-tools/22.0.1:$PATH # Update to latest |
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
ffmpeg -f concat -i concat.txt -c copy output.mp4 |