kotlinx.coroutines.Job import kotlinx.coroutines.cancelAndJoin import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch import java.io.File import java.time.Instant class CreateKMLMultiTrackViewModel(application: Application) : Android...
The list of home members that can be used for the condition of when home members come home, for example, "Amy and Tom". Example in Kotlin // deviceId is the currently selected device. // Retrieve the dpId, entityType, and deviceConditionData as described in the above table. // Pass...
configuration-cache/src/main/kotlin/org/gradle/internal/cc/impl ConfigurationCacheAwareLocalComponentCache.kt model-core/src/main/java/org/gradle/internal/model CalculatedValueFactory.java jvm/java-platform/src/integTest/groovy/org/gradle/internal/component/model JavaEcosystemAttributeMatcherTest.groovy...
kotlin.runCatching { if (request?.url?.scheme?.startsWith("http") == false) { val intent = Intent(Intent.ACTION_VIEW, request.url) context.startActivity(Intent.createChooser(intent, request.url.toString())) return true } }.onFailure { context.longToast("跳转APP失败: ${request?.url}") ...
.totalFeatureCount}" } } /** * Create a feature with attributes on map click and it to the [featureTable] * Also, updates the TotalFeatureCount on the screen */ private fun addFeature(mapPoint: Point) { // set up the feature attributes val featureAttributes = mutableMapOf<String, ...
Also Check out:Building APIs on the JVM Using Kotlin and Spark Different, More Efficient Methods Reduction in complexity is certainly valuable, but there’s something more fundamental going on between Java and Scala. As a further example to demonstrate the reduction in complexity, the previously-qu...
We’ll create a client/server application that gets from a web API a list of book recommendations for a logged-in user based on the user’s interests or likes. We’ll store the user’s likes in a database. We’ll write both the client and the web API in Kotlin. The client will ...
import kotlin.io.path.createFile import kotlin.io.path.exists import kotlin.io.path.listDirectoryEntries import kotlin.io.path.readLines import java.util.zip.ZipEntry import java.util.zip.ZipOutputStream import kotlin.io.path.* import kotlin.io.path.Path as PathCreator/...
29 + import kotlinx.coroutines.launch 30 + import timber.log.Timber 31 + import java.lang.ref.WeakReference 32 + import kotlin.system.exitProcess 33 + 34 + object AppContext : ContextWrapper(null), 35 + Application.ActivityLifecycleCallbacks, ComponentCallbacks2 { 36 + 37 + val...
Column { var pages by remember { mutableStateOf(listOf("Four", "Five", "Six")) } Button(onClick = { pages = listOf("One", "Two", "Three") + pages }) { Text(text = "Prepend new pages") } PageCurl( count = pages.size, key = { pages[it].hashCode() }, ) { index ->...