supervisorScope { launch { // Coroutine Body } } 3. 不支持取消 当你在自己定义的 suspend 函数中进行一些比较重的操作时,例如计算斐波拉契数列: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 // factorial of n (n!) = 1 * 2 * 3 * 4 * ... * n suspend fun calculateFactorialOf(numb...
Scope Functions let let can be used for scoping and null-checks. When called on an object, let executes the given block of code and returns the result of its last expression. The object is accessible inside the block by the reference it (by default) or a custom name. val message: ...
Kotlin Standard Functions cheat-sheet - Learn how to use kotlin's standard library with lambda functions Kotlin: An Illustrated Guide - Illustrated guide to learn Kotlin AlexeySoshin/Hands-on-Design-Patterns-with-Kotlin - Code examples for 'Hands-on Design Patterns with Kotlin' book From Java To...
Usually, when the user leaves the screen, the ViewModel gets cleared and all the coroutines launched in viewModelScope get canceled. Sometimes, however, we want a certain coroutine operation to be continued when the user leaves the screen. In this use case, the network request keeps running an...
consoleau/kassava - This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. moove-it/fakeit - Generates realistic fake data — like names, emails, dates, countries — to be used in your Android development environment...
consoleau/kassava - This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. moove-it/fakeit - Generates realistic fake data — like names, emails, dates, countries — to be used in your Android development environment...
Code This branch is10 commits behindHeapy/awesome-kotlin:main. Folders and files Name Last commit message Last commit date Latest commit Cannot retrieve latest commit at this time. History 1,631 Commits .artwork Move frontend files to own folder to clear the clutter from repo root… ...
adrielcafe/AndroidCoroutineScopes - This lib implements the most common CoroutineScopes used in Android apps. 0xe1f/KotX - Kotlin extension and tool library for Android yundom/kache - A lightweight cache library written in Kotlin. mathcamp/fiberglass - Easy lightweight SharedPreferences library fo...
consoleau/kassava - This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. KotlinNLP/SimpleDNN - SimpleDNN is a machine learning lightweight open-source library part of KotlinNLP and has been designed to support relevan...
consoleau/kassava - This library provides some useful kotlin extension functions for implementing toString() and equals() without all of the boilerplate. moove-it/fakeit - Generates realistic fake data — like names, emails, dates, countries — to be used in your Android development environment...