mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 19:09:17 +01:00
MangaFullCoverDialog: Use the new image picker when available (#7740)
This commit is contained in:
parent
83129385e2
commit
aab5a56892
@ -6,6 +6,8 @@ import android.content.Intent
|
|||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import androidx.activity.result.PickVisualMediaRequest
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
@ -112,14 +114,8 @@ class MangaFullCoverDialog : FullComposeController<MangaFullCoverDialog.MangaFul
|
|||||||
private fun changeCover(action: EditCoverAction) {
|
private fun changeCover(action: EditCoverAction) {
|
||||||
when (action) {
|
when (action) {
|
||||||
EditCoverAction.EDIT -> {
|
EditCoverAction.EDIT -> {
|
||||||
val intent = Intent(Intent.ACTION_GET_CONTENT).apply {
|
|
||||||
type = "image/*"
|
|
||||||
}
|
|
||||||
startActivityForResult(
|
startActivityForResult(
|
||||||
Intent.createChooser(
|
PickVisualMedia().createIntent(activity!!, PickVisualMediaRequest(PickVisualMedia.ImageOnly)),
|
||||||
intent,
|
|
||||||
resources?.getString(R.string.file_select_cover),
|
|
||||||
),
|
|
||||||
REQUEST_IMAGE_OPEN,
|
REQUEST_IMAGE_OPEN,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user