From 27bdd6247671e0beb1e8cebb9f206fc8b9acdd39 Mon Sep 17 00:00:00 2001 From: sangcomz Date: Wed, 12 Jan 2022 23:12:08 +0900 Subject: [PATCH 1/4] change github release plugin --- FishBun/build.gradle | 2 +- build.gradle | 4 ++++ publish/release.gradle | 2 +- release.sh | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/FishBun/build.gradle b/FishBun/build.gradle index 77a7155..3b03d5b 100644 --- a/FishBun/build.gradle +++ b/FishBun/build.gradle @@ -54,7 +54,7 @@ android { } } -apply plugin: 'co.riiid.gradle' +apply plugin: "io.github.sabujak-sabujak" apply from: '../publish/release.gradle' diff --git a/build.gradle b/build.gradle index 100cd7f..33afbc5 100644 --- a/build.gradle +++ b/build.gradle @@ -14,11 +14,15 @@ buildscript { repositories { mavenCentral() google() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.android.tools.build:gradle:7.0.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.bjoernq:unmockplugin:0.7.9' + classpath "io.github.sabujak-sabujak:gradle-github-release-plugin:0.0.2" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/publish/release.gradle b/publish/release.gradle index ab5a309..fbc8b1c 100644 --- a/publish/release.gradle +++ b/publish/release.gradle @@ -93,7 +93,7 @@ afterEvaluate { } } -github { +githubRelease { owner = 'sangcomz' repo = 'Fishbun' token = githubAccessTokens diff --git a/release.sh b/release.sh index 866a671..9e3fc27 100644 --- a/release.sh +++ b/release.sh @@ -1 +1 @@ -./gradlew clean fishbun:publishAllPublicationsToMavenRepository githubRelease \ No newline at end of file +./gradlew clean fishbun:publishAllPublicationsToMavenRepository createGithubRelease \ No newline at end of file From 4cb3b0fd07748e84704f0dda627416fd0efdb385 Mon Sep 17 00:00:00 2001 From: sangcomz Date: Mon, 3 Oct 2022 22:06:11 +0900 Subject: [PATCH 2/4] update target sdk version to 33 --- FishBun/build.gradle | 1 + FishBun/src/main/AndroidManifest.xml | 3 +-- .../fishbun/permission/PermissionCheck.kt | 23 ++++++++++++++++++- .../fishbun/ui/album/ui/AlbumActivity.kt | 4 +--- .../fishbun/ui/picker/PickerActivity.kt | 5 +--- FishBunDemo/src/main/AndroidManifest.xml | 6 ++++- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 6 ++--- publish/release.gradle | 4 +--- settings.gradle | 4 ++-- 10 files changed, 39 insertions(+), 21 deletions(-) diff --git a/FishBun/build.gradle b/FishBun/build.gradle index 3b03d5b..99c847d 100644 --- a/FishBun/build.gradle +++ b/FishBun/build.gradle @@ -24,6 +24,7 @@ buildscript { android { + namespace 'com.sangcomz.fishbun' compileSdkVersion gradle.compileSdk defaultConfig { diff --git a/FishBun/src/main/AndroidManifest.xml b/FishBun/src/main/AndroidManifest.xml index 3282d24..350ed8e 100644 --- a/FishBun/src/main/AndroidManifest.xml +++ b/FishBun/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + = Build.VERSION_CODES.M && + Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU -> { + checkStoragePermissionUnderAPI33(requestCode) + } + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> { + checkStoragePermissionOrHigherAPI33(requestCode) + } + else -> true + } + } + + @TargetApi(Build.VERSION_CODES.M) + fun checkStoragePermissionUnderAPI33(requestCode: Int): Boolean { return checkPermission( arrayListOf(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE), requestCode ) } + @TargetApi(Build.VERSION_CODES.TIRAMISU) + fun checkStoragePermissionOrHigherAPI33(requestCode: Int): Boolean { + return checkPermission( + arrayListOf(READ_MEDIA_IMAGES), + requestCode + ) + } + @TargetApi(Build.VERSION_CODES.M) fun checkCameraPermission(requestCode: Int): Boolean { try { diff --git a/FishBun/src/main/java/com/sangcomz/fishbun/ui/album/ui/AlbumActivity.kt b/FishBun/src/main/java/com/sangcomz/fishbun/ui/album/ui/AlbumActivity.kt index f108748..e2e407a 100644 --- a/FishBun/src/main/java/com/sangcomz/fishbun/ui/album/ui/AlbumActivity.kt +++ b/FishBun/src/main/java/com/sangcomz/fishbun/ui/album/ui/AlbumActivity.kt @@ -290,9 +290,7 @@ class AlbumActivity : BaseActivity(), } private fun checkPermission(): Boolean { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - permissionCheck.checkStoragePermission(PERMISSION_STORAGE) - } else true + return permissionCheck.checkStoragePermission(PERMISSION_STORAGE) } private fun checkCameraPermission(): Boolean { diff --git a/FishBun/src/main/java/com/sangcomz/fishbun/ui/picker/PickerActivity.kt b/FishBun/src/main/java/com/sangcomz/fishbun/ui/picker/PickerActivity.kt index a5dcef5..60dfddf 100644 --- a/FishBun/src/main/java/com/sangcomz/fishbun/ui/picker/PickerActivity.kt +++ b/FishBun/src/main/java/com/sangcomz/fishbun/ui/picker/PickerActivity.kt @@ -361,10 +361,7 @@ class PickerActivity : BaseActivity(), } private fun checkPermission(): Boolean { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (permissionCheck.checkStoragePermission(PERMISSION_STORAGE)) return true - } else return true - return false + return permissionCheck.checkStoragePermission(PERMISSION_STORAGE) } private fun checkCameraPermission(): Boolean { diff --git a/FishBunDemo/src/main/AndroidManifest.xml b/FishBunDemo/src/main/AndroidManifest.xml index d6eaea0..6c0ef38 100644 --- a/FishBunDemo/src/main/AndroidManifest.xml +++ b/FishBunDemo/src/main/AndroidManifest.xml @@ -2,7 +2,11 @@ - + + + diff --git a/build.gradle b/build.gradle index 33afbc5..7d72098 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { - kotlin_version = '1.5.21' + kotlin_version = '1.7.10' androidx_version = '1.3.1' recyclerview_version = '1.2.1' material_version = '1.4.0' @@ -19,7 +19,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.bjoernq:unmockplugin:0.7.9' classpath "io.github.sabujak-sabujak:gradle-github-release-plugin:0.0.2" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 58240aa..a2fe4b6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jan 04 21:58:21 KST 2021 +#Mon Sep 26 23:18:15 KST 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/publish/release.gradle b/publish/release.gradle index fbc8b1c..83ca93a 100644 --- a/publish/release.gradle +++ b/publish/release.gradle @@ -100,9 +100,7 @@ githubRelease { tagName = version targetCommitish = 'master' body = """## Release Note -* add startAlbumWithActivityResultCallback function(#239) -* remove jcenter -* library version update +* update sdk version to 33 """ name = version } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index eef8094..17b1038 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,5 +4,5 @@ gradle.ext.versionCode = 35 gradle.ext.versionName = '1.0.0-beta01' gradle.ext.set('minSdk', 15) -gradle.ext.set('targetSdk', 31) -gradle.ext.set('compileSdk', 31) \ No newline at end of file +gradle.ext.set('targetSdk', 33) +gradle.ext.set('compileSdk', 33) \ No newline at end of file From 5ea0bab464896f12a82279b03f4ed934b34df042 Mon Sep 17 00:00:00 2001 From: sangcomz Date: Mon, 3 Oct 2022 22:38:49 +0900 Subject: [PATCH 3/4] prepare release --- README.md | 12 ++++++++++-- settings.gradle | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f44a191..792c5a1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ _FishBun_ is a highly customizable image picker for Android. -## What's New in _FishBun_ 1.0.0-beta01? :tada: +## What's New in _FishBun_ 1.1.0? :tada: - add startAlbumWithActivityResultCallback function(#239) - remove jcenter @@ -112,7 +112,7 @@ Fishbun 0.10.0 and above only supports projects that have been migrated to [andr Setting up _FishBun_ requires to add this Gradle configuration: dependencies { - implementation 'io.github.sangcomz:fishbun:1.0.0-alpha06' + implementation 'io.github.sangcomz:fishbun:x.x.x' implementation 'io.coil-kt:coil:0.11.0' or @@ -133,6 +133,14 @@ If your app targets Android 11 with compileSdk/targetSdk >= 30 then you will nee +If your app targets Android 13 with compileSdk/targetSdk >= 33 then you will need to add this to the manifest (outside of the application block) in order to capture pictures with the device camera. [Android documentation here](https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions): + + + + + ## How to Use Use _FishBun_ in an activity: diff --git a/settings.gradle b/settings.gradle index 17b1038..4c07928 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,7 @@ include ':FishBunDemo', ':FishBun' -gradle.ext.versionCode = 35 -gradle.ext.versionName = '1.0.0-beta01' +gradle.ext.versionCode = 36 +gradle.ext.versionName = '1.1.0' gradle.ext.set('minSdk', 15) gradle.ext.set('targetSdk', 33) From c81cbdee894ee6133f0f144090c4d6a0b29490ac Mon Sep 17 00:00:00 2001 From: sangcomz Date: Mon, 3 Oct 2022 22:41:17 +0900 Subject: [PATCH 4/4] fix README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 792c5a1..8c4bd9e 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,7 @@ _FishBun_ is a highly customizable image picker for Android. ## What's New in _FishBun_ 1.1.0? :tada: -- add startAlbumWithActivityResultCallback function(#239) -- remove jcenter -- library version update +- sdk version update ## Customizable Styles @@ -133,7 +131,7 @@ If your app targets Android 11 with compileSdk/targetSdk >= 30 then you will nee -If your app targets Android 13 with compileSdk/targetSdk >= 33 then you will need to add this to the manifest (outside of the application block) in order to capture pictures with the device camera. [Android documentation here](https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions): +If your app targets Android 13 with compileSdk/targetSdk >= 33 then you will need to add this to the manifest. [Android documentation here](https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions):