Wrapperlivedata

使用 kotlin 扩展函数和 typealias 封装 带网络状态和解决「粘性」事件的 LiveData
Alternatives To Wrapperlivedata
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Liveeventbus3,051
2 years ago2May 07, 202190apache-2.0Java
:mailbox_with_mail:EventBus for Android,消息总线,基于LiveData,具有生命周期感知能力,支持Sticky,支持AndroidX,支持跨进程,支持跨APP
Geeknews225
3 years agoKotlin
An MVVM practice app that uses Kotlin, DataBinding, LiveData, ViewModel and Room. The app's data source is from https://gank.io/api
Elegantbus215
17 days agoapache-2.0Java
🔥🔥Android 平台,基于LivaData的EventBus,无侵入,更优雅,支持跨进程,跨应用粘性事件,优先级,自定义事件等功能。
Livedatabinding106
5 years ago2mitKotlin
Kotlin example with LiveData and Data Binding usage
Awesomegithub59
3 years agoapache-2.0Kotlin
🔥Android Github客户端,基于组件化开发,支持账户密码与认证登陆。使用Kotlin语言进行开发,项目架构是基于JetPack&DataBinding的MVVM;项目中使用了Arouter、Retrofit、Coroutine、Glide、Dagger与Hilt等流行开源技术。
Todolistziro52
3 years agoKotlin
ZIRO MEANS ZERO No more cutty commissions On our platform, we don’t charge Captains any per trip commissions—zero. When you drive with us we’re on equal footing, so why should we take away from what you earn? Plus, we have the lowest booking fee compared to those being collected by other ridesharing companies.
Bloglist45
2 years ago52
我的博文列表,按系列分类,方便查找。地址:https://flywith24.gitee.io/
Popularmovies22
3 years agon,ullKotlin
Discover the most popular movies playing with this Android App
Android Links21
2 days agoapache-2.0
Manually curated collection of resources for android developers.
Weathyandroid19
a year ago4Kotlin
웨디의 안드로이드 저장소 ⭐️ 힘차게 가보으자 🚀
Alternatives To Wrapperlivedata
Select To Compare


Alternative Project Comparisons
Readme

  1. build.gradle
allprojects {
  repositories {
    //...
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
   implementation 'com.github.Flywith24:WrapperLiveDataDemo:1.0.2'
 }

Release

  • 1.0.2

  • 1.0.1 onLoading

LiveData

LiveData [] SnackBarNavigation LiveDataSingleLiveEvent

class ListViewModel : ViewModel {
    private val _navigateToDetails = MutableLiveData<Event<String>>()

    val navigateToDetails : LiveData<Event<String>>
        get() = _navigateToDetails


    fun userClicksOnButton(itemId: String) {
        _navigateToDetails.value = Event(itemId)  // Trigger the event by setting a new Event as a new value
    }
}

myViewModel.navigateToDetails.observe(this, Observer {
    it.getContentIfNotHandled()?.let { // Only proceed if the event has never been handled
        startActivity(DetailsActivity...)
    }
})
// LiveData<Event<T>> EventLiveData<T> 
typealias EventMutableLiveData<T> = MutableLiveData<Event<T>>

typealias EventLiveData<T> = LiveData<Event<T>>

typealias

// MutableLiveData<Event<Boolean>>(Event(false))
val eventContent = EventMutableLiveData<Boolean>(Event(false))

kotlin

event

demo LiveData LiveData<Boolean> EventLiveData<Boolean> onChanged Toast

java

typealias +

typealias

demo

demo

Demo

demo

Fly_with24

Popular Livedata Projects
Popular Gradle Projects
Popular User Interface Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Kotlin
Gradle
Navigation
Android Studio
Toast
Livedata