瀏覽代碼

Update gradle version to 7.2

zhpanvip 2 年之前
父節點
當前提交
ac87d356b6

+ 68 - 69
app/build.gradle

@@ -1,85 +1,84 @@
 apply plugin: 'com.android.application'
 apply plugin: 'kotlin-android'
 android {
-    compileSdkVersion 30
-    buildToolsVersion '28.0.3'
-    defaultConfig {
-        applicationId "com.example.zhpan.bannerviewpager"
-        minSdkVersion 21
-        targetSdkVersion 30
-        versionCode 1
-        versionName "3.5.2"
-        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-    }
-    buildTypes {
-        release {
-            debuggable false
-            minifyEnabled true
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
+  compileSdkVersion 33
+  defaultConfig {
+    applicationId "com.example.zhpan.bannerviewpager"
+    minSdkVersion 21
+    targetSdkVersion 33
+    versionCode 2
+    versionName "3.5.10"
+    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+  }
+  buildTypes {
+    release {
+      debuggable false
+      minifyEnabled true
+      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
+  }
 
-    sourceSets {
-        main {
-            jniLibs.srcDirs = ['libs']
-        }
+  sourceSets {
+    main {
+      jniLibs.srcDirs = ['libs']
     }
+  }
 
-    compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
-    }
+  compileOptions {
+    sourceCompatibility JavaVersion.VERSION_1_8
+    targetCompatibility JavaVersion.VERSION_1_8
+  }
 
-    viewBinding {
-        enabled = true
-    }
-    dataBinding {
-        //noinspection DataBindingWithoutKapt
-        enabled = true
-    }
+  viewBinding {
+    enabled = true
+  }
+  dataBinding {
+    //noinspection DataBindingWithoutKapt
+    enabled = true
+  }
 }
 
 repositories {
-    flatDir {
-        dirs 'libs'
-    }
+  flatDir {
+    dirs 'libs'
+  }
 }
 
 dependencies {
-    implementation fileTree(include: ['*.jar'], dir: 'libs')
-    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
-    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
-    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
-        exclude group: 'com.android.support', module: 'support-annotations'
-    })
-    implementation "io.reactivex.rxjava2:rxjava:$rootProject.ext.rxjava2Version"
-    implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit2Version"
-    implementation "com.squareup.retrofit2:converter-scalars:$rootProject.ext.retrofit2Version"
-    implementation "com.squareup.retrofit2:converter-gson:$rootProject.ext.retrofit2Version"
-    implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.ext.retrofit2Version"
-    implementation "com.trello.rxlifecycle2:rxlifecycle:$rootProject.ext.rxlifecycle"
-    implementation "com.trello.rxlifecycle2:rxlifecycle-components:$rootProject.ext.rxlifecycle"
-    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
-    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
-    implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1'
+  implementation fileTree(include: ['*.jar'], dir: 'libs')
+  implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+  implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+  androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
+    exclude group: 'com.android.support', module: 'support-annotations'
+  })
+  implementation "io.reactivex.rxjava2:rxjava:$rootProject.ext.rxjava2Version"
+  implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit2Version"
+  implementation "com.squareup.retrofit2:converter-scalars:$rootProject.ext.retrofit2Version"
+  implementation "com.squareup.retrofit2:converter-gson:$rootProject.ext.retrofit2Version"
+  implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.ext.retrofit2Version"
+  implementation "com.trello.rxlifecycle2:rxlifecycle:$rootProject.ext.rxlifecycle"
+  implementation "com.trello.rxlifecycle2:rxlifecycle-components:$rootProject.ext.rxlifecycle"
+  implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
+  implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
+  implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1'
 
-    implementation 'androidx.appcompat:appcompat:1.3.0'
-    implementation 'androidx.recyclerview:recyclerview:1.2.1'
-    implementation 'com.github.bumptech.glide:glide:4.11.0'
-    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
-    implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
-    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3'
-    implementation 'androidx.core:core-ktx:1.6.0'
-    implementation 'androidx.cardview:cardview:1.0.0'
-    implementation 'androidx.viewpager2:viewpager2:1.0.0'
-    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
-    implementation 'com.google.android.material:material:1.3.0'
-    implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
-    implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
-    implementation 'com.tencent.bugly:crashreport:3.2.1'
-    implementation 'com.google.android.material:material:1.3.0'
-    implementation 'com.blankj:utilcodex:1.30.6'
-    implementation 'com.airbnb.android:lottie:3.4.1'
-//    implementation 'com.github.zhpanvip:bannerviewpager:3.5.6'
-    implementation project(path: ':bannerview')
+  implementation 'androidx.appcompat:appcompat:1.3.0'
+  implementation 'androidx.recyclerview:recyclerview:1.2.1'
+  implementation 'com.github.bumptech.glide:glide:4.11.0'
+  implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
+  implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
+  debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
+  implementation 'androidx.core:core-ktx:1.6.0'
+  implementation 'androidx.cardview:cardview:1.0.0'
+  implementation 'androidx.viewpager2:viewpager2:1.0.0'
+  implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
+  implementation 'com.google.android.material:material:1.3.0'
+  implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
+  implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
+  implementation 'com.tencent.bugly:crashreport:3.2.1'
+  implementation 'com.google.android.material:material:1.3.0'
+  implementation 'com.blankj:utilcodex:1.30.6'
+  implementation 'com.airbnb.android:lottie:3.4.1'
+  //    implementation 'com.github.zhpanvip:bannerviewpager:3.5.6'
+  implementation project(path: ':bannerview')
 }

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -16,6 +16,7 @@
         android:theme="@style/AppTheme">
         <activity
             android:name="com.example.zhpan.banner.activity.WelcomeActivity"
+            android:exported="true"
             android:theme="@style/FullScreenTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />

+ 0 - 1
bannerview/build.gradle

@@ -1,5 +1,4 @@
 apply plugin: 'com.android.library'
-apply plugin: 'com.github.dcendents.android-maven'
 apply plugin: 'kotlin-android'
 android {
     compileSdkVersion 28

+ 1 - 1
bannerview/src/main/java/com/zhpan/bannerview/BaseBannerAdapter.java

@@ -108,7 +108,7 @@ public abstract class BaseBannerAdapter<T> extends RecyclerView.Adapter<BaseView
   }
 
   /**
-   * Generally,there is no need to override this method in subclasses.
+   * Generally,subclasses do not need to override this method,Unless you want to use a custom ViewHolder.
    *
    * This method called by {@link #onCreateViewHolder(ViewGroup, int)} to create a default {@link
    * BaseViewHolder}

+ 2 - 2
build.gradle

@@ -1,14 +1,14 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 
 buildscript {
-    ext.kotlin_version = '1.5.0'
+    ext.kotlin_version = '1.7.20'
     repositories {
         jcenter()
         mavenCentral()
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:4.2.1'
+        classpath 'com.android.tools.build:gradle:7.1.2'
         classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
 //        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip