Skip to content

Instantly share code, notes, and snippets.

View TheReprator's full-sized avatar
🎯
Focusing

Vikram Singh TheReprator

🎯
Focusing
View GitHub Profile
@TheReprator
TheReprator / ClickToSelectEditText.java
Created May 1, 2017 20:11 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText<T extends Listable> extends AppCompactEditText {
List<T> mItems;
String[] mListableItems;
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
public ClickToSelectEditText(Context context) {
super(context);
@TheReprator
TheReprator / GenericAsyncTaskLoader.java
Created April 27, 2017 19:31 — forked from HenokT/GenericAsyncTaskLoader.java
An example of a Generic AsyncTaskLoader for Android
package com.yourcompany.util;
import android.content.Context;
import android.support.v4.content.AsyncTaskLoader;
import android.util.Log;
import com.yourcompany.util.GenericAsyncTaskLoader.ServiceData;
/**
* A generic Loader that delegates its actual loading operation to a
* CustomLoaderCallbacks<T> instance passed through the constructor.
@TheReprator
TheReprator / SimpleCursorLoader.java
Created April 27, 2017 19:04 — forked from cbeyls/SimpleCursorLoader.java
A CursorLoader to implement simple monitorable database queries without a ContentProvider.
package be.digitalia.fosdem.loaders;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.AsyncTaskLoader;
/**
* A CursorLoader that doesn't need a ContentProvider.
*
* @author Christophe Beyls
@TheReprator
TheReprator / PaddingItemDecoration.java
Created March 14, 2017 09:06 — forked from BenDLH/PaddingItemDecoration.java
Item decoration to add padding vertically and horizontally to RecyclerViews using Linear and Grid layout managers.
//
// Created by Ben on 28/09/2016.
// Copyright (c) 2016 SHAPE A/S. All rights reserved.
//
public class PaddingItemDecoration extends RecyclerView.ItemDecoration {
private final Context _context;
private Resources _resources;
private Paint _paint = new Paint(Paint.ANTI_ALIAS_FLAG);
/*
* Copyright (c) 2015 Express Quality Food Global Service GmbH. All rights reserved.
*
* 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
@TheReprator
TheReprator / LineThroughTextView.java
Last active October 16, 2015 06:31 — forked from longkai/LineThroughTextView.java
A simple line through text view. ie. ----------------- Hello, World --------------
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;