MVVM
Root module, including some common tool classes and base class
GitHub warehouse addresses
introduce
gradle
allprojects {
repositories {
maven {
url 'https://jitpack.io' }
}
}
implementation 'com.github.DL-ZhangTeng:MVVM:2.5.0'
Some tool functions (install the supporting plug-in to quickly create template files BaseLibraryTemplatePlugin-2.5.0.jar)
MVVM toolkit (com/zhangteng/mvvm)
Tool package name/class name | describe |
---|---|
BaseViewModel | VM layer base class with built-in coroutine to request network data |
BaseLoadingViewModel | The VM layer has a loading status base class and a built-in coroutine to request network data. |
BaseStateViewModel | VM layer with network status base class |
BaseRefreshViewModel | VM layer with refresh status base class |
NetState | Is the network OK? |
NetworkStateManager | Observable network states can be |
NetworkStateReceive | Network status broadcast receiver |
MvvmUtils | Get the generic ViewModel-clazz bound to the current class |
databind package | databind basic data types provide default values to avoid having to check for null when taking values. |
livedata package | The basic data type of livedata provides default values to avoid having to check for null when taking the value. |
They are at MvvmActivity | Using the MVVM pattern Activity base class |
BaseListMvvmActivity | Using the MVVM pattern List Activity base class |
They are in MvvmFragment | Using the MVVM pattern Fragment base class |
BaseListMvvmFragment | Using the MVVM Pattern List Fragment Base Class |
They are MviActivity | Using the MVI pattern Activity base class |
BaseListMviActivity | Using the MVI pattern list Activity base class |
They are MviFragment | Using the MVI pattern Fragment base class |
BaseListMviFragment | Using MVI Pattern List Fragment Base Class |
Confuse
-keep public class com.zhangteng.**.*{ *; }
historic version
Version | renew | Update time |
---|---|---|
v2.5.0 | Add dependency injection support | 2023/5/11 at 23:40 |
v2.4.0 | Add MVI mode | 2023/5/2 at 21:54 |
v2.3.0 | Add TabLayout and ViewPager data binding method & optimize Glide loading image binding method | 2022/12/27 at 13:27 |
v2.2.0 | The db template uses BindingAdapter. Because the List template adds VH generics, it is incompatible with previous versions. | 2022/12/5 at 23:30 |
v2.0.1 | Using BaseLibrary2.0.2 | 2022/11/25 at 0:24 |
v2.0.0 | Separate the MVVM library | 2022/9/14 at 23:28 |
Appreciate
If you like MVVM, or feel that MVVM has helped you, you can click "Star" in the upper right corner to support it. Your support is my motivation, thank you.
contact me
Email: [email protected]/[email protected]
License
Copyright © [2020] [Swing]
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.