GreenDao的配置
//project里的设置
repositories {
google()
maven { url "https://jitpack.io" }
maven { url "https://mvnrepository.com" }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.oschina.net/content/groups/public/' }
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
}
//module里的设置
apply plugin: 'org.greenrobot.greendao'
android {
greendao {
//数据库版本号
schemaVersion 1
//生成的DAO,DaoMaster和DaoSession的包路径。默认与表实体所在的包路径相同
daoPackage 'com.example.xts.greendaodemo.db'
//生成源文件的路径。默认源文件目录是在build目录中的(build/generated/source/greendao)
targetGenDir 'src/main/java'
}
}
//greendao数据库依赖
implementation 'org.greenrobot:greendao:3.2.2'
implementation 'org.greenrobot:greendao-generator:3.2.2'
Jsoup html解析
//jsoup
implementation 'org.jsoup:jsoup:1.11.3'
Banner轮播图
implementation'com.youth.banner:banner:1.4.10'//滑动框
Glide图片加载
implementation 'com.github.bumptech.glide:glide:4.9.0' //图片加载框架
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' //图片加载框架注解处理器
fresco图片加载
implementation 'com.facebook.fresco:fresco:2.0.0'//注意版本
SmartRefreshLayout
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-andx-16' //SmartRefreshLayout
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-andx-16'
RecyclerView、XRecyclerView、卡片布局、design
implementation 'com.android.support:recyclerview-v7:28.0.0'//RecyclerView
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'//XRecyclerView
implementation 'com.android.support:cardview-v7:28.0.0'//卡片布局
implementation 'com.android.support:design:28.0.0'//样式 滑动等
Retrofit和RxJava
//Retrofit
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.0'
//RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
纵向TabLayout
implementation 'q.rorbin:VerticalTabLayout:1.2.5'
ButterKnife
implementation 'com.jakewharton:butterknife:8.8.1' //butterknife控件导入框架
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
defaultConfig {
//ButterKnife框架报错解决
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
EventBus
implementation 'org.greenrobot:eventbus:3.1.1'
搜索框
//搜索框
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
日历
//日历
implementation 'com.prolificinteractive:material-calendarview:1.4.3'
粘性头布局
//粘性头布局
implementation 'com.github.qdxxxx:StickyHeaderDecoration:1.0.1'
//在bulid.gradle(project)
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
饺子播放器
implementation 'cn.jzvd:jiaozivideoplayer:6.0.0'//饺子播放器
统一当前Module的所有support包版本
// 统一当前Module的所有support包版本
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '28.0.0'
}
}
}
}
使导入的依赖能通过编译
//加在 compileSdkVersion 28下面
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}