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
// open JaCoCo report after generation | |
def openReport(htmlOutDir) { | |
final reportPath = "$htmlOutDir\\index.html" | |
println "HTML Report: $reportPath" | |
def os = org.gradle.internal.os.OperatingSystem.current() | |
if (os.isWindows()) { | |
exec { commandLine 'cmd', '/c', "start $reportPath" } | |
} else if (os.isMacOsX()) { |
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
import android.util.LruCache; | |
import androidx.annotation.MainThread; | |
import androidx.annotation.NonNull; | |
import androidx.lifecycle.LiveData; | |
import androidx.lifecycle.MutableLiveData; | |
import fr.delcey.go4lunch.data.restaurant_details.pojo.RestaurantDetailsResponse; | |
import fr.delcey.go4lunch.data.restaurant_details.pojo.RestaurantDetailsResponseWrapper; | |
import retrofit2.Call; |
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 fr.delcey.pokedexfullflow | |
import android.location.Location | |
import androidx.lifecycle.LiveData | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.flowOf | |
import kotlin.random.Random | |
class AllInOneRepository { |
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
@ColorRes | |
fun getTypeColorRes(type: String?): Int? = when (type) { | |
"normal" -> R.color.type_normal | |
"fire" -> R.color.type_fire | |
"water" -> R.color.type_water | |
"electric" -> R.color.type_electric | |
"grass" -> R.color.type_grass | |
"ice" -> R.color.type_ice | |
"fighting" -> R.color.type_fighting |
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
Intent intent = MeetingDetailActivity.navigate(this, meetingId); | |
Pair<View, String> imageViewPair = new Pair<>(imageView, imageView.getTransitionName()); | |
Pair<View, String> textViewPair = new Pair<>(textView, textView.getTransitionName()); | |
@SuppressWarnings("unchecked") | |
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation( | |
this, | |
imageViewPair, | |
textViewPair |
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
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.runBlockingTest | |
import kotlinx.coroutines.test.setMain | |
import org.junit.rules.TestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement |
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
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.* | |
import org.junit.rules.TestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement | |
@ExperimentalCoroutinesApi | |
class TestCoroutineRule : TestRule { | |
val testCoroutineDispatcher = UnconfinedTestDispatcher() |
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
import kotlin.time.Duration | |
import kotlin.time.Duration.Companion.seconds | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.channels.BufferOverflow | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.MutableSharedFlow | |
import kotlinx.coroutines.flow.combine | |
import kotlinx.coroutines.flow.distinctUntilChanged | |
import kotlinx.coroutines.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
import kotlin.time.Duration | |
import kotlin.time.Duration.Companion.seconds | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.channels.BufferOverflow | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.MutableSharedFlow | |
import kotlinx.coroutines.flow.combine | |
import kotlinx.coroutines.flow.distinctUntilChanged | |
import kotlinx.coroutines.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
import kotlinx.coroutines.* | |
import java.io.IOException | |
object MultipleDetailsDemo { | |
@JvmStatic | |
fun main(args: Array<String>) = runBlocking { | |
val start = System.currentTimeMillis() | |
val detailEntities: List<DetailEntity> = try { | |
val ids = listOf(0, 1, 2) |