I hereby claim:
- I am pablisco on github.
- I am pablisco (https://keybase.io/pablisco) on keybase.
- I have a public key whose fingerprint is E135 E879 2702 D75D 32BD A39A 048F 1643 E876 2E4C
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public class ObjectMatcher<T> { | |
private SparseArrayCompat<T> values = new SparseArrayCompat<>(); | |
public MatchCandidate matchWith(T value) { | |
return new MatchCandidate(value); | |
} | |
public T find(Object... keys) { | |
return values.get(Arrays.hashCode(keys)); |
package com.oos.kryten.dialogs; | |
import static com.google.common.base.Preconditions.checkNotNull; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.DialogInterface.OnClickListener; | |
import android.view.KeyEvent; |
#set($paramName = $helper.getParamName($field, $project)) | |
public ## | |
#if($field.modifierStatic) | |
static void ## | |
#else | |
$classname ## | |
#end | |
with$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) { | |
#if ($field.name == $paramName) | |
#if (!$field.modifierStatic) |
// on global layout | |
@Rule | |
public final ActivityTestRule<AwesomeActivity> activityTestRule = new ActivityTestRule<CartActivity>(AwesomeActivity.class, true, false) { | |
@Override | |
protected void afterActivityLaunched() { | |
hideProgressBarAnimation(getActivity()); | |
} | |
}; |
fun ImageView.startLoadingAnimation( | |
@ColorRes startColorRes: Int, | |
@ColorRes endColorRes: Int | |
) { | |
animate( | |
ArgbEvaluator(), | |
colors[startColorRes], | |
colors[endColorRes], | |
onConfig = { | |
duration = 1000 |
import android.os.Build | |
import android.view.View | |
import java.util.concurrent.atomic.AtomicInteger | |
object ViewCompanion { | |
private val NEXT_GENERATED_ID = AtomicInteger(1) | |
/** | |
* Inspired by: https://stackoverflow.com/a/15442997/458365 |
fun Int.dp(): Int = | |
toFloat().dp().toInt() | |
fun Float.dp(): Float = applyDimension( | |
COMPLEX_UNIT_DIP, | |
this, | |
Resources.getSystem().displayMetrics | |
) |
import android.app.Activity | |
import android.app.Service | |
import android.content.ComponentName | |
import android.content.Context | |
import android.content.Intent | |
import android.content.Intent.EXTRA_SUBJECT | |
import android.content.Intent.EXTRA_TEXT | |
import android.net.Uri | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KClass |
fun <A> A.toJson(): String { | |
fun <A> Iterable<A>.toJsonArray(): String = | |
joinToString(", ", "[", "]") { it.toJson() } | |
fun <A, B> Map<A, B>.toJsonObject() = | |
entries.joinToString(", ", "{", "}") { (key, value) -> "\"$key\" : ${value.toJson()}" } | |
return when(this) { | |
null -> "null" |