Skip to content

Instantly share code, notes, and snippets.

import android.content.Context
import android.graphics.Canvas
import android.graphics.Rect
import android.os.Build
import android.util.AttributeSet
import android.view.View
import java.util.*
/**
* @author Drakeet Xu
-ignorewarnings
-keep public class * extends android.os.Binder
-keepclassmembers enum * {
**[] $VALUES;
public *;
}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
}
// Copied from https://github.com/ToxicBakery/ViewPagerTransforms
@SuppressWarnings("WeakerAccess")
public abstract class BaseTransformer implements PageTransformer {
public static final float DAMPING_RATIO_NO_BOUNCY = 1f;
/**
* Called each {@link #transformPage(View, float)}.
*
* @param view the view
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
#
# Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
# the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
# will be ignored by new version of the Android plugin for Gradle.
#-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
import android.support.v7.widget.RecyclerView
/**
* @author drakeet
*/
class QuickReturnDelegate(private val scrollSlop: Int = 12) : RecyclerView.OnScrollListener() {
private lateinit var callback: (hide: Boolean) -> Unit
private var scrollY: Int = 0
### Keybase proof
I hereby claim:
* I am drakeet on github.
* I am drakeet (https://keybase.io/drakeet) on keybase.
* I have a public key ASCtsAYEK4FBAGci9LMr_H8U7MURxIVrbnVqfgzSUCyzpgo
To claim this, I am signing this object:
-ignorewarnings
-keep public class * extends android.os.Binder
-keepclassmembers enum * {
**[] $VALUES;
public *;
}
# v7
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
public class CustomMatchers {
public static Matcher<View> withBackground(final int resourceId) {
return new TypeSafeMatcher<View>() {
@Override
public boolean matchesSafely(View view) {
return sameBitmap(view.getContext(), view.getBackground(), resourceId);
}
@Override