Skip to content

Instantly share code, notes, and snippets.

View MenilV's full-sized avatar

Menil Vukovic MenilV

View GitHub Profile
@MenilV
MenilV / KeyboardManager.kt
Created June 29, 2021 16:07 — forked from andrewmunn/KeyboardManager.kt
Android Keyboard Status Observable
/**
* Manages access to the Android soft keyboard.
*/
class KeyboardManager @Inject constructor(private val activity: Activity) {
/**
* Observable of the status of the keyboard. Subscribing to this creates a
* Global Layout Listener which is automatically removed when this
* observable is disposed.
*/
@MenilV
MenilV / logging.kt
Created May 30, 2020 20:24 — forked from tomaszpolanski/logging.kt
RxLogging
@file:Suppress("NOTHING_TO_INLINE")
import android.util.Log
import io.reactivex.*
inline fun <reified T> printEvent(tag: String, success: T?, error: Throwable?) =
when {
success == null && error == null -> Log.d(tag, "Complete") /* Only with Maybe */
success != null -> Log.d(tag, "Success $success")
error != null -> Log.d(tag, "Error $error")