Coder Social home page Coder Social logo

vlibrary's Introduction

VLibrary

介绍

  • 基于MVVM模式组件化集成谷歌官方推荐的JetPack组件库:DataBinding、LiveData、ViewModel、Lifecycle组件
  • 使用kotlin语言,添加大量拓展函数,简化代码
  • 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速请求网络
  • 封装Base类,添加常用工具类

搭配代码模板插件VLibraryPlugin使用开发效率翻倍 ❗ ❗

使用集成

  • 1. 在root build.gradle中加入Jitpack仓库
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  • 2. 在app build.gradle中添加依赖
dependencies {
  ...
  implementation 'com.github.oooo7777777:VLibrary:latestVersion'
}
  • 3. 在app build.gradle中,android 模块下开启DataBinding

android {
    ...
   buildFeatures {
        dataBinding = true
    }
}
 
  • 4. 继承VBApplication
open class *** : VBApplication() {

}
  • 5. 设置AndroidManifest.xml主题
 android:theme="@style/vb_app_theme"

使用文档

具体使用方法以及属性内容请查看wiki

重要的事情说3遍!!!

proguard-rules.pro

此资源库自带混淆规则,并且会自动导入,正常情况下无需手动导入,仅限于3.3.3版本及以上版本。 3.3.3之前请自行添加以下混淆代码

#ViewDataBinding
-keep public class * extends androidx.databinding.ViewDataBinding { *; }

#Lifecycle
-keep public class * extends androidx.lifecycle.ViewModel { *; }

#枚举
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

#glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
 <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
  *** rewind();
}

#Retrofit
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keepattributes AnnotationDefault
-keepclassmembers,allowshrinking,allowobfuscation interface * {
    @retrofit2.http.* <methods>;
}
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn javax.annotation.**
-dontwarn kotlin.Unit
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

#fastjson.
-dontwarn com.alibaba.fastjson.**
-keep class com.alibaba.fastjson.**{*;}
#kotlin data class
-keepattributes *Annotation*
-keep class kotlin.** { *; }
-keep class org.jetbrains.** { *; }

#实体类
-dontwarn **.*bean*.**
-keep class **.*bean*.** { *;}
-keep public class * extends com.v.base.bean.VBApiResponse { *; }
-keep public class * extends com.v.base.bean.VBResponse { *; }

#BaseRecyclerViewAdapterHelper
-keep public class * extends com.chad.library.adapter.base.viewholder.BaseViewHolder{
 <init>(...);
}
-keepclassmembers  class **$** extends com.chad.library.adapter.base.viewholder.BaseViewHolder {
     <init>(...);
}

vlibrary's People

Contributors

oooo7777777 avatar

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.