I hereby claim:
- I am alexfu on github.
- I am alexfu (https://keybase.io/alexfu) on keybase.
- I have a public key whose fingerprint is 2AB9 0B76 0A73 7277 00C2 42FB 92A7 CCF0 9D47 5005
To claim this, I am signing this object:
import groovy.json.JsonBuilder | |
import groovy.json.JsonSlurper | |
ext.VersioningPlugin = VersioningPlugin | |
class VersioningPlugin implements Plugin<Project> { | |
@Override | |
void apply(Project project) { | |
project.extensions.create("versioning", VersioningPluginExtension) |
<?xml version="1.0" encoding="utf-8"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="@color/mycolor"> | |
<item android:id="@+id/mask"> | |
<color android:color="@android:color/white" /> | |
</item> | |
</ripple> |
import android.graphics.Rect; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration { | |
private final int spacing; | |
private int displayMode; | |
public static final int HORIZONTAL = 0; |
import Foundation | |
import UIKit | |
class UIErrorTextField : UITextField { | |
private let bgView = UIView() | |
private var textFieldHeight = CGFloat(40) | |
private var errorTextHeight = CGFloat(12) | |
private let errorTextPadding = CGFloat(2) | |
var errorFont = UIFont.systemFontOfSize(12) { |
I hereby claim:
To claim this, I am signing this object:
/** | |
* A {@link FrameLayout} that can show different states one at a time. | |
*/ | |
public class StateFrameLayout extends ViewAnimator { | |
public static final String STATE_LOADING = "loading"; | |
public static final String STATE_EMPTY = "empty"; | |
public static final String STATE_ERROR = "error"; | |
private static final String STATE_DEFAULT = "default"; | |
private SimpleArrayMap<String, View> stateViewMap; |
val world = "World" | |
val mySpannedText = SpannableString("Hello ${world}!") | |
mySpannedText.spanWith(world) { | |
what = BackgroundColorSpan(Color.RED) | |
flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | |
} |
/** | |
* This file would be located under /path/to/project/app/build.gradle | |
*/ | |
apply plugin: 'com.android.application' | |
android { | |
// Usual stuff | |
} |
import android.content.Context | |
import android.view.MotionEvent | |
import android.view.MotionEvent.* | |
import android.view.ViewConfiguration | |
class TouchSlopDelegate(context: Context) { | |
private val targetTouchSlop = ViewConfiguration.get(context).scaledTouchSlop | |
private var touchSlop: Int = 0 | |
private var lastTouchX: Float = 0f | |
private var lastTouchY: Float = 0f |
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:layout_width="200dp" | |
android:layout_height="100dp" |