Skip to content

Instantly share code, notes, and snippets.

🐞
bugging

Konstantin terrakok

🐞
bugging
Block or report user

Report or block terrakok

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
View SmartField.kt
import android.text.Editable
import android.text.TextWatcher
import android.view.View
import android.widget.EditText
/**
* Created by Konstantin Tskhovrebov (aka @terrakok) on 18.09.17.
*/
class SmartField<T: Any>(
private val editText: EditText,
View SimpleDividerDecorator.kt
/**
* Created by Konstantin Tskhovrebov (aka @terrakok) on 25.08.17.
*/
class SimpleDividerDecorator(
private val dividerSizePx: Int,
dividerColor: Int
) : RecyclerView.ItemDecoration() {
private val paint = Paint().apply { color = dividerColor }
View Extension.kt
fun Resources.color(colorRes: Int) =
if (Build.VERSION.SDK_INT >= 23) {
this.getColor(colorRes, null)
} else {
this.getColor(colorRes)
}
fun ViewGroup.inflate(@LayoutRes layoutRes: Int, attachToRoot: Boolean = false): View {
return LayoutInflater.from(context).inflate(layoutRes, this, attachToRoot)
}
View MoxyMapFragment.kt
import android.os.Bundle
import android.support.annotation.LayoutRes
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.arellomobile.mvp.MvpDelegate
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.MapView
import com.google.android.gms.maps.OnMapReadyCallback
View CurlLoggingInterceptor.kt
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
You can’t perform that action at this time.