Initial commit
This commit is contained in:
28
sources/butterknife/internal/DebouncingOnClickListener.java
Normal file
28
sources/butterknife/internal/DebouncingOnClickListener.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package butterknife.internal;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class DebouncingOnClickListener implements View.OnClickListener {
|
||||
private static final Runnable ENABLE_AGAIN = new Runnable() { // from class: butterknife.internal.a
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
DebouncingOnClickListener.enabled = true;
|
||||
}
|
||||
};
|
||||
private static final Handler MAIN = new Handler(Looper.getMainLooper());
|
||||
static boolean enabled = true;
|
||||
|
||||
public abstract void doClick(View view);
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public final void onClick(View view) {
|
||||
if (enabled) {
|
||||
enabled = false;
|
||||
MAIN.post(ENABLE_AGAIN);
|
||||
doClick(view);
|
||||
}
|
||||
}
|
||||
}
|
5
sources/butterknife/internal/ListenerClass$NONE.java
Normal file
5
sources/butterknife/internal/ListenerClass$NONE.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package butterknife.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum ListenerClass$NONE {
|
||||
}
|
35
sources/butterknife/internal/Utils.java
Normal file
35
sources/butterknife/internal/Utils.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package butterknife.internal;
|
||||
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Utils {
|
||||
static {
|
||||
new TypedValue();
|
||||
}
|
||||
|
||||
public static View a(View view, int i, String str) {
|
||||
View findViewById = view.findViewById(i);
|
||||
if (findViewById != null) {
|
||||
return findViewById;
|
||||
}
|
||||
throw new IllegalStateException("Required view '" + a(view, i) + "' with ID " + i + " for " + str + " was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.");
|
||||
}
|
||||
|
||||
public static <T> T b(View view, int i, String str, Class<T> cls) {
|
||||
return (T) a(a(view, i, str), i, str, cls);
|
||||
}
|
||||
|
||||
public static <T> T a(View view, int i, String str, Class<T> cls) {
|
||||
try {
|
||||
return cls.cast(view);
|
||||
} catch (ClassCastException e) {
|
||||
throw new IllegalStateException("View '" + a(view, i) + "' with ID " + i + " for " + str + " was of the wrong type. See cause for more info.", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String a(View view, int i) {
|
||||
return view.isInEditMode() ? "<unavailable while editing>" : view.getContext().getResources().getResourceEntryName(i);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user