What kind of framework is right for you? No framework is likely to work for you.


Just like you and me, we all went from no-architecture to MVC-> modularity ->MVP-> MVVM->AAC-> componentized AAC.

Many times, I have been thinking, do we really need to design too much? Now, some of you will like basevmfragmodel, but there will be times when do we really need a ViewModel? Do we really only have one ViewModel? I probably don’t want to write about it, so with these questions in mind, in 2020, WHAT kind of architecture is best for us? Suitable for all types of people? I couldn’t figure it out, so I left it up to you to choose, and I put some of the ideas from the process together in code here to provide you with ideas. This is CloudAAC, simplifying complexity, a simple modular framework.

github:Github.com/Petterpx/Cl…

How to use it?

Import dependence

allprojects {
    repositories {
        maven { url 'https://jitpack.io'}}}Copy the code
implementation 'com. Making. Petterpx. CloudAAC: core: v1.0.3' 
Copy the code

CloudAAC has imported the following components:

/ / a very good implementation status bar processing tools' com. Gyf. Immersionbar: immersionbar: 3.0.0 'implementation 'com. Gyf. Immersionbar: immersionbar - KTX: 3.0.0' / / Android - KTX extension related implementation 'androidx. Activity: the activity: 1.1.0' Implementation 'androidx. Fragments: fragments - KTX: 1.2.5' / / viewModel data recovery implementation "Androidx. Lifecycle: lifecycle - viewmodel - savedstate: 2.2.0." "Copy the code

Extension support

The Core module only provides the core base class, and the choice leaves it up to you to actively modify it. CloudAAC supports the following modules for greater ease of use.

implementation 'com. Making. Petterpx. CloudAAC: databing_ktx: v1.0.3' 
implementation 'com. Making. Petterpx. CloudAAC: viewbing_ktx: v1.0.3' 
implementation 'com. Making. Petterpx. CloudAAC: tab_ktx: v1.0.3' 
Copy the code


Core class interpretation

Core

Base class.

  • BaseActivity —- Base BaseActivity class
  • BaseFragment —- Basic BaseFragment class
  • . Other related tools


Databing_ktx

Generic Activity && Fragment for Databinding.

Note: Use binding with caution. Do not use binding when it is not necessary to avoid view inconsistency.

  • BaseDataBingActivity – Activity – DataBing extension
  • BaseDataBingFragment – fragments – DataBing extension
  • DataBingdinConfig —- DataBing configuration related (reference from KunMinx)


ViewBing_ktx

Generic Activity && Fragment for ViewBing.

  • BaseViewBingActivity – Activity – ViewBing extension

  • BaseViewBingFragment – fragments – ViewBing extension

  • BaseViewBingVMActivity<VM,Bing>

    The Activity-ViewBing extension includes a default viewModel delegate to use

  • BaseViewBingVMFragment<VM,Bing>

    Fragment-ViewBing extension that includes the default viewModel delegate to use


Tab_ktx (still being optimized)

Extension for home TAB.

  • base
    • BasePagerAdapter
    • BaseTabActivity
  • . Other related tools

.ktx

More extensions are on the way. CloudAAC uses extensions and combinations as much as possible to cater to different needs of different people. Of course, if you have a better idea, PR is welcome.




The more you know, the more you don’t know. It is not recommended that you build wheels frequently, but I hope that you have the idea of modifying wheels. The structure of the CloudAAC code is clear, and the comments and boundaries are noted. I hope it will be helpful for you.