diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditInfo.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditInfo.kt index 7c22bdad..8f259ee3 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditInfo.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditInfo.kt @@ -5,8 +5,8 @@ package emu.skyline.input.onscreen +import android.content.res.Resources import android.util.TypedValue -import emu.skyline.SkylineApplication enum class EditMode { None, @@ -39,10 +39,9 @@ class OnScreenEditInfo { val isEditing get() = editMode != EditMode.None companion object { - /** * The size of the grid, calculated from the value of 8dp */ - val GridSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8f, SkylineApplication.context.resources.displayMetrics).toInt() + var GridSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8f, Resources.getSystem().displayMetrics).toInt() } } diff --git a/app/src/main/java/emu/skyline/views/AlignmentGridView.kt b/app/src/main/java/emu/skyline/views/AlignmentGridView.kt index 8e093a14..9f084cec 100644 --- a/app/src/main/java/emu/skyline/views/AlignmentGridView.kt +++ b/app/src/main/java/emu/skyline/views/AlignmentGridView.kt @@ -16,7 +16,7 @@ import android.view.View * A view that draws a grid, used for aligning on-screen controller buttons */ class AlignmentGridView @JvmOverloads constructor(context : Context, attrs : AttributeSet? = null, defStyleAttr : Int = 0) : View(context, attrs, defStyleAttr) { - var gridSize = 0 + var gridSize = 16 set(value) { field = value invalidate()