Another couple of kotlin utils

Replacement of @BindView from ButterKnife

private val someTextView: TextView by lazy { findViewById(R.id.some_text_view) }
fun <T : View> View.bindable(@IdRes id: Int): Lazy<T> = 
lazyUnsafe { findViewById<T>(id) }
fun <T> lazyUnsafe(initializer: () -> T): Lazy<T> =
lazy(LazyThreadSafetyMode.NONE, initializer)

Useful utils for context and view

More handy dimension extensions for view

val p = view.padding.start
view.padding
view.margin

Coroutine properties — properties that can be suspended

prop set 6

Afterwords

--

--

--

Love being creative to solve some problems with an simple and elegant ways

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How To Use Google AdMob effectively in Android Applications

How To Run Your Apps in Android Studio?

How I automated creating files for a new screen with my own Android Studio Plugin

Downloading the Files

Renaming Project and Module in Android Studio

React Native Video — handling fullscreen and controls on Android

How To Provide Languages Dynamically Using App Bundle

Android App Bundle

Jetpack DataStore -Good Bye SharedPreferences

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michael Spitsin

Michael Spitsin

Love being creative to solve some problems with an simple and elegant ways

More from Medium

TDD — Part II, MVVM (Android)

Android Jetpack DataStore 101

Kotlin Coroutines [Part-2]

Gradle Kotlin DSL: To make your Android Project better