Merge pull request #179 from spk/last-save-ext
Add lastSaveExtension to config
This commit is contained in:
commit
5317bd5a75
|
@ -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_EXTENSION, "")!!
|
||||||
|
set(lastSaveExtension) = prefs.edit().putString(LAST_SAVE_EXTENSION, 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_EXTENSION = "last_save_extension"
|
||||||
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