Function | Function type | Target passed as | Returns |
---|---|---|---|
also |
Extension | it |
Target |
apply |
Extension | this |
Target |
let |
Extension | it |
Block return value |
run |
Extension | this |
Block return value |
with |
Regular | this |
Block return value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Computer Language Benchmarks Game | |
* https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
* | |
* based on Jarkko Miettinen's Java program | |
* contributed by Christophe Beyls | |
*/ | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.runBlocking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.sample | |
import android.os.Parcel | |
import kotlinx.parcelize.Parceler | |
import java.math.BigDecimal | |
import java.math.BigInteger | |
import java.util.Date | |
inline fun <T> Parcel.readNullable(reader: () -> T) = | |
if (readInt() != 0) reader() else null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class Animal { | |
// Cats are simple. A cat is a cat. | |
object Cat : Animal() | |
sealed class Dog : Animal() { | |
abstract val breed: String? | |
class DogWithBreed(override val breed: String) : Dog() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.common.livedata; | |
import android.os.Handler; | |
import android.os.Looper; | |
import android.os.SystemClock; | |
import androidx.annotation.NonNull; | |
import androidx.lifecycle.LiveData; | |
import java.util.concurrent.TimeUnit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.arch.lifecycle; | |
import android.arch.lifecycle.LiveData; | |
import android.arch.lifecycle.MutableLiveData; | |
import android.os.AsyncTask; | |
import android.support.annotation.MainThread; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.VisibleForTesting; | |
import android.support.annotation.WorkerThread; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.archcomponentsfix.fragment; | |
import android.arch.lifecycle.Lifecycle.Event; | |
import android.arch.lifecycle.LifecycleOwner; | |
import android.arch.lifecycle.LifecycleRegistry; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
import android.view.View; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.common.services | |
import android.app.Service | |
import android.content.Intent | |
import android.os.Message | |
import kotlinx.coroutines.experimental.android.UI | |
import kotlinx.coroutines.experimental.channels.Channel | |
import kotlinx.coroutines.experimental.channels.LinkedListChannel | |
import kotlinx.coroutines.experimental.launch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.digitalia.sample | |
import android.os.Parcel | |
import android.os.Parcelable | |
import java.math.BigDecimal | |
import java.math.BigInteger | |
import java.util.* | |
interface KParcelable : Parcelable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.brol | |
import android.os.Binder | |
import android.os.Bundle | |
import android.os.Parcelable | |
import android.support.v4.app.BundleCompat | |
import android.support.v4.app.Fragment | |
import kotlin.reflect.KProperty | |
/** |