diff --git a/FishBun/build.gradle b/FishBun/build.gradle index 77a7155f..99c847d8 100644 --- a/FishBun/build.gradle +++ b/FishBun/build.gradle @@ -24,6 +24,7 @@ buildscript { android { + namespace 'com.sangcomz.fishbun' compileSdkVersion gradle.compileSdk defaultConfig { @@ -54,7 +55,7 @@ android { } } -apply plugin: 'co.riiid.gradle' +apply plugin: "io.github.sabujak-sabujak" apply from: '../publish/release.gradle' diff --git a/FishBun/src/main/AndroidManifest.xml b/FishBun/src/main/AndroidManifest.xml index 3282d245..350ed8ed 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 f1087484..e2e407a5 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 a5dcef5b..60dfddfd 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 d6eaea09..6c0ef380 100644 --- a/FishBunDemo/src/main/AndroidManifest.xml +++ b/FishBunDemo/src/main/AndroidManifest.xml @@ -2,7 +2,11 @@ - + + + diff --git a/README.md b/README.md index f44a1912..8c4bd9e6 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,9 @@ _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 -- library version update +- sdk version update ## Customizable Styles @@ -112,7 +110,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 +131,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. [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/build.gradle b/build.gradle index 100cd7f3..7d720987 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' @@ -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 '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" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 58240aa1..a2fe4b6e 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 ab5a3099..83ca93ae 100644 --- a/publish/release.gradle +++ b/publish/release.gradle @@ -93,16 +93,14 @@ afterEvaluate { } } -github { +githubRelease { owner = 'sangcomz' repo = 'Fishbun' token = githubAccessTokens 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/release.sh b/release.sh index 866a6717..9e3fc274 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 diff --git a/settings.gradle b/settings.gradle index eef80949..4c079285 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,8 @@ 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', 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