Git Product home page Git Product logo

mvvmarms's Introduction

MVVMArms

Latest Stable Version Build Status Min Sdk Version License

Android MVVM Architecture Components based on MVPArms and Android Architecture Components.

中文

Architecture

Quick Use

Root Gradle

allprojects {
	repositories {
		//...
		maven { url "https://jitpack.io" }
	}
}		

Module Gradle

//mvvmarms
implementation 'me.xiaobailong24.mvvmarms:arms:0.1.0'

//Architecture Components annotation(Lifecycles, LiveData, and ViewModel, Room)
annotationProcessor rootProject.ext.dependencies["lifecycle-compiler"]
annotationProcessor rootProject.ext.dependencies["room-compiler"]
testImplementation(rootProject.ext.dependencies["room-testing"]) {
	exclude module: 'support-compat'
	exclude module: 'support-annotations'
	exclude module: 'support-core-utils'
	exclude module: 'gson'
}

//Dagger annotation
annotationProcessor(rootProject.ext.dependencies["dagger2-compiler"]) {
	exclude module: 'js305'
}
annotationProcessor(rootProject.ext.dependencies["dagger2-android-processor"]) {
	exclude module: 'jsr305'
}

More to see: Demo

Demo

APK

MVVMArms APK

Google Play

Video

MVVMArms demo video

Libraries & References

Update Log

  • Release First Version-0.1.0 - 2017/11/12.
  • RepositoryComponent Provides Cache & RxCache. - 2017/10/11.
  • lifecycle & repository. - 2017/10/01.
  • ArmsFragment Support Lazy load. - 2017/09/24.
  • ViewModel&LiveData Activity share data between fragments, and ViewModel retain data across configuration changes. - 2017/09/23.
  • IRepositoryManager Support RoomDatabase for customization(GlobalConfigModule.Builder) BUT injectRoomDatabase(DBClass) first in ConfigModule#registerComponents(). - 2017/09/22.
  • ArmsUtils to obtain ArmsComponent easily. - 2017/08/23.
  • ImageLoader default Glide. - 2017/08/17.
  • Survives configuration changes for ViewPager using Fragment. - 2017/08/16
  • MVVMArms was BORN!!! - 2017/08/02

Thanks

Thanks to all the authors and organizations that contributed to the open source library!

License

Copyright 2017 xiaobailong24

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.

mvvmarms's People

Contributors

xiaobailong24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvvmarms's Issues

请教关于Model 和ViewModel 注入的疑惑

我的dagger用的不熟,对于项目中 注入 有几个疑问:
1: @module(includes = {ViewModelFactoryModule.class,
WeatherActivityModule.class,
WeatherNowFragmentModule.class,
WeatherDailyFragmentModule.class}) 要像这样在appModule中吧所有的module都写进来嘛

2 mViewModel = ViewModelProviders.of(this, mViewModelFactory).get(WeatherViewModel.class);
viewModel可以通过这种方式创建,为什么还要用dagger注入呢.

另外有没有什么办法 可以减少module的数量啊 实在是太多了..

如果在viewmodel配合rxjava,该如何使用

看了demo,viewmodel是使用livedata的,但是个人觉得livedata远没有rxjava强大。如果在viewmodel使用rxjava,那么该如何实现类似livedata那样的动态更新数据?

这个怎么编译通过的

image
在编译过程中出现问题
image
如果吧把inject(App app) -> inject(Application app),编译通过,但是activityInjector返回为 null。只有把@AppScope改成@singleton,然后同时用inject(App app) 才能运行成功,请问这是为什么呢?

请教一个问题

我的一个UserViewModel 有如下的成员
public final ObservableField mUserViewModel = new ObservableField<>();
public final ObservableField mDis = new ObservableField<>();
public final ObservableInt mCount = new ObservableInt();

和UI双向绑定之后,如果我想修改mDis的数据直接这样
viewModel.mDis.set("dis修改后"); //userViewModel是UserViewModel 类型
这样UI就会自动刷新

如果我想修改mUserViewModel 中的UserBean的数据,修改后UI不会自动刷新
我想到因为UserBean是一个单纯的实体类,所有没有被监听.
如果是让UserBean 去继承BaseObservable,写很多notify则破坏了实体类的单纯性.

不知道有没有什么办法解决这个绑定问题
3KS

最新工程运行,apk 奔溃

Caused by: java.lang.IllegalArgumentException: Unable to find ConfigRepository implementation at me.xiaobailong24.mvvmarms.repository.utils.ManifestRepositoryParser.parseModule(ManifestRepositoryParser.java:53) at me.xiaobailong24.mvvmarms.repository.utils.ManifestRepositoryParser.parse(ManifestRepositoryParser.java:37) at me.xiaobailong24.mvvmarms.repository.RepositoryInjector.<init>(RepositoryInjector.java:28) at me.xiaobailong24.mvvmarms.base.AppDelegate.<init>(AppDelegate.java:41) at me.xiaobailong24.mvvmarms.base.BaseApplication.attachBaseContext(BaseApplication.java:49)

Caused by: java.lang.ClassNotFoundException: me.xiaobailong24.mvvmarms.weather.app.RepositoryConfiguration at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:251) at java.lang.Class.forName(Class.java:216) at me.xiaobailong24.mvvmarms.repository.utils.ManifestRepositoryParser.parseModule(ManifestRepositoryParser.java:51) at me.xiaobailong24.mvvmarms.repository.utils.ManifestRepositoryParser.parse(ManifestRepositoryParser.java:37)  at me.xiaobailong24.mvvmarms.repository.RepositoryInjector.<init>(RepositoryInjector.java:28)  at me.xiaobailong24.mvvmarms.base.AppDelegate.<init>(AppDelegate.java:41)  at me.xiaobailong24.mvvmarms.base.BaseApplication.attachBaseContext(BaseApplication.java:49) 

Discuss

如果有什么想法或者建议,可以随时交流。欢迎大家一起贡献。
Welcome to communicate and discuss.

关于Dagger.Android在项目中的使用

Hello:
最近在再看MVVM架构相关的一些东西,发现MVVMArms中含有Dagger.Android的库,但是里面却没有按照Dagger.Android的推荐方式去使用,是因为封装BaseActivity使用泛型有问题而不继承DaggerActivity的吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.