Skip to content

Commit

Permalink
Downgrade to Kotlin 1.5.30
Browse files Browse the repository at this point in the history
  • Loading branch information
anggrayudi committed Mar 23, 2022
1 parent 64a5dcd commit 297fe3e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {

addRepos(repositories)

ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.5.30'

dependencies {
classpath 'com.android.tools:r8:3.1.51'
Expand Down Expand Up @@ -37,7 +37,7 @@ subprojects {
afterEvaluate {
android {
compileSdkVersion 31
buildToolsVersion '30.0.2'
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion 19
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ android.enableJetifier=true
kotlin.code.style=official
GROUP=com.anggrayudi
POM_ARTIFACT_ID=storage
VERSION_NAME=1.2.1-SNAPSHOT
VERSION_NAME=1.2.2-SNAPSHOT
3 changes: 2 additions & 1 deletion sample/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
/.externalNativeBuild
/release
/release
/local
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class SimpleStorage private constructor(private val wrapper: ComponentWrapper) {
val storageType = StorageType.fromStorageId(storageId)

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
val selectedFolder = DocumentFile.fromTreeUri(context, uri) ?: return
val selectedFolder = context.fromTreeUri(uri) ?: return
if (!expectedStorageTypeForAccessRequest.isExpected(storageType) ||
!expectedBasePathForAccessRequest.isNullOrEmpty() && selectedFolder.getBasePath(context) != expectedBasePathForAccessRequest
) {
Expand Down
4 changes: 2 additions & 2 deletions storage/src/main/java/com/anggrayudi/storage/file/FileExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ fun File.shouldWritable(context: Context, requiresWriteAccess: Boolean) = requir
fun File.takeIfWritable(context: Context, requiresWriteAccess: Boolean) = takeIf { it.shouldWritable(context, requiresWriteAccess) }

@RestrictTo(RestrictTo.Scope.LIBRARY)
fun File.checkRequirements(context: Context, requiresWriteAccess: Boolean, considerRawFile: Boolean) = canRead() &&
(considerRawFile || isExternalStorageManager(context)) && shouldWritable(context, requiresWriteAccess)
fun File.checkRequirements(context: Context, requiresWriteAccess: Boolean, considerRawFile: Boolean) = canRead() && shouldWritable(context, requiresWriteAccess)
&& (considerRawFile || isExternalStorageManager(context))

fun File.createNewFileIfPossible(): Boolean = try {
isFile || createNewFile()
Expand Down

0 comments on commit 297fe3e

Please sign in to comment.