diff --git a/app/build.gradle b/app/build.gradle index 800694987..2e6627ab1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.caincamera' defaultConfig { applicationId "com.cgfay.caincamera" - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 2 versionName "1.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -49,13 +50,13 @@ dependencies { implementation project(':medialibrary') implementation project(':utilslibrary') implementation project(':videolibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'com.google.android.material:material:1.2.1' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'com.github.bumptech.glide:glide:4.11.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}" // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/build.gradle b/build.gradle index aaa9a03dd..ae5a87501 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply from: "versions.gradle" buildscript { repositories { @@ -6,7 +7,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' + // Updated to support compileSdk 35 + classpath 'com.android.tools.build:gradle:8.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/cameralibrary/build.gradle b/cameralibrary/build.gradle index 8d7db2e19..fb4ffccd7 100644 --- a/cameralibrary/build.gradle +++ b/cameralibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.cameralibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -33,8 +34,8 @@ android { } } -def camerax_version = "1.0.0-rc03" -def lifecycle_version = '2.2.0' +def camerax_version = rootProject.ext.cameraXVersion +def lifecycle_version = rootProject.ext.lifecycleVersion dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') @@ -50,11 +51,11 @@ dependencies { implementation project(':widgetlibrary') // AndroidX libraries - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'com.google.android.material:material:1.2.1' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.legacy:legacy-support-v4:${rootProject.ext.legacySupportVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" // Lifecycle and LiveData implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version" @@ -70,9 +71,9 @@ dependencies { implementation "androidx.camera:camera-lifecycle:$camerax_version" // Glide - implementation 'com.github.bumptech.glide:glide:4.11.0' + implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}" - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/facedetectlibrary/build.gradle b/facedetectlibrary/build.gradle index 8e6327d2c..183b3fa39 100644 --- a/facedetectlibrary/build.gradle +++ b/facedetectlibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.facedetectlibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -39,10 +40,10 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation project(':landmarklibrary') implementation project(':utilslibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" implementation(name: 'MGFaceppSDK-0.5.2', ext: 'aar') implementation(name: 'MGLicenseManagerSDK-0.3.1', ext: 'aar') } diff --git a/filterlibrary/build.gradle b/filterlibrary/build.gradle index a9d8e5674..cd02df832 100644 --- a/filterlibrary/build.gradle +++ b/filterlibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.filterlibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -50,10 +51,10 @@ dependencies { implementation project(':landmarklibrary') implementation project(':utilslibrary') implementation project(':gdxlibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.legacy:legacy-support-v4:${rootProject.ext.legacySupportVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/gdxlibrary/build.gradle b/gdxlibrary/build.gradle index ef91c2bff..b3201437c 100644 --- a/gdxlibrary/build.gradle +++ b/gdxlibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.badlogic.gdx' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -48,8 +49,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.2.0' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/gradle.properties b/gradle.properties index b36ec8d25..76e3d0955 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,9 @@ android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m android.injected.testOnly=false +# Include resources from dependent modules in generated R classes +android.nonTransitiveRClass=false +android.nonFinalResIds=false # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9436fb3ac..9353cc3a6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue May 04 22:45:29 CST 2021 +#Thu Jul 24 10:32:48 CST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/imagelibrary/build.gradle b/imagelibrary/build.gradle index 77e2b24d9..f79c30733 100644 --- a/imagelibrary/build.gradle +++ b/imagelibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.imagelibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -31,11 +32,11 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':utilslibrary') implementation project(':filterlibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.legacy:legacy-support-v4:${rootProject.ext.legacySupportVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/imagelibrary/src/main/java/com/cgfay/image/fragment/ImageEditedFragment.java b/imagelibrary/src/main/java/com/cgfay/image/fragment/ImageEditedFragment.java index 437d2a10d..89e770cae 100644 --- a/imagelibrary/src/main/java/com/cgfay/image/fragment/ImageEditedFragment.java +++ b/imagelibrary/src/main/java/com/cgfay/image/fragment/ImageEditedFragment.java @@ -334,7 +334,7 @@ public void setImagePath(String path, boolean deleteInputFile) { */ private void requestStoragePermission() { if (shouldShowRequestPermissionRationale(Manifest.permission.READ_EXTERNAL_STORAGE)) { - PermissionConfirmDialogFragment.newInstance(getString(R.string.request_storage_permission), PermissionUtils.REQUEST_STORAGE_PERMISSION) + PermissionConfirmDialogFragment.newInstance(getString(com.cgfay.utilslibrary.R.string.request_storage_permission), PermissionUtils.REQUEST_STORAGE_PERMISSION) .show(getChildFragmentManager(), FRAGMENT_DIALOG); } else { requestPermissions(new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE}, @@ -346,7 +346,7 @@ private void requestStoragePermission() { public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PermissionUtils.REQUEST_STORAGE_PERMISSION) { if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) { - PermissionErrorDialogFragment.newInstance(getString(R.string.request_storage_permission), PermissionUtils.REQUEST_STORAGE_PERMISSION, true) + PermissionErrorDialogFragment.newInstance(getString(com.cgfay.utilslibrary.R.string.request_storage_permission), PermissionUtils.REQUEST_STORAGE_PERMISSION, true) .show(getChildFragmentManager(), FRAGMENT_DIALOG); } else { mStorageWriteEnable = true; diff --git a/imagelibrary/src/main/java/com/cgfay/image/widget/CropCoverView.java b/imagelibrary/src/main/java/com/cgfay/image/widget/CropCoverView.java index 00e195c58..1a4b0049c 100644 --- a/imagelibrary/src/main/java/com/cgfay/image/widget/CropCoverView.java +++ b/imagelibrary/src/main/java/com/cgfay/image/widget/CropCoverView.java @@ -10,6 +10,7 @@ import com.cgfay.imagelibrary.R; + /** * 裁剪遮罩视图 * Created by cain.huang on 2017/12/28. @@ -72,8 +73,8 @@ public CropCoverView(Context context) { } private void init() { - mStrokeWidth = (int) getResources().getDimension(R.dimen.dp3); - mStrokeWidthNew = (int) getResources().getDimension(R.dimen.dp1); + mStrokeWidth = (int) getResources().getDimension(com.cgfay.utilslibrary.R.dimen.dp3); + mStrokeWidthNew = (int) getResources().getDimension(com.cgfay.utilslibrary.R.dimen.dp1); mPaint = new Paint(); mPaint.setAntiAlias(true); diff --git a/imagelibrary/src/main/java/com/cgfay/image/widget/GraffitiView.java b/imagelibrary/src/main/java/com/cgfay/image/widget/GraffitiView.java index ee300c2d2..b2097e7da 100644 --- a/imagelibrary/src/main/java/com/cgfay/image/widget/GraffitiView.java +++ b/imagelibrary/src/main/java/com/cgfay/image/widget/GraffitiView.java @@ -78,7 +78,7 @@ public Paint newPaint(int color) { Paint paint = new Paint(); paint.setAntiAlias(true); - paint.setStrokeWidth(getResources().getDimension(R.dimen.dp3)); + paint.setStrokeWidth(getResources().getDimension(com.cgfay.utilslibrary.R.dimen.dp3)); paint.setStyle(Paint.Style.STROKE); paint.setStrokeJoin(Paint.Join.ROUND); paint.setStrokeCap(Paint.Cap.ROUND); diff --git a/landmarklibrary/build.gradle b/landmarklibrary/build.gradle index 2234502f6..20bc0c0aa 100644 --- a/landmarklibrary/build.gradle +++ b/landmarklibrary/build.gradle @@ -1,13 +1,14 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.landmarklibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -30,8 +31,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.2.0' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/medialibrary/build.gradle b/medialibrary/build.gradle index c5563eab2..55b5650b0 100644 --- a/medialibrary/build.gradle +++ b/medialibrary/build.gradle @@ -1,16 +1,17 @@ apply plugin: 'com.android.library' //def platformVersion = 24 // openGLES 3.2 min api level -def platformVersion = 21 // 18: openGLES 3 min api level +def platformVersion = rootProject.ext.minSdkVersion // 18: openGLES 3 min api level // def platformVersion = 12 //openGLES 2 min api level android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.media' defaultConfig { minSdkVersion "${platformVersion}" - targetSdkVersion 30 + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -64,9 +65,9 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':utilslibrary') implementation project(':filterlibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } \ No newline at end of file diff --git a/pickerlibrary/build.gradle b/pickerlibrary/build.gradle index 8b10a8ee8..9214528ce 100644 --- a/pickerlibrary/build.gradle +++ b/pickerlibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.scan' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -25,19 +26,22 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + buildFeatures { + buildConfig true + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':utilslibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.1' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'io.reactivex.rxjava2:rxjava:2.2.10' - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' - implementation 'com.github.bumptech.glide:glide:4.11.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "io.reactivex.rxjava2:rxjava:${rootProject.ext.rxJavaVersion}" + implementation "io.reactivex.rxjava2:rxandroid:${rootProject.ext.rxAndroidVersion}" + implementation "com.github.bumptech.glide:glide:${rootProject.ext.glideVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/pickerlibrary/src/main/java/com/cgfay/picker/adapter/AlbumDataAdapter.java b/pickerlibrary/src/main/java/com/cgfay/picker/adapter/AlbumDataAdapter.java index 6a5ba45f5..c8a020c5d 100644 --- a/pickerlibrary/src/main/java/com/cgfay/picker/adapter/AlbumDataAdapter.java +++ b/pickerlibrary/src/main/java/com/cgfay/picker/adapter/AlbumDataAdapter.java @@ -10,6 +10,7 @@ import com.cgfay.picker.MediaPickerManager; import com.cgfay.scan.R; + import com.cgfay.picker.model.AlbumData; import java.util.ArrayList; @@ -44,7 +45,9 @@ public void onBindViewHolder(@NonNull AlbumViewHolder holder, int position) { holder.mAlbumMediaCount.setText(String.valueOf(album.getCount())); MediaPickerManager.getInstance().getMediaLoader() .loadThumbnail(holder.itemView.getContext(), holder.mAlbumThumbnail, - album.getCoverUri(), R.color.black, R.color.black); + album.getCoverUri(), + com.cgfay.utilslibrary.R.color.black, + com.cgfay.utilslibrary.R.color.black); holder.itemView.setOnClickListener(v -> { if (mAlbumSelectedListener != null) { mAlbumSelectedListener.onAlbumSelected(album); diff --git a/pickerlibrary/src/main/java/com/cgfay/picker/adapter/MediaDataAdapter.java b/pickerlibrary/src/main/java/com/cgfay/picker/adapter/MediaDataAdapter.java index f7ac1699b..b4c57f94a 100644 --- a/pickerlibrary/src/main/java/com/cgfay/picker/adapter/MediaDataAdapter.java +++ b/pickerlibrary/src/main/java/com/cgfay/picker/adapter/MediaDataAdapter.java @@ -60,12 +60,14 @@ public void onBindViewHolder(@NonNull ThumbnailViewHolder holder, int position) MediaPickerManager.getInstance().getMediaLoader() .loadThumbnail(holder.itemView.getContext(), holder.mThumbnailView, mediaData.getContentUri(), mResize, - R.color.white, R.color.white); + com.cgfay.utilslibrary.R.color.white, + com.cgfay.utilslibrary.R.color.white); } else { MediaPickerManager.getInstance().getMediaLoader() .loadThumbnail(holder.itemView.getContext(), holder.mThumbnailView, mediaData.getContentUri(), - R.color.white, R.color.white); + com.cgfay.utilslibrary.R.color.white, + com.cgfay.utilslibrary.R.color.white); } if (mediaData.isVideo()) { diff --git a/pickerlibrary/src/main/java/com/cgfay/picker/fragment/MediaDataFragment.java b/pickerlibrary/src/main/java/com/cgfay/picker/fragment/MediaDataFragment.java index 6ec552e57..fec136eb7 100644 --- a/pickerlibrary/src/main/java/com/cgfay/picker/fragment/MediaDataFragment.java +++ b/pickerlibrary/src/main/java/com/cgfay/picker/fragment/MediaDataFragment.java @@ -241,7 +241,9 @@ protected boolean isSlideToBottomLine(@NonNull RecyclerView recyclerView, int of * 指定加载图片的大小 */ private void setItemImageSize() { - int divSize = (int)(getResources().getDimension(R.dimen.dp4) * (mMediaPickerParam.getSpanCount() + 1)); + int divSize = (int)(getResources().getDimension( + com.cgfay.utilslibrary.R.dimen.dp4) * + (mMediaPickerParam.getSpanCount() + 1)); int imageSize = getResources().getDisplayMetrics().widthPixels - divSize; int resize = imageSize / mMediaPickerParam.getSpanCount(); mMediaDataAdapter.setThumbnailResize(resize); diff --git a/utilslibrary/build.gradle b/utilslibrary/build.gradle index 1056ba0f6..17271e6a9 100644 --- a/utilslibrary/build.gradle +++ b/utilslibrary/build.gradle @@ -1,13 +1,14 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.utilslibrary' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -31,12 +32,12 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.1' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.legacy:legacy-support-v4:${rootProject.ext.legacySupportVersion}" + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/versions.gradle b/versions.gradle new file mode 100644 index 000000000..a48135ff9 --- /dev/null +++ b/versions.gradle @@ -0,0 +1,22 @@ +ext { + // Compile against the latest Android 14 SDK + compileSdkVersion = 35 + buildToolsVersion = '35.0.0' + minSdkVersion = 21 + targetSdkVersion = 30 + + appcompatVersion = '1.7.1' + recyclerViewVersion = '1.4.0' + materialVersion = '1.12.0' + constraintLayoutVersion = '2.2.1' + legacySupportVersion = '1.0.0' + glideVersion = '4.16.0' + junitVersion = '4.13.2' + androidXJunitVersion = '1.2.1' + espressoVersion = '3.6.1' + lifecycleVersion = '2.2.0' + cameraXVersion = '1.4.2' + rxJavaVersion = '2.2.21' + rxAndroidVersion = '2.1.1' +} + diff --git a/videolibrary/build.gradle b/videolibrary/build.gradle index d979dd563..e1b7c8af7 100644 --- a/videolibrary/build.gradle +++ b/videolibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.video' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -32,11 +33,11 @@ dependencies { implementation project(':filterlibrary') implementation project(':medialibrary') implementation project(':utilslibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.recyclerview:recyclerview:1.1.0' - implementation 'com.google.android.material:material:1.2.1' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "androidx.recyclerview:recyclerview:${rootProject.ext.recyclerViewVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" + implementation "androidx.constraintlayout:constraintlayout:${rootProject.ext.constraintLayoutVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/videolibrary/src/main/java/com/cgfay/video/activity/VideoEditActivity.java b/videolibrary/src/main/java/com/cgfay/video/activity/VideoEditActivity.java index ca4b621fe..b8caa94ed 100644 --- a/videolibrary/src/main/java/com/cgfay/video/activity/VideoEditActivity.java +++ b/videolibrary/src/main/java/com/cgfay/video/activity/VideoEditActivity.java @@ -67,7 +67,7 @@ public void onOpenMusicSelectPage() { fragment.addOnMusicSelectedListener(this); getSupportFragmentManager() .beginTransaction() - .setCustomAnimations(R.anim.anim_slide_up, 0) + .setCustomAnimations(com.cgfay.utilslibrary.R.anim.anim_slide_up, 0) .add(R.id.fragment_content, fragment) .addToBackStack(FRAGMENT_MUSIC_SELECT) .commit(); diff --git a/videolibrary/src/main/java/com/cgfay/video/adapter/VideoEffectCategoryAdapter.java b/videolibrary/src/main/java/com/cgfay/video/adapter/VideoEffectCategoryAdapter.java index 40851ed1d..ba3246f6e 100644 --- a/videolibrary/src/main/java/com/cgfay/video/adapter/VideoEffectCategoryAdapter.java +++ b/videolibrary/src/main/java/com/cgfay/video/adapter/VideoEffectCategoryAdapter.java @@ -46,7 +46,7 @@ public ImageHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public void onBindViewHolder(@NonNull ImageHolder holder, final int position) { holder.filterName.setText(mCategoryList.get(position).getName()); if (position == mSelected) { - holder.filterName.setTextColor(mContext.getResources().getColor(R.color.white)); + holder.filterName.setTextColor(mContext.getResources().getColor(com.cgfay.utilslibrary.R.color.white)); } else { holder.filterName.setTextColor(mContext.getResources().getColor(R.color.video_edit_effect_category_text_normal)); } diff --git a/videolibrary/src/main/java/com/cgfay/video/adapter/VideoFilterAdapter.java b/videolibrary/src/main/java/com/cgfay/video/adapter/VideoFilterAdapter.java index c6f0a8024..2205b3bb5 100644 --- a/videolibrary/src/main/java/com/cgfay/video/adapter/VideoFilterAdapter.java +++ b/videolibrary/src/main/java/com/cgfay/video/adapter/VideoFilterAdapter.java @@ -61,7 +61,7 @@ public void onBindViewHolder(@NonNull ImageHolder holder, final int position) { if (position == mSelected) { holder.filterPanel.setBackgroundResource(R.drawable.ic_video_filter_selected); } else { - holder.filterPanel.setBackgroundColor(mContext.getResources().getColor(R.color.transparent)); + holder.filterPanel.setBackgroundColor(mContext.getResources().getColor(com.cgfay.utilslibrary.R.color.transparent)); } holder.filterRoot.setOnClickListener(new View.OnClickListener() { @Override diff --git a/videolibrary/src/main/java/com/cgfay/video/fragment/VideoCutFragment.java b/videolibrary/src/main/java/com/cgfay/video/fragment/VideoCutFragment.java index ff64de0b9..f685c8a53 100644 --- a/videolibrary/src/main/java/com/cgfay/video/fragment/VideoCutFragment.java +++ b/videolibrary/src/main/java/com/cgfay/video/fragment/VideoCutFragment.java @@ -154,9 +154,9 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { View layoutSpeed = mContentView.findViewById(R.id.layout_speed); ConstraintLayout.LayoutParams speedParams = (ConstraintLayout.LayoutParams) layoutSpeed.getLayoutParams(); if (DisplayUtils.isFullScreenDevice(mActivity)) { - speedParams.bottomMargin = getResources().getDimensionPixelSize(R.dimen.dp20); + speedParams.bottomMargin = getResources().getDimensionPixelSize(com.cgfay.utilslibrary.R.dimen.dp20); } else { - speedParams.bottomMargin = getResources().getDimensionPixelSize(R.dimen.dp100); + speedParams.bottomMargin = getResources().getDimensionPixelSize(com.cgfay.utilslibrary.R.dimen.dp100); } layoutSpeed.setLayoutParams(speedParams); @@ -167,9 +167,9 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { mVideoCutViewBar.setOnVideoCropViewBarListener(mOnVideoCropViewBarListener); ConstraintLayout.LayoutParams cutViewBarParams = (ConstraintLayout.LayoutParams) mVideoCutViewBar.getLayoutParams(); if (DisplayUtils.isFullScreenDevice(mActivity)) { - cutViewBarParams.bottomMargin = getResources().getDimensionPixelSize(R.dimen.dp70); + cutViewBarParams.bottomMargin = getResources().getDimensionPixelSize(com.cgfay.utilslibrary.R.dimen.dp70); } else { - cutViewBarParams.bottomMargin = getResources().getDimensionPixelSize(R.dimen.dp20); + cutViewBarParams.bottomMargin = getResources().getDimensionPixelSize(com.cgfay.utilslibrary.R.dimen.dp20); } mVideoCutViewBar.setLayoutParams(cutViewBarParams); diff --git a/widgetlibrary/build.gradle b/widgetlibrary/build.gradle index 83b7ba271..449329165 100644 --- a/widgetlibrary/build.gradle +++ b/widgetlibrary/build.gradle @@ -1,12 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 30 - buildToolsVersion '30.0.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion + namespace 'com.cgfay.design' defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" @@ -30,9 +31,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "androidx.appcompat:appcompat:${rootProject.ext.appcompatVersion}" + implementation "com.google.android.material:material:${rootProject.ext.materialVersion}" + testImplementation "junit:junit:${rootProject.ext.junitVersion}" + androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.androidXJunitVersion}" + androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}" } diff --git a/widgetlibrary/src/main/java/com/cgfay/widget/CameraTabView.java b/widgetlibrary/src/main/java/com/cgfay/widget/CameraTabView.java index c1b45aaa2..5b509ffbc 100644 --- a/widgetlibrary/src/main/java/com/cgfay/widget/CameraTabView.java +++ b/widgetlibrary/src/main/java/com/cgfay/widget/CameraTabView.java @@ -55,7 +55,7 @@ import android.widget.LinearLayout; import android.widget.TextView; -import com.cgfay.design.R; +import com.google.android.material.R; import com.cgfay.resources.MaterialResources; import com.cgfay.internal.ViewUtils; diff --git a/widgetlibrary/src/main/java/com/cgfay/widget/TabItem.java b/widgetlibrary/src/main/java/com/cgfay/widget/TabItem.java index 94b3e022c..d57412e16 100644 --- a/widgetlibrary/src/main/java/com/cgfay/widget/TabItem.java +++ b/widgetlibrary/src/main/java/com/cgfay/widget/TabItem.java @@ -6,7 +6,7 @@ import android.util.AttributeSet; import android.view.View; -import com.cgfay.design.R; +import com.google.android.material.R; /** diff --git a/widgetlibrary/src/main/java/com/cgfay/widget/ThemeUtils.java b/widgetlibrary/src/main/java/com/cgfay/widget/ThemeUtils.java index 67599d130..c9e4298ed 100644 --- a/widgetlibrary/src/main/java/com/cgfay/widget/ThemeUtils.java +++ b/widgetlibrary/src/main/java/com/cgfay/widget/ThemeUtils.java @@ -3,7 +3,7 @@ import android.content.Context; import android.content.res.TypedArray; -import com.cgfay.design.R; +import androidx.appcompat.R; /** * @author CainHuang