fixed saving on android >= 13

This commit is contained in:
T8RIN
2023-02-09 22:07:48 +03:00
parent 319716d6d1
commit 3cf1ce491f
6 changed files with 14 additions and 10 deletions

View File

@ -7,11 +7,11 @@
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\malik\.android\avd\Pixel_5_API_31_Android_12_.avd" />
<value value="C:\Users\malik\.android\avd\Resizable_Experimental_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-04-06T19:53:59.708204900Z" />
<timeTargetWasSelectedWithDropDown value="2023-02-09T18:54:05.218309600Z" />
</component>
</project>

View File

@ -33,7 +33,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
kotlinCompilerExtensionVersion '1.4.0'
}
packagingOptions {
resources {
@ -43,9 +43,9 @@ android {
}
dependencies {
implementation 'androidx.activity:activity-compose:1.6.1'
implementation 'androidx.compose.material3:material3:1.1.0-alpha04'
implementation "androidx.compose.material:material-icons-extended:1.4.0-alpha04"
implementation 'androidx.activity:activity-compose:1.7.0-alpha04'
implementation 'androidx.compose.material3:material3:1.1.0-alpha05'
implementation "androidx.compose.material:material-icons-extended:1.4.0-alpha05"
implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0"
implementation("io.coil-kt:coil-compose:2.2.2")
implementation("androidx.core:core-splashscreen:1.0.0")

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 6,
"versionName": "1.1.1",
"versionCode": 7,
"versionName": "1.2",
"outputFile": "app-release.apk"
}
],

View File

@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"

View File

@ -3,6 +3,7 @@ package ru.tech.imageresizershrinker
import android.Manifest
import android.content.ContentValues
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
import androidx.activity.ComponentActivity
@ -381,6 +382,7 @@ class MainActivity : ComponentActivity() {
Modifier
.align(Alignment.BottomEnd)
.padding(16.dp)
.navigationBarsPadding()
) {
if (viewModel.bitmap != null) {
FloatingActionButton(
@ -534,7 +536,8 @@ class MainActivity : ComponentActivity() {
}
private fun isExternalStorageWritable(): Boolean {
return ContextCompat.checkSelfPermission(
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) true
else ContextCompat.checkSelfPermission(
this,
Manifest.permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED

View File

@ -1,5 +1,5 @@
plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
}