Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Jetpackmvvm | 2,550 | 9 months ago | 11 | apache-2.0 | Kotlin | |||||
:chicken::basketball:一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目 | ||||||||||
Jetpack Mvvm Scaffold | 898 | 2 days ago | 2 | Java | ||||||
人生苦短,让脚手架为你节省时间。(目前作为《最佳实践》项目的 Dev 版优先更新) | ||||||||||
Conference App 2019 | 818 | 4 years ago | 43 | apache-2.0 | Kotlin | |||||
The Official Conference App for DroidKaigi 2019 Tokyo | ||||||||||
Conference App 2020 | 741 | 2 years ago | 39 | apache-2.0 | Kotlin | |||||
The Official Conference App for DroidKaigi 2020 Tokyo | ||||||||||
Newandroidarchitecture Component Github | 228 | 5 years ago | apache-2.0 | Java | ||||||
Sample project based on the new Android Component Architecture | ||||||||||
Aacomponents | 66 | 5 years ago | Java | |||||||
基于google Android Architecture Components 封装实现组件式MVP快速开发框架 | ||||||||||
Archdata | 25 | 4 years ago | mit | Kotlin | ||||||
LiveData types for Publishing and Replaying Data | ||||||||||
Coronavirus Covid 19 Tracker | 20 | 3 years ago | mit | Dart | ||||||
Mapping 2019-nCoV (Official source): https://systems.jhu.edu/research/public-health/ncov/ | ||||||||||
Reactivelivedata | 17 | 5 years ago | apache-2.0 | Kotlin | ||||||
An RxJava Extension for the LiveData observer introduced by Google. | ||||||||||
Quotealot | 14 | 6 years ago | Java | |||||||
Sample application demonstrating use of Architectural components by Google! |
ArchData provides two missing LiveData of Android Lifecycle Component and useful extension functions.
MutableLiveData
shares only last state to its new observers when they start to observe.
But in some cases, either these observers may want to do fresh start or they want to get all previous states.
PublishLiveData
and ReplayLiveData
types are extensions of MutableLiveData.
Basically:
PublishLiveData
is MutableLiveData
, which only notify its observers if there is an event after their starting of observation.ReplayLiveData
is MutableLiveData
, which only notify its observers for all previous events happened before their observation starts.Extension Functions:
nonNullObserve
is extension function, which eliminates nullable invokes of Observer.LiveDataAction:
LiveDataAction
is special object type for LiveData,which enables observer can listen LiveData object without parameter.
It is useful when Action/Command use cases.PublishLiveData
LiveData that, once an Observer
has subscribed, emits all subsequently observed items to the
subscriber.
val liveData = PublishLiveData<String>();
// observer1 will receive all events
liveData.observe(lifeCycleOwner,observer1)
liveData.postValue("one")
liveData.postValue("two")
// observer2 will only receive "three"
liveData.observe(lifeCycleOwner,observer2)
liveData.postValue("three")
ReplayLiveData
LiveData that buffers all items it observes and replays them to any Observer
that subscribes.
val liveData = ReplayLiveData<String>()
liveData.postValue("one")
liveData.postValue("two")
liveData.postValue("three")
// both of the following will get the events from above
liveData.observe(lifeCycleOwner,observer1)
liveData.postValue(lifeCycleOwner,observer2)
nonNullObserve
observe method which eliminates nullable invocation of observers.
val liveData = MutableLiveData<String>()
...
viewModel.liveData.nonNullObserve(lifeCycleOwner,::onLiveDataEvent)
...
fun onLiveDataEvent(event: String){
//Do something good!.
}
LiveDataAction
Object Type which enables invocation listener methods without parameter
val liveData = MutableLiveData<LiveDataAction>()
...
viewModel.liveData.nonNullObserve(lifeCycleOwner,::onLiveDataAction)
...
fun onLiveDataEvent(){
//Do something really good!.
}
Maven:
<dependency>
<groupId>me.ibrahimyilmaz</groupId>
<artifactId>ArchData</artifactId>
<version>0.0.4</version>
<type>pom</type>
</dependency>
Gradle:
compile 'me.ibrahimyilmaz:ArchData:0.0.4'
MIT License
Copyright (c) [2019] [IBRAHIM YILMAZ | [email protected]]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.