Add lastSaveExtension to config
This allow to keep the preferred user file extension like save folder
This commit is contained in:
parent
0be3aa0b1f
commit
9d22838ae6
|
@ -73,6 +73,7 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||||
setBackgroundColor(config.canvasBackgroundColor)
|
setBackgroundColor(config.canvasBackgroundColor)
|
||||||
setColor(config.brushColor)
|
setColor(config.brushColor)
|
||||||
defaultPath = config.lastSaveFolder
|
defaultPath = config.lastSaveFolder
|
||||||
|
defaultExtension = config.lastSaveExtension
|
||||||
|
|
||||||
brushSize = config.brushSize
|
brushSize = config.brushSize
|
||||||
updateBrushSize()
|
updateBrushSize()
|
||||||
|
@ -395,6 +396,7 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
||||||
defaultFilename = filename
|
defaultFilename = filename
|
||||||
defaultExtension = extension
|
defaultExtension = extension
|
||||||
config.lastSaveFolder = defaultPath
|
config.lastSaveFolder = defaultPath
|
||||||
|
config.lastSaveExtension = defaultExtension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||||
get() = prefs.getString(LAST_SAVE_FOLDER, "")!!
|
get() = prefs.getString(LAST_SAVE_FOLDER, "")!!
|
||||||
set(lastSaveFolder) = prefs.edit().putString(LAST_SAVE_FOLDER, lastSaveFolder).apply()
|
set(lastSaveFolder) = prefs.edit().putString(LAST_SAVE_FOLDER, lastSaveFolder).apply()
|
||||||
|
|
||||||
|
var lastSaveExtension: String
|
||||||
|
get() = prefs.getString(LAST_SAVE_EXT, "")!!
|
||||||
|
set(lastSaveExtension) = prefs.edit().putString(LAST_SAVE_EXT, lastSaveExtension).apply()
|
||||||
|
|
||||||
var allowZoomingCanvas: Boolean
|
var allowZoomingCanvas: Boolean
|
||||||
get() = prefs.getBoolean(ALLOW_ZOOMING_CANVAS, false)
|
get() = prefs.getBoolean(ALLOW_ZOOMING_CANVAS, false)
|
||||||
set(allowZoomingCanvas) = prefs.edit().putBoolean(ALLOW_ZOOMING_CANVAS, allowZoomingCanvas).apply()
|
set(allowZoomingCanvas) = prefs.edit().putBoolean(ALLOW_ZOOMING_CANVAS, allowZoomingCanvas).apply()
|
||||||
|
|
|
@ -5,6 +5,7 @@ const val CANVAS_BACKGROUND_COLOR = "canvas_background_color"
|
||||||
const val SHOW_BRUSH_SIZE = "show_brush_size"
|
const val SHOW_BRUSH_SIZE = "show_brush_size"
|
||||||
const val BRUSH_SIZE = "brush_size_2"
|
const val BRUSH_SIZE = "brush_size_2"
|
||||||
const val LAST_SAVE_FOLDER = "last_save_folder"
|
const val LAST_SAVE_FOLDER = "last_save_folder"
|
||||||
|
const val LAST_SAVE_EXT = "last_save_ext"
|
||||||
const val ALLOW_ZOOMING_CANVAS = "allow_zooming_canvas"
|
const val ALLOW_ZOOMING_CANVAS = "allow_zooming_canvas"
|
||||||
const val FORCE_PORTRAIT_MODE = "force_portrait_mode"
|
const val FORCE_PORTRAIT_MODE = "force_portrait_mode"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue