All Projects → AgustaRC → Mvvmarchitecture

AgustaRC / Mvvmarchitecture

Licence: apache-2.0
An example Android app using Retrofit, Room, LiveData, RxJava2, Paging, Koin and the MVVM pattern with the databinding

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Mvvmarchitecture

Android Jetpack Demo
🔥 快速入门Android Jetpack以及相关Kotlin、RxJava、MVVM等主流技术,独立构架App的基础技能
Stars: ✭ 335 (+109.38%)
Mutual labels:  lifecycle, mvvm, room, livedata
Easychatandroidclient
EasyChat是一个开源的社交类的App。主要包含消息、好友、群组等相关的IM核心功能。部分界面参照了QQ、微信等相关社交APP。EasyChat APP整体采用MVVM模式,基于JetPack(Lifecycle,LiveData,ViewModel,Room)构建
Stars: ✭ 64 (-60%)
Mutual labels:  lifecycle, mvvm, room, livedata
Mvvmframe
🏰 MVVMFrame for Android 是一个基于Google官方推出的Architecture Components dependencies(现在叫JetPack){ Lifecycle,LiveData,ViewModel,Room } 构建的快速开发框架。有了MVVMFrame的加持,从此构建一个MVVM模式的项目变得快捷简单。
Stars: ✭ 218 (+36.25%)
Mutual labels:  lifecycle, mvvm, room, livedata
Mvvmarms
Android MVVM Architecture Components based on MVPArms and Android Architecture Components.
Stars: ✭ 425 (+165.63%)
Mutual labels:  lifecycle, mvvm, room, livedata
Tdcapp
Sample app which access the TDC (The Developer's Conference) REST API.
Stars: ✭ 55 (-65.62%)
Mutual labels:  lifecycle, mvvm, room, livedata
Harrypotter
🧙🏻 Sample HarryPotter application based on MVVM architecture (ViewModel, LiveData, Repository, Coroutines, Koin or Dagger-Hilt)
Stars: ✭ 116 (-27.5%)
Mutual labels:  lifecycle, mvvm, livedata
Reactive Mvvm Android
My way to MVVM using KotlinX Coroutines and Android data-binding
Stars: ✭ 626 (+291.25%)
Mutual labels:  mvvm, room, livedata
Offlinesampleapp
Sample Offline-First MVVM app that uses Android Priority Job Queue, Room, Retrofit2, LiveData, LifecycleObserver, RxJava2, Dagger Android
Stars: ✭ 653 (+308.13%)
Mutual labels:  mvvm, room, livedata
Wanandroid
Jetpack MVVM For Wanandroid 最佳实践 !
Stars: ✭ 1,004 (+527.5%)
Mutual labels:  lifecycle, mvvm, livedata
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-88.75%)
Mutual labels:  mvvm, room, livedata
Newssync
Sample application with MVVM pattern using RxJava and Architecture Components
Stars: ✭ 46 (-71.25%)
Mutual labels:  mvvm, room, livedata
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (+156.25%)
Mutual labels:  mvvm, room, livedata
Mvvmsmart
基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合ViewModel+Lifecycles+Navigation+DataBinding+LiveData+Okhttp+Retrofit+RxJava+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发高质量、易维护的Android应用。 项目组会持续维护,请放心使用.欢迎Start并Fork交流.
Stars: ✭ 382 (+138.75%)
Mutual labels:  mvvm, room, livedata
Jetpack Wanandroid
Kotlin+Jetpack+Coroutines+Retrofit+koin 完成的MVVM 组件化客户端 🔥🔥
Stars: ✭ 353 (+120.63%)
Mutual labels:  mvvm, room, livedata
Jetpackmvvm
🐔🏀一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目
Stars: ✭ 1,100 (+587.5%)
Mutual labels:  lifecycle, mvvm, livedata
Android Clean Architecture Mvvm Dagger Rx
Implemented by Clean Architecture, Dagger2, MVVM, LiveData, RX, Retrofit2, Room, Anko
Stars: ✭ 138 (-13.75%)
Mutual labels:  mvvm, room, livedata
Androidroom
Android example to show how to use Room to access SQLite database on device for reading and writing data. This example also shows how to use LiveData and ViewModel with Room to build reactive, well performing and easy to maintain applications.
Stars: ✭ 36 (-77.5%)
Mutual labels:  mvvm, room, livedata
DeezerClone
This Application using Dagger Hilt, Coroutines, Flow, Jetpack (Room, ViewModel, LiveData),Navigation based on MVVM architecture.
Stars: ✭ 81 (-49.37%)
Mutual labels:  room, mvvm, livedata
AndroidGo
Android、Flutter 开发者帮助 APP。包含事件分发、性能分析、Google Jetpack组件、OkHttp、RxJava、Retrofit、Volley、Canvas绘制以及优秀博文代码案例等内容,帮助开发者快速上手!
Stars: ✭ 30 (-81.25%)
Mutual labels:  mvvm, lifecycle, livedata
Foodium
It simply loads Posts data from API and stores it in persistence storage (i.e. SQLite Database). Posts will be always loaded from local database. Remote data (from API) and Local data is always synchronized.
Stars: ✭ 1,940 (+1112.5%)
Mutual labels:  mvvm, room, livedata

MVVMArchitecture

License Platform

My way to MVVM pattern using RxJava, LiveData, Room, Paging with the Android databinding

What is MVVM pattern?

MVVM is an architectural pattern that was created to simplify user interface programming. Google appears to be encouraging the use of MVVM for data binding. In fact, the Architecture Components of its Data Binding Library are modeled on the MVVM pattern.


Samples

Activity Layout File

    <data>
        <variable name="vm" type="com.leopold.mvvm.viewmodel.search.SearchViewModel"/>
    </data>
    
    <androidx.appcompat.widget.AppCompatImageButton
        android:id="@+id/search_button"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:src="@drawable/ic_search"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:onClick="@{() -> vm.search()}"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toRightOf="@+id/search_edit"/>

Set Up the ViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val binding = DataBindingUtil.setContentView<ActivitySearchBinding>(this, R.layout.activity_search)
        binding.vm = getViewModel()
        binding.setLifecycleOwner(this)
    }

RecyclerView Adapter Item Layout File

    <data>
        <variable name="item" type="com.leopold.mvvm.data.remote.domain.Repository"/>
        <variable name="vm" type="com.leopold.mvvm.viewmodel.search.SearchViewModel"/>
    </data>
    
    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/repository_item_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="6dp"
        android:text="@{item.name}"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"/>

DataBinding in ViewHolder

    override fun onBindViewHolder(holder: RepositoryViewHolder, position: Int) {
        holder.binding.item = items[position]
        holder.binding.vm = vm
    }
    
    class RepositoryViewHolder(view: View) : RecyclerView.ViewHolder(view) {
        val binding: LayoutRepositoryItemBinding = LayoutRepositoryItemBinding.bind(view)
    }

Libraries

Android Jetpack

  • DataBinding Declaratively bind observable data to UI elements.

  • Lifecycle Create a UI that automatically responds to lifecycle events.

  • LiveData Build data objects that notify views when the underlying database changes.

  • ViewModel Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.

  • Room Access your app's SQLite database with in-app objects and compile-time checks.

  • Paging Makes it easier for you to load data gradually and gracefully within your app's RecyclerView.

HTTP

  • Retrofit2 Type-safe HTTP client for Android and Java by Square, Inc.

  • OkHttp An HTTP+HTTP/2 client for Android and Java applications.

ReactiveX

  • RxJava2 A library for composing asynchronous and event-based programs using observable sequences for the Java VM

  • RxAndroid RxJava bindings for Android

DI

  • Koin A pragmatic lightweight dependency injection framework for Kotlin developers.

References


License

Copyright 2018 Leopold Baik

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].