This file contains 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
<html> | |
<body> | |
<h2>Privacy Policy</h2> | |
<p>Iveta Jurčíková and Benjamín Varga built the L.I.F.T. app as a free app. This SERVICE is provided by Iveta Jurčíková and Benjamín Varga at no cost and is intended | |
for use as is.</p> | |
<p>This page is used to inform website visitors regarding our policies with the collection, use, and | |
disclosure of Personal Information if anyone decided to use our Service.</p> | |
<p>If you choose to use our Service, then you agree to the collection and use of information in | |
relation with this policy. The Personal Information that we collect are used for providing and | |
improving the Service. We will not use or share your information with anyone except as described |
This file contains 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
data class CountryListViewState( | |
val isLoading = false, | |
val countries = emptyList(), | |
val isRefreshing = true, | |
val error = `UnknownHostException…`) |
This file contains 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
class MyProfileViewModel { | |
val progress = MutableLiveData() | |
val myProfile = MutableLiveData() | |
override fun loadProfile() { | |
progress.value = true | |
subscriptions.add( | |
myProfileInteractor.getLoggedUser().subscribe( |
This file contains 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
val reducer = BiFunction { previousState: CountryListViewState, result: CountryListResult -> | |
when (result) { | |
is LoadCountriesResult -> | |
when (result) { | |
is LoadCountriesResult.Success -> { | |
previousState.copy( | |
isLoading = false, | |
isRefreshing = false, | |
countries = result.countries | |
) |
This file contains 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
import android.arch.lifecycle.LiveData | |
import android.arch.lifecycle.MediatorLiveData | |
import android.os.Handler | |
import android.os.Looper | |
fun <T> LiveData<T>.debounce(duration: Long = 1000L) = MediatorLiveData<T>().also { mld -> | |
val source = this | |
val handler = Handler(Looper.getMainLooper()) | |
val runnable = Runnable { |
This file contains 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
import okhttp3.MediaType | |
import okhttp3.RequestBody | |
import okio.BufferedSink | |
import okio.Okio | |
import java.io.File | |
import kotlin.math.roundToInt | |
class ProgressByteArrayRequestBody( | |
private val contentType: MediaType, | |
private val array: ByteArray, |
This file contains 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 com.livepenalty.android | |
import com.livepenalty.android.CommitRange.BiDirectional | |
import com.livepenalty.android.CommitRange.UniDirectional | |
import com.livepenalty.android.ConventionalCommit.chore | |
import com.livepenalty.android.ConventionalCommit.docs | |
import com.livepenalty.android.ConventionalCommit.feat | |
import com.livepenalty.android.ConventionalCommit.fix | |
import com.livepenalty.android.ConventionalCommit.other | |
import com.livepenalty.android.ConventionalCommit.refactor |
This file contains 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
import kotlin.contracts.contract | |
sealed class Either<out E, out V> { | |
data class Error<out E>(val error: E) : Either<E, Nothing>() | |
data class Value<out V>(val value: V) : Either<Nothing, V>() | |
} | |
typealias Left<T> = Either.Error<T> | |
typealias Right<T> = Either.Value<T> |
This file contains 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
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.test.StandardTestDispatcher | |
import kotlinx.coroutines.test.TestScope | |
import kotlinx.coroutines.test.UnconfinedTestDispatcher | |
import kotlinx.coroutines.test.runTest | |
fun main() { | |
println("--- StandardTestDispatcher: 1. example ---") |