remember last used file name and extension at Android 11 too
This commit is contained in:
parent
5317bd5a75
commit
1dc8299438
|
@ -373,6 +373,10 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||||
SaveImageDialog(this, defaultPath, defaultFilename, defaultExtension, true) { fullPath, filename, extension ->
|
SaveImageDialog(this, defaultPath, defaultFilename, defaultExtension, true) { fullPath, filename, extension ->
|
||||||
val mimetype = if (extension == SVG) "svg+xml" else extension
|
val mimetype = if (extension == SVG) "svg+xml" else extension
|
||||||
|
|
||||||
|
defaultFilename = filename
|
||||||
|
defaultExtension = extension
|
||||||
|
config.lastSaveExtension = extension
|
||||||
|
|
||||||
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||||
type = "image/$mimetype"
|
type = "image/$mimetype"
|
||||||
putExtra(Intent.EXTRA_TITLE, "$filename.$extension")
|
putExtra(Intent.EXTRA_TITLE, "$filename.$extension")
|
||||||
|
@ -396,7 +400,7 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||||
defaultFilename = filename
|
defaultFilename = filename
|
||||||
defaultExtension = extension
|
defaultExtension = extension
|
||||||
config.lastSaveFolder = defaultPath
|
config.lastSaveFolder = defaultPath
|
||||||
config.lastSaveExtension = defaultExtension
|
config.lastSaveExtension = extension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue