updating some default values

This commit is contained in:
tibbi 2018-08-26 20:37:55 +02:00
parent 1956f169ed
commit 2a87708b3a
4 changed files with 8 additions and 6 deletions

View File

@ -448,8 +448,9 @@ class MainActivity : SimpleActivity(), CanvasListener {
private fun updateBrushSize() {
my_canvas.setBrushSize(brushSize)
stroke_width_preview.scaleX = brushSize / 100f
stroke_width_preview.scaleY = brushSize / 100f
val scale = Math.max(0.03f, brushSize / 100f)
stroke_width_preview.scaleX = scale
stroke_width_preview.scaleY = scale
}
private fun checkWhatsNewDialog() {

View File

@ -3,6 +3,7 @@ package com.simplemobiletools.draw.helpers
import android.content.Context
import android.graphics.Color
import com.simplemobiletools.commons.helpers.BaseConfig
import com.simplemobiletools.draw.R
class Config(context: Context) : BaseConfig(context) {
companion object {
@ -14,11 +15,11 @@ class Config(context: Context) : BaseConfig(context) {
set(showBrushSize) = prefs.edit().putBoolean(SHOW_BRUSH_SIZE, showBrushSize).apply()
var brushColor: Int
get() = prefs.getInt(BRUSH_COLOR, Color.BLACK)
get() = prefs.getInt(BRUSH_COLOR, context.resources.getColor(R.color.color_primary))
set(color) = prefs.edit().putInt(BRUSH_COLOR, color).apply()
var brushSize: Float
get() = prefs.getFloat(BRUSH_SIZE, 5.0f)
get() = prefs.getFloat(BRUSH_SIZE, 50f)
set(brushSize) = prefs.edit().putFloat(BRUSH_SIZE, brushSize).apply()
var canvasBackgroundColor: Int

View File

@ -3,7 +3,7 @@ package com.simplemobiletools.draw.helpers
const val BRUSH_COLOR = "brush_color"
const val CANVAS_BACKGROUND_COLOR = "canvas_background_color"
const val SHOW_BRUSH_SIZE = "show_brush_size"
const val BRUSH_SIZE = "brush_size"
const val BRUSH_SIZE = "brush_size_2"
const val LAST_SAVE_FOLDER = "last_save_folder"
const val ALLOW_ZOOMING_CANVAS = "allow_zooming_canvas"

View File

@ -1,5 +1,5 @@
<resources>
<dimen name="stroke_bar_size">150dp</dimen>
<dimen name="preview_dot_stroke_size">1dp</dimen>
<dimen name="full_brush_size">30dp</dimen>
<dimen name="full_brush_size">40dp</dimen>
</resources>