ColorPickerDialog has been implemented - picking colours for text and highlight now works!

This commit is contained in:
denizk0461
2023-05-16 12:58:58 +02:00
parent 4dfc2a2df6
commit a573e2e071
7 changed files with 185 additions and 4 deletions
@@ -40,7 +40,7 @@ class CanvasText {
storage.getNextQuote()
}.ifBlank { context.getString(R.string.info_add_text) }
val colours = storage.getColours(context = context)
// val colours = storage.getColours(context = context)
val scaledTextSize =
context.resources.displayMetrics.scaledDensity * if (/*isPreview*/false) previewSize else {
@@ -52,7 +52,7 @@ class CanvasText {
val paint = TextPaint().apply {
style = Paint.Style.FILL
color = colours.first
color = Color.parseColor("#${storage.getTextColour()}")
textSize = scaledTextSize
textAlign = when (widgetGravity) {
0, 3, 6 -> Paint.Align.LEFT
@@ -116,7 +116,7 @@ class CanvasText {
0 -> { // background
val bgPaint = Paint().apply {
style = Paint.Style.FILL
color = colours.second
color = Color.parseColor("#${storage.getHighlightColour()}")
}
val rounding = 24f
@@ -142,7 +142,7 @@ class CanvasText {
val strokePaint = TextPaint().apply {
style = Paint.Style.STROKE
strokeWidth = outlineSize //if (isPreview) previewSize / 1.5f else
color = colours.second
color = Color.parseColor("#${storage.getHighlightColour()}")
textSize = scaledTextSize
textAlign = alignment