Skip to content

Instantly share code, notes, and snippets.

import android.content.Context;
import android.content.Intent;
import android.support.annotation.StringDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public final class DemoModeHelper {
public static void enter(Context context) {
new Enter(context).send();
@NightlyNexus
NightlyNexus / ItemTypeAdapterFactory.java
Created June 16, 2015 19:25
Remove those pesky "status" objects in your JSON payload with Gson. Usage: new GsonConverter(new GsonBuilder().registerTypeAdapterFactory(new ItemTypeAdapterFactory())create());
public static class ItemTypeAdapterFactory implements TypeAdapterFactory {
final static String KEY_TO_REMOVE = "status";
@Override
public <T> TypeAdapter<T> create(Gson gson, final TypeToken<T> type) {
final TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
import java.util.Collection;
/**
* @author Eric Cochran
*/
public class ArrayListBest<T> {
private static final int DEFAULT_CAPACITY = 10;
private final int initialCapacity;
private T[] arr;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ProgressBar;
public class TintedProgressBar extends ProgressBar {