Skip to content

Instantly share code, notes, and snippets.

@erikjhordan-rey
erikjhordan-rey / AutoSizingExt.kt
Created November 23, 2017 17:24
This class is an extension to facilitate the use of AutoSizing on AppCompatTextView.
mport android.support.v4.widget.TextViewCompat
import android.support.v7.widget.AppCompatTextView
import android.util.TypedValue
import android.widget.TextView
/*
* This class is an extension to facilitate the use of AutoSizing on AppCompatTextView.
*/
// Default
@erikjhordan-rey
erikjhordan-rey / RetrofitExt.kt
Last active November 23, 2017 17:25
This class is an extension to facilitate the use of Retrofit callback responses .
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
fun <T> Call<T>.execute(success: (response: Response<T>) -> Unit,
failure: (t: Throwable) -> Unit) {
enqueue(object : Callback<T> {
override fun onResponse(call: Call<T>?, response: Response<T>) = success(response)
/**
* Copyright 2016 Erik Jhordan Rey.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
@erikjhordan-rey
erikjhordan-rey / ChatAdapter.java
Last active August 29, 2015 14:25
Adapter para el chat demo chat android firebase
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;
/*
* Copyright 2014 Chris Banes
*
* 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
@erikjhordan-rey
erikjhordan-rey / EffectBlur
Last active August 29, 2015 14:23
EffectBlur Picasso
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
/*This code was not written by me but is really good,I found the way to do Compatible with sdkVersion 15!