current position:Home>Android component dependency library, base library, network, UI, photo album, photo taking, code scanning, jsbridgewebview and other libraries are introduced with one click

Android component dependency library, base library, network, UI, photo album, photo taking, code scanning, jsbridgewebview and other libraries are introduced with one click

2022-06-23 23:32:13MirkoWug

MVM

MVM github Address
MVM- Third party Integration github Address

Preface

M:Model The data layer
V:View According to layer
M:Mediator Middle layer

Whether it's MVP Medium Presenter still MVVM Medium ViewModel They are essentially equivalent to the nature of intermediaries , Is the connection Model Layer and the View Media of layer .
The middle tier holds Model and View, We are on the middle floor obtain Model Layer instance to get data , Then it is passed to by callback View layer , The callback here is no matter
Interface callback , still Observer Wait for observer mode , Data binding ,EventBus And so on , Its essence is to transfer data to View layer , In this regard, whether it is MVP、
MVVM Or derived variants, whose behavioral purposes are the same .
However, due to the preservation of data , Processing mode , Status and update of the m-server UI Different ways , To evolve these architectures .

Use

rely on jitpack

maven { url 'https://jitpack.io' }

from v1.1.0 rise mvm Kuba before lib_stat、lib_bugly、lib_crash The sub library is split into mvm-thirdparty Warehouse ,mvm Only the commonly used dependency libraries for development are reserved
// You can use it directly

        implementation 'com.github.mirkowu:mvm:$ext.mvm_version' //mvm General warehouse 

        implementation("com.github.mirkowu:mvm-thirdparty:$ext.mvm_thirdparty_version") { //mvm-thirdparty General warehouse 
            exclude group: "com.github.mirkowu.mvm", module: "lib_crash" //bugly  Upgrade not included SDK  A choice 
            //exclude group: "com.github.mirkowu.mvm", module: "lib_bugly" //bugly  Includes upgrades SDK  A choice 
        }

// You can also ask for it on demand , There are dependencies between some libraries , Please rely on

    implementation "com.github.mirkowu.mvm:lib_base:$ext.mvm_version" // Base library 
    implementation "com.github.mirkowu.mvm:lib_widget:$ext.mvm_version" //UI Component library 
    implementation "com.github.mirkowu.mvm:lib_network:$ext.mvm_version" // The network library 
    implementation "com.github.mirkowu.mvm:lib_util:$ext.mvm_version" // Tool library 
    implementation "com.github.mirkowu.mvm:lib_image:$ext.mvm_version" // Image loading Library ( Default glide)
    implementation "com.github.mirkowu.mvm:lib_webview:$ext.mvm_version" //X5 + JsBridge  Of WebView
    implementation "com.github.mirkowu.mvm:lib_photo:$ext.mvm_version" // Album selection Library 
    implementation "com.github.mirkowu.mvm:lib_qrcode:$ext.mvm_version" // QR code scanning 
    implementation "com.github.mirkowu.mvm:lib_camera:$ext.mvm_version" // camera 
    implementation "com.github.mirkowu.mvm:lib_upgrade:$ext.mvm_version" // Version update ( Pop up and download installation functions )
    implementation "com.github.mirkowu.mvm:lib_screen:$ext.mvm_version" // Screen adaptation 

    implementation "com.github.mirkowu.mvm-thirdparty:lib_umeng:$ext.mvm_thirdparty_version" //umeng Statistics 
    implementation "com.github.mirkowu.mvm-thirdparty:lib_bugly:$ext.mvm_thirdparty_version" //bugly  Includes upgrades SDK  A choice 
//        implementation "com.github.mirkowu.mvm-thirdparty:lib_crash:$ext.mvm_thirdparty_version" //bugly  Upgrade not included SDK  A choice 

You can Application Of onCreate() To perform the corresponding initialization

       LogUtil.init(BuildConfig.DEBUG);

       WebViewUtil.initMultiProcess(this);

        // Replace it with your own bugly account number   According to the official SDK docking , This is just a demonstration 
        BuglyManager.init(this, "buglyId", BuildConfig.DEBUG);

      /***  Prevent multiple initializations , Set according to the project  *  A method that requires multi process initialization. This method is preceded by   Those that do not need multi process processing are put behind  */
       if (!ProcessUtils.isMainProcess()) {
    
            return;
       }



        //umeng  According to the official SDK docking , This is just a demonstration 
        UmengManager.preInit(this, "id", "umeng", BuildConfig.DEBUG);
        UmengManager.init(this, null);

        // Screen adaptation 
        AutoSizeManager.getInstance().setConfig(this);

        //RxJava2  After unsubscribing , The exception thrown cannot be caught , Cause the program to crash 
        RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
    
            @Override
            public void accept(Throwable throwable) throws Throwable {
    
                LogUtil.e(throwable, "RxJavaPlugins");
            }
        });

Base Component library functions

Widget Component library functions

Network Component library functions

Util Component library functions

Image Component library functions

WebView Component library functions

Photo Component library functions

QRCode Component library functions

Camerax Component library functions

Upgrade Component library functions

Screen Component library functions

Umeng Component library functions

Bugly Component library functions

Crash Component library functions

Update log

2022-06-17 v1.1.0
    1. take lib_qr  Renamed as lib_qrcode
    2. take lib_stat  Renamed as lib_umeng
    3. take lib_stat、lib_bugly、lib_crash  Split to mvm-thirdparty  Warehouse 

copyright notice
author[MirkoWug],Please bring the original link to reprint, thank you.
https://en.hqmana.com/2022/174/202206232008324950.html