Skip to content

Instantly share code, notes, and snippets.

Chema Pramos jmperezra

Block or report user

Report or block jmperezra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jmperezra / Coroutine_scope_functions.kt
Created Jul 10, 2019 — forked from pablisco/Coroutine_scope_functions.kt
Simple way to jump into a separate context
View Coroutine_scope_functions.kt
suspend fun <T, R> T.letOn(
context: CoroutineContext,
block: suspend CoroutineScope.(T) -> R
): R = withContext(context) { block(this@letOn) }
suspend fun <T> T.alsoOn(
context: CoroutineContext,
block: suspend CoroutineScope.(T) -> Unit
): T = also { withContext(context) { block(this@alsoOn) } }
jmperezra /
Created Sep 3, 2017 — forked from paolorotolo/
A Spinner component with a floating label for Android, similar to EditText components wrapped in a TextInputLayout.
* Copyright 2015 Farbod Salamat-Zadeh
* 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
* Unless required by applicable law or agreed to in writing, software
jmperezra / build.gradle
Created Jul 12, 2017 — forked from fabiomsr/build.gradle
dependencies.gradle example
View build.gradle
apply plugin: ''
apply plugin: ''
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion rootProject.androidCompileSdkVersion
buildToolsVersion rootProject.androidBuildToolsVersion
defaultConfig {
minSdkVersion rootProject.androidMinSdkVersion
jmperezra /
Last active Jul 20, 2017 — forked from swanson/gist:7dee3f3474e30fe8f15c
Retrofit LocalJsonClient
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.mime.TypedInput;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
You can’t perform that action at this time.