All Projects → adrielcafe → AndroidCoroutineScopes

adrielcafe / AndroidCoroutineScopes

Licence: MIT license
This lib implements the most common CoroutineScopes used in Android apps.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to AndroidCoroutineScopes

Kotlin Coroutines Android
Useful extensions for coroutines. AutoDispose + MainScope
Stars: ✭ 77 (+450%)
Mutual labels:  coroutines, kotlin-coroutines
Android Clean Arch Coroutines Koin
Implemented by Clean Architecture, MVVM, Koin, Coroutines, Moshi, Mockk, LiveData & DataBinding
Stars: ✭ 173 (+1135.71%)
Mutual labels:  coroutines, kotlin-coroutines
Androidcoroutinesplayground
Android Coroutines Playground
Stars: ✭ 119 (+750%)
Mutual labels:  coroutines, kotlin-coroutines
Ktx
LibKTX: Kotlin extensions for LibGDX games and applications
Stars: ✭ 913 (+6421.43%)
Mutual labels:  coroutines, kotlin-coroutines
StarWarsSearch-MVI
Star wars sample android project showcasing the use of View components for rendering UI in Fragments and Activities. Uses Android Jetpack, clean architecture with MVI (Uni-directional data flow), dagger hilt, and kotlin coroutines with StateFlow
Stars: ✭ 189 (+1250%)
Mutual labels:  coroutines, kotlin-coroutines
Eyepetizer
🔥基于 Kotlin 语言仿写「开眼 Eyepetizer」的一个短视频 Android 客户端项目,采用 Jetpack + 协程实现的 MVVM 架构。
Stars: ✭ 988 (+6957.14%)
Mutual labels:  coroutines, kotlin-coroutines
Splitties
A collection of hand-crafted extensions for your Kotlin projects.
Stars: ✭ 1,945 (+13792.86%)
Mutual labels:  coroutines, kotlin-coroutines
Coil
Image loading for Android backed by Kotlin Coroutines.
Stars: ✭ 7,469 (+53250%)
Mutual labels:  coroutines, kotlin-coroutines
CoroutineLite
Simple implementation of kotlinx.coroutines to clarify the design of Kotlin Coroutines.
Stars: ✭ 142 (+914.29%)
Mutual labels:  coroutines, kotlin-coroutines
Delish
Delish, a Food Recipes App in Jetpack Compose and Hilt based on modern Android tech-stacks and MVI clean architecture.
Stars: ✭ 356 (+2442.86%)
Mutual labels:  coroutines, kotlin-coroutines
Myweatherkotlinflow
Android app that shows weather at your current location or any custom location you specify. Uses Kotlin Flow for data streaming and coroutines for asynchronous work. Also leverages Room, navigation component, Viewmodel and Livedata Jetpack components with MVVM presentation layer architecture. Dagger 2 with Dagger android for dependency injection
Stars: ✭ 23 (+64.29%)
Mutual labels:  coroutines, kotlin-coroutines
kotlin-coroutines-android
Useful extensions for coroutines. AutoDispose + MainScope
Stars: ✭ 84 (+500%)
Mutual labels:  coroutines, kotlin-coroutines
Kotlin Coroutines Retrofit
Kotlin Coroutines await() extension for Retrofit Call
Stars: ✭ 812 (+5700%)
Mutual labels:  coroutines, kotlin-coroutines
Paperplane
📚 PaperPlane - An Android reading app, including articles from Zhihu Daily, Guokr Handpick and Douban Moment.
Stars: ✭ 1,147 (+8092.86%)
Mutual labels:  coroutines, kotlin-coroutines
Korge
KorGE Game Engine. Multiplatform Kotlin Game Engine
Stars: ✭ 780 (+5471.43%)
Mutual labels:  coroutines, kotlin-coroutines
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (+807.14%)
Mutual labels:  coroutines, kotlin-coroutines
Uniflow Kt
Uniflow 🦄 - Simple Unidirectional Data Flow for Android & Kotlin, using Kotlin coroutines and open to functional programming
Stars: ✭ 414 (+2857.14%)
Mutual labels:  coroutines, kotlin-coroutines
Kotlin Coroutines Android Examples
Learn Kotlin Coroutines for Android by Examples. Learn how to use Kotlin Coroutines for Android App Development.
Stars: ✭ 572 (+3985.71%)
Mutual labels:  coroutines, kotlin-coroutines
the-white-rabbit
The White Rabbit is an asynchronous RabbitMQ (AMQP) client based on Kotlin coroutines
Stars: ✭ 90 (+542.86%)
Mutual labels:  coroutines, kotlin-coroutines
NoMansWallpaperApp
Looking for your next No Man's Sky wallpaper?
Stars: ✭ 35 (+150%)
Mutual labels:  coroutines, kotlin-coroutines

Version Min API Android Arsenal

AndroidCoroutineScopes

Starting from 0.26.0 release we should define a scope for new coroutines (docs).

To avoid this boilerplate code I've created this small library that implements the most common CoroutineScopes used in Android apps.

How to use

Just extend your Activity/Fragment/ViewModel with the corresponding implementation.

// AppCompat scopes
class MyActivity : CoroutineScopedActivity()

class MyFragment : CoroutineScopedFragment()

class MyDialogFragment : CoroutineScopedDialogFragment()

// ViewModel scopes
class MyViewModel : CoroutineScopedViewModel()

class MyAndroidViewModel(app: Application) : CoroutineScopedAndroidViewModel(app)

Example

class MainActivity : CoroutineScopedActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Don't use launch(UI), it's deprecated now
        launch {
            Log.d(TAG, "MAIN THREAD")
            withContext(Dispatchers.Default){
                Log.d(TAG, "OTHER THREAD")
            }
        }
    }

}

Import to your project

// Add JitPack to your repositories if needed
repositories {
	maven { url 'https://jitpack.io' }
}

// AppCompat scopes
implementation 'com.github.adrielcafe.androidcoroutinescopes:appcompat:1.0.1'

// ViewModel scopes
implementation 'com.github.adrielcafe.androidcoroutinescopes:viewmodel:1.0.1'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].