Skip to content

Instantly share code, notes, and snippets.

@teslacoil
teslacoil / VectorResourceRequestHandler.java
Last active October 13, 2017 19:48
Picasso RequestHandler that can load VectorDrawables, or other Drawables, by converting them into bitmaps
/*
* Copyright (C) 2013 Square, Inc.
*
* 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
@teslacoil
teslacoil / SimpleFastScrollRecyclerView.java
Created December 13, 2015 21:24
Basic implementation of BaseRecyclerView from AOSP Launcher3 for use with listview style recyclerviews. In your adapter implement FastScrollTitleSectionProvider
/*
* Copyright (C) 2015 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
@teslacoil
teslacoil / crowdin_populate.sh
Created May 10, 2013 21:27
Populates res/values-XX directories from crowdin translations. Tries to do the appropriate escapes and greps/warns about messed up %1$s style formatting
#!/bin/sh
rm -rf iw
cp -R he iw
mv pt-BR pt-rBR
mv pt-PT pt-rPT
mv zh-CN zh-rCN
mv zh-TW zh-rTW
mv no nb
mv es-ES es
mv sv-SE sv
@teslacoil
teslacoil / proclogcat.pl
Created May 9, 2013 20:24
Slightly modified version of https://github.com/jasta/android-dev-tools/blob/master/proclogcat that has improved support for Samsung ICS+ devices which hide the process name in the ActivityManager log messages
#!/usr/bin/env perl
###############################################################################
##
## Simple script designed to insert after "adb logcat" in a pipeline to track a
## specific package's logcat messages.
##
## I typically invoke this script as a function in my profile:
##
## function plogcat() {
## adb logcat | proclogcat $* | coloredlogcat.py