Skip to content

Commit

Permalink
Use scan colour choice for gestures
Browse files Browse the repository at this point in the history
closes #358
  • Loading branch information
OwenMcGirr committed Jul 27, 2024
1 parent 2fb8c65 commit 065d9fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.os.Looper
import android.view.Gravity
import android.view.WindowManager
import android.widget.ImageView
import com.enaboapps.switchify.service.scanning.ScanColorManager

class GestureDrawing(private val context: Context) {

Expand All @@ -26,7 +27,13 @@ class GestureDrawing(private val context: Context) {

val gradientDrawable = GradientDrawable()
gradientDrawable.shape = GradientDrawable.OVAL
gradientDrawable.setColor(Color.RED)
gradientDrawable.setColor(
Color.parseColor(
ScanColorManager.getScanColorSetFromPreferences(
context
).secondaryColor
)
)
gradientDrawable.setSize(circleSize, circleSize)

val circle = ImageView(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ package com.enaboapps.switchify.service.gestures.visuals

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.view.View
import com.enaboapps.switchify.service.scanning.ScanColorManager
import kotlin.math.atan2
import kotlin.math.cos
import kotlin.math.sin

class GestureIndicatorView(context: Context) : View(context) {
private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = 0xFFFF0000.toInt() // Red color for the gesture indicator
color =
Color.parseColor(ScanColorManager.getScanColorSetFromPreferences(context).secondaryColor)
strokeWidth = 8f
style = Paint.Style.STROKE
}
Expand Down

0 comments on commit 065d9fe

Please sign in to comment.