Some Kotlin delegates examples
- property delegates and class delegates
Some Kotlin delegates examples
adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp|mObscuringWindow' |
package com.pantos27.hamburgersforbreakfast | |
import android.app.Activity | |
import android.os.Bundle | |
/** | |
* A utility class to keep track if your app is in the foreground or background | |
* without any special permission or API restrictions | |
* Note that if your app has any activities that run on a different | |
* process (through the process attribute in your manifest) this utility might not be persistent | |
* |
const promiseWrapper = <T> (promise: Promise<T>): () => T => { | |
let status = "pending"; | |
let result: T; | |
const s = promise.then( | |
(value) => { | |
status = "success"; | |
result = value; | |
}, | |
(error) => { |