A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class SquareImageView extends ImageView { | |
public SquareImageView(Context context) { | |
super(context); | |
} |
// TODO add <meta-data android:value="GlideModule" android:name="....OkHttpProgressGlideModule" /> | |
// TODO add <meta-data android:value="GlideModule" tools:node="remove" android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule" /> | |
// or not use 'okhttp@aar' in Gradle depdendencies | |
public class OkHttpProgressGlideModule implements GlideModule { | |
@Override public void applyOptions(Context context, GlideBuilder builder) { } | |
@Override public void registerComponents(Context context, Glide glide) { | |
OkHttpClient client = new OkHttpClient(); | |
client.networkInterceptors().add(createInterceptor(new DispatchingProgressListener())); | |
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client)); | |
} |
import java.io.IOException; | |
import okhttp3.HttpUrl; | |
import okhttp3.Interceptor; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
/** An interceptor that allows runtime changes to the URL hostname. */ | |
public final class HostSelectionInterceptor implements Interceptor { | |
private volatile String host; |
import java.util.Queue; | |
import java.util.concurrent.atomic.*; | |
import rx.*; | |
import rx.Observable.Operator; | |
import rx.exceptions.MissingBackpressureException; | |
import rx.internal.operators.*; | |
import rx.internal.util.*; | |
import rx.internal.util.atomic.SpscAtomicArrayQueue; |
android.permission.ACCESS_ALL_DOWNLOADS | |
android.permission.ACCESS_BLUETOOTH_SHARE | |
android.permission.ACCESS_CACHE_FILESYSTEM | |
android.permission.ACCESS_CHECKIN_PROPERTIES | |
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY | |
android.permission.ACCESS_DOWNLOAD_MANAGER | |
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED | |
android.permission.ACCESS_DRM_CERTIFICATES | |
android.permission.ACCESS_EPHEMERAL_APPS | |
android.permission.ACCESS_FM_RADIO |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- Material Design Colors --> | |
<color name="md_red_50">#ffffebee</color> | |
<color name="md_red_100">#ffffcdd2</color> | |
<color name="md_red_200">#ffef9a9a</color> | |
<color name="md_red_300">#ffe57373</color> | |
<color name="md_red_400">#ffef5350</color> |
package com.example.retrofit.loader; | |
import retrofit.Response; | |
/** | |
* A wrapper around the Retrofit {@link Response} that will | |
* throw any loading errors upon retrieval. | |
* | |
* @param <T> The data type that was loaded. | |
*/ |
package views; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.os.Build; | |
import android.text.TextUtils; |
@ECHO OFF | |
IF "%1"=="" GOTO MissingFileNameError | |
IF EXIST "%1" (GOTO ContinueProcessing) ELSE (GOTO FileDoesntExist) | |
:ContinueProcessing | |
set FileNameToProcess=%1 | |
set FileNameForDx=%~n1.dex | |
IF "%~x1"==".dex" GOTO ProcessWithPowerShell | |
REM preprocess Jar with dx |