From 5c4aa95da66d7fe17ef3a734b784a63f9563cacd Mon Sep 17 00:00:00 2001 From: Willi Ye Date: Sat, 3 Oct 2020 19:20:36 +0200 Subject: [PATCH] Add on screen controls layout edit settings --- app/src/main/AndroidManifest.xml | 4 +- .../java/emu/skyline/EmulationActivity.kt | 2 +- app/src/main/java/emu/skyline/MainActivity.kt | 3 +- .../main/java/emu/skyline/data/BaseElement.kt | 2 +- .../emu/skyline/input/ControllerActivity.kt | 6 +- .../main/java/emu/skyline/input/GuestEvent.kt | 43 +++---- .../input/onscreen/OnScreenConfiguration.kt | 17 +-- .../input/onscreen/OnScreenControllerView.kt | 30 +++-- .../input/onscreen/OnScreenEditActivity.kt | 105 ++++++++++++++++++ .../input/onscreen/OnScreenItemDefinitions.kt | 7 +- app/src/main/res/drawable/ic_button.xml | 6 +- app/src/main/res/drawable/ic_close.xml | 10 ++ app/src/main/res/drawable/ic_edit.xml | 10 ++ .../res/drawable/ic_rectangular_button.xml | 8 +- app/src/main/res/drawable/ic_stick.xml | 20 ++-- app/src/main/res/drawable/ic_stick_circle.xml | 6 +- app/src/main/res/drawable/ic_toggle.xml | 10 ++ .../res/drawable/ic_trigger_button_left.xml | 16 +-- .../res/drawable/ic_trigger_button_right.xml | 16 +-- app/src/main/res/drawable/ic_zoom_in.xml | 10 ++ app/src/main/res/drawable/ic_zoom_out.xml | 10 ++ .../res/layout/on_screen_edit_activity.xml | 19 ++++ app/src/main/res/values/strings.xml | 5 + 23 files changed, 285 insertions(+), 80 deletions(-) create mode 100644 app/src/main/res/drawable/ic_close.xml create mode 100644 app/src/main/res/drawable/ic_edit.xml create mode 100644 app/src/main/res/drawable/ic_toggle.xml create mode 100644 app/src/main/res/drawable/ic_zoom_in.xml create mode 100644 app/src/main/res/drawable/ic_zoom_out.xml create mode 100644 app/src/main/res/layout/on_screen_edit_activity.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dbfb038c..bbc6f280 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -61,7 +61,9 @@ + android:exported="true" + android:screenOrientation="landscape" + tools:ignore="LockedOrientationActivity"> diff --git a/app/src/main/java/emu/skyline/EmulationActivity.kt b/app/src/main/java/emu/skyline/EmulationActivity.kt index 1b113012..8149d429 100644 --- a/app/src/main/java/emu/skyline/EmulationActivity.kt +++ b/app/src/main/java/emu/skyline/EmulationActivity.kt @@ -231,7 +231,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo game_view.setOnTouchListener(this) // Hide on screen controls when first controller is not set - on_screen_controller_view.isInvisible = InputManager.controllers[0]!!.type == ControllerType.None + on_screen_controller_view.isInvisible = !InputManager.controllers[0]!!.type.firstController || !sharedPreferences.getBoolean("on_screen_control", false) on_screen_controller_view.setOnButtonStateChangedListener(::onButtonStateChanged) on_screen_controller_view.setOnStickStateChangedListener(::onStickStateChanged) diff --git a/app/src/main/java/emu/skyline/MainActivity.kt b/app/src/main/java/emu/skyline/MainActivity.kt index f3341527..16a3fc71 100644 --- a/app/src/main/java/emu/skyline/MainActivity.kt +++ b/app/src/main/java/emu/skyline/MainActivity.kt @@ -33,6 +33,7 @@ import emu.skyline.adapter.LayoutType import emu.skyline.data.AppItem import emu.skyline.data.BaseElement import emu.skyline.data.BaseHeader +import emu.skyline.data.ElementType import emu.skyline.loader.LoaderResult import emu.skyline.loader.RomFile import emu.skyline.loader.RomFormat @@ -111,7 +112,7 @@ class MainActivity : AppCompatActivity() { if (loadFromFile) { try { loadSerializedList(romsFile).forEach { - if (it is BaseHeader) + if (it.elementType == ElementType.Header && it is BaseHeader) adapter.addItem(HeaderViewItem(it.title)) else if (it is AppItem) adapter.addItem(it.toViewItem()) diff --git a/app/src/main/java/emu/skyline/data/BaseElement.kt b/app/src/main/java/emu/skyline/data/BaseElement.kt index 25f6acd9..f0f3a6db 100644 --- a/app/src/main/java/emu/skyline/data/BaseElement.kt +++ b/app/src/main/java/emu/skyline/data/BaseElement.kt @@ -12,4 +12,4 @@ enum class ElementType { Item } -abstract class BaseElement(elementType : ElementType) : Serializable +abstract class BaseElement(val elementType : ElementType) : Serializable diff --git a/app/src/main/java/emu/skyline/input/ControllerActivity.kt b/app/src/main/java/emu/skyline/input/ControllerActivity.kt index 2b16c215..17c13408 100644 --- a/app/src/main/java/emu/skyline/input/ControllerActivity.kt +++ b/app/src/main/java/emu/skyline/input/ControllerActivity.kt @@ -9,6 +9,7 @@ import android.content.Intent import android.os.Bundle import android.view.KeyEvent import androidx.appcompat.app.AppCompatActivity +import androidx.preference.PreferenceManager import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.dialog.MaterialAlertDialogBuilder import emu.skyline.R @@ -46,6 +47,8 @@ class ControllerActivity : AppCompatActivity() { */ val axisMap = mutableMapOf() + private val sharedPrefs by lazy { PreferenceManager.getDefaultSharedPreferences(this) } + /** * This function updates the [adapter] based on information from [InputManager] */ @@ -62,8 +65,9 @@ class ControllerActivity : AppCompatActivity() { if (id == 0 && controller.type.firstController) { adapter.addItem(HeaderViewItem(getString(R.string.osc))) - adapter.addItem(ControllerCheckBoxViewItem(getString(R.string.osc_enable), getString(R.string.osc_not_shown), false) { item, position -> + adapter.addItem(ControllerCheckBoxViewItem(getString(R.string.osc_enable), getString(R.string.osc_not_shown), sharedPrefs.getBoolean("on_screen_control", false)) { item, position -> item.summary = getString(if (item.checked) R.string.osc_shown else R.string.osc_not_shown) + sharedPrefs.edit().putBoolean("on_screen_control", item.checked).apply() adapter.notifyItemChanged(position) }) diff --git a/app/src/main/java/emu/skyline/input/GuestEvent.kt b/app/src/main/java/emu/skyline/input/GuestEvent.kt index 1a939ff6..72cd4eb5 100644 --- a/app/src/main/java/emu/skyline/input/GuestEvent.kt +++ b/app/src/main/java/emu/skyline/input/GuestEvent.kt @@ -5,6 +5,7 @@ package emu.skyline.input +import emu.skyline.R.string import java.io.Serializable import java.util.* import kotlin.math.abs @@ -13,22 +14,22 @@ import kotlin.math.abs * This enumerates all of the buttons that the emulator recognizes */ enum class ButtonId(val short : String? = null, val long : Int? = null) { - A("A", emu.skyline.R.string.a_button), - B("B", emu.skyline.R.string.b_button), - X("X", emu.skyline.R.string.x_button), - Y("Y", emu.skyline.R.string.y_button), - LeftStick("L"), - RightStick("R"), - L("L", emu.skyline.R.string.left_shoulder), - R("R", emu.skyline.R.string.right_shoulder), - ZL("ZL", emu.skyline.R.string.left_trigger), - ZR("ZR", emu.skyline.R.string.right_trigger), - Plus("+", emu.skyline.R.string.plus_button), - Minus("-", emu.skyline.R.string.minus_button), - DpadLeft("◀", emu.skyline.R.string.left), - DpadUp("▲", emu.skyline.R.string.up), - DpadRight("▶", emu.skyline.R.string.right), - DpadDown("▼", emu.skyline.R.string.down), + A("A", string.a_button), + B("B", string.b_button), + X("X", string.x_button), + Y("Y", string.y_button), + LeftStick("L", string.left_stick), + RightStick("R", string.right_stick), + L("L", string.left_shoulder), + R("R", string.right_shoulder), + ZL("ZL", string.left_trigger), + ZR("ZR", string.right_trigger), + Plus("+", string.plus_button), + Minus("-", string.minus_button), + DpadLeft("◀", string.left), + DpadUp("▲", string.up), + DpadRight("▶", string.right), + DpadDown("▼", string.down), LeftStickLeft, LeftStickUp, LeftStickRight, @@ -37,11 +38,11 @@ enum class ButtonId(val short : String? = null, val long : Int? = null) { RightStickUp, RightStickRight, RightStickDown, - LeftSL("SL", emu.skyline.R.string.left_shoulder), - LeftSR("SR", emu.skyline.R.string.right_shoulder), - RightSL("SL", emu.skyline.R.string.left_shoulder), - RightSR("SR", emu.skyline.R.string.right_shoulder), - Menu("⌂", emu.skyline.R.string.emu_menu_button); + LeftSL("SL", string.left_shoulder), + LeftSR("SR", string.right_shoulder), + RightSL("SL", string.left_shoulder), + RightSR("SR", string.right_shoulder), + Menu("⌂", string.emu_menu_button); /** * This returns the value as setting the [ordinal]-th bit in a [Long] diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenConfiguration.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenConfiguration.kt index 9d716ccf..39588d4a 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenConfiguration.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenConfiguration.kt @@ -11,6 +11,7 @@ import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty interface ControllerConfiguration { + var enabled : Boolean var globalScale : Float var relativeX : Float var relativeY : Float @@ -20,6 +21,7 @@ class ControllerConfigurationDummy( defaultRelativeX : Float, defaultRelativeY : Float ) : ControllerConfiguration { + override var enabled = true override var globalScale = 1f override var relativeX = defaultRelativeX override var relativeY = defaultRelativeY @@ -31,10 +33,10 @@ class ControllerConfigurationImpl( defaultRelativeX : Float, defaultRelativeY : Float ) : ControllerConfiguration { - override var globalScale by ControllerPrefs(context, "on_screen_controller_", Float::class.java, 1f) - private inline fun config(default : T) = ControllerPrefs(context, "${buttonId.name}_", T::class.java, default) + override var enabled by config(true) + override var globalScale by ControllerPrefs(context, "on_screen_controller_", Float::class.java, 1f) override var relativeX by config(defaultRelativeX) override var relativeY by config(defaultRelativeY) } @@ -50,8 +52,8 @@ private class ControllerPrefs(context : Context, private val prefix : String, override fun setValue(thisRef : Any, property : KProperty<*>, value : T) { prefs.edit().apply { when (clazz) { - Float::class.java, - java.lang.Float::class.java -> putFloat(prefix + property.name, value as Float) + Float::class.java, java.lang.Float::class.java -> putFloat(prefix + property.name, value as Float) + Boolean::class.java, java.lang.Boolean::class.java -> putBoolean(prefix + property.name, value as Boolean) else -> error("Unsupported type $clazz ${Float::class.java}") } }.apply() @@ -59,10 +61,11 @@ private class ControllerPrefs(context : Context, private val prefix : String, override fun getValue(thisRef : Any, property : KProperty<*>) : T = prefs.let { + @Suppress("IMPLICIT_CAST_TO_ANY") when (clazz) { - Float::class.java, - java.lang.Float::class.java -> it.getFloat(prefix + property.name, default as Float) - else -> error("Unsupported type $clazz ${Float::class.java}") + Float::class.java, java.lang.Float::class.java -> it.getFloat(prefix + property.name, default as Float) + Boolean::class.java, java.lang.Boolean::class.java -> it.getBoolean(prefix + property.name, default as Boolean) + else -> error("Unsupported type $clazz") } } as T } diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt index e60b477d..1df3d25c 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenControllerView.kt @@ -36,10 +36,12 @@ class OnScreenControllerView @JvmOverloads constructor( override fun onDraw(canvas : Canvas) { super.onDraw(canvas) - (controls.circularButtons + controls.rectangularButtons + controls.triggerButtons + controls.joysticks).forEach { - it.width = width - it.height = height - it.render(canvas) + controls.allButtons.forEach { + if (it.config.enabled) { + it.width = width + it.height = height + it.render(canvas) + } } } @@ -63,7 +65,7 @@ class OnScreenControllerView @JvmOverloads constructor( } MotionEvent.ACTION_DOWN, MotionEvent.ACTION_POINTER_DOWN -> { - if (button.isTouched(x, y)) { + if (button.config.enabled && button.isTouched(x, y)) { button.touchPointerId = pointerId button.onFingerDown(x, y) performClick() @@ -120,7 +122,7 @@ class OnScreenControllerView @JvmOverloads constructor( } MotionEvent.ACTION_DOWN, MotionEvent.ACTION_POINTER_DOWN -> { - if (joystick.isTouched(x, y)) { + if (joystick.config.enabled && joystick.isTouched(x, y)) { joystickAnimators[joystick]?.cancel() joystickAnimators[joystick] = null joystick.touchPointerId = pointerId @@ -147,7 +149,7 @@ class OnScreenControllerView @JvmOverloads constructor( } private val editingTouchHandler = OnTouchListener { _, event -> - (controls.circularButtons + controls.rectangularButtons + controls.triggerButtons + controls.joysticks).any { button -> + controls.allButtons.any { button -> when (event.actionMasked) { MotionEvent.ACTION_UP, MotionEvent.ACTION_POINTER_UP, @@ -159,7 +161,7 @@ class OnScreenControllerView @JvmOverloads constructor( } MotionEvent.ACTION_DOWN, MotionEvent.ACTION_POINTER_DOWN -> { - if (button.isTouched(event.x, event.y)) { + if (button.config.enabled && button.isTouched(event.x, event.y)) { button.startEdit() performClick() return@any true @@ -183,7 +185,10 @@ class OnScreenControllerView @JvmOverloads constructor( fun setEditMode(editMode : Boolean) = setOnTouchListener(if (editMode) editingTouchHandler else playingTouchHandler) fun resetControls() { - (controls.circularButtons + controls.rectangularButtons + controls.triggerButtons + controls.joysticks).forEach { it.resetRelativeValues() } + controls.allButtons.forEach { + it.resetRelativeValues() + it.config.enabled = true + } controls.globalScale = 1f invalidate() } @@ -205,4 +210,11 @@ class OnScreenControllerView @JvmOverloads constructor( fun setOnStickStateChangedListener(listener : OnStickStateChangedListener) { onStickStateChangedListener = listener } + + fun getButtonProps() = controls.allButtons.map { Pair(it.buttonId, it.config.enabled) } + + fun setButtonEnabled(buttonId : ButtonId, enabled : Boolean) { + controls.allButtons.first { it.buttonId == buttonId }.config.enabled = enabled + invalidate() + } } \ No newline at end of file diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditActivity.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditActivity.kt index 389cf34b..ada47a5f 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditActivity.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditActivity.kt @@ -5,8 +5,113 @@ package emu.skyline.input.onscreen +import android.graphics.Color +import android.os.Build +import android.os.Bundle +import android.view.View +import android.view.WindowInsets +import android.view.WindowInsetsController import androidx.appcompat.app.AppCompatActivity +import androidx.core.content.ContextCompat +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.google.android.material.floatingactionbutton.FloatingActionButton +import emu.skyline.R +import kotlinx.android.synthetic.main.main_activity.fab_parent +import kotlinx.android.synthetic.main.on_screen_edit_activity.* class OnScreenEditActivity : AppCompatActivity() { + private var fullEditVisible = true + private var editMode = false + private val closeAction : () -> Unit = { + if (editMode) { + toggleFabVisibility(true) + on_screen_controller_view.setEditMode(false) + editMode = false + } else { + fullEditVisible = !fullEditVisible + toggleFabVisibility(fullEditVisible) + fabMapping[R.drawable.ic_close]!!.animate().rotationBy(if (fullEditVisible) -45f else 45f) + } + } + + private fun toggleFabVisibility(visible : Boolean) { + actions.forEach { + if (it.first != R.drawable.ic_close) + if (visible) fabMapping[it.first]!!.show() + else fabMapping[it.first]!!.hide() + } + } + + private val editAction = { + editMode = true + on_screen_controller_view.setEditMode(true) + toggleFabVisibility(false) + } + + private val toggleAction : () -> Unit = { + val buttonProps = on_screen_controller_view.getButtonProps() + val checkArray = buttonProps.map { it.second }.toBooleanArray() + + MaterialAlertDialogBuilder(this) + .setMultiChoiceItems(buttonProps.map { + val longText = getString(it.first.long!!) + if (it.first.short == longText) longText else "$longText: ${it.first.short}" + }.toTypedArray(), checkArray) { _, which, isChecked -> + checkArray[which] = isChecked + }.setPositiveButton(R.string.confirm) { _, _ -> + buttonProps.forEachIndexed { index, pair -> + if (checkArray[index] != pair.second) + on_screen_controller_view.setButtonEnabled(pair.first, checkArray[index]) + } + }.setNegativeButton(R.string.cancel, null) + .setOnDismissListener { fullScreen() } + .show() + } + + private val actions : List Unit>> = listOf( + Pair(R.drawable.ic_refresh, { on_screen_controller_view.resetControls() }), + Pair(R.drawable.ic_toggle, toggleAction), + Pair(R.drawable.ic_edit, editAction), + Pair(R.drawable.ic_zoom_out, { on_screen_controller_view.decreaseScale() }), + Pair(R.drawable.ic_zoom_in, { on_screen_controller_view.increaseScale() }), + Pair(R.drawable.ic_close, closeAction) + ) + + private val fabMapping = mutableMapOf() + + override fun onCreate(savedInstanceState : Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.on_screen_edit_activity) + + actions.forEach { pair -> + fab_parent.addView(FloatingActionButton(this).apply { + size = FloatingActionButton.SIZE_MINI + setColorFilter(Color.WHITE) + setImageDrawable(ContextCompat.getDrawable(context, pair.first)) + setOnClickListener { pair.second.invoke() } + fabMapping[pair.first] = this + }) + } + } + + override fun onResume() { + super.onResume() + fullScreen() + } + + private fun fullScreen() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + window.insetsController?.hide(WindowInsets.Type.navigationBars() or WindowInsets.Type.systemBars() or WindowInsets.Type.systemGestures() or WindowInsets.Type.statusBars()) + window.insetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE + } else { + @Suppress("DEPRECATION") + window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY + or View.SYSTEM_UI_FLAG_LAYOUT_STABLE + or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + or View.SYSTEM_UI_FLAG_FULLSCREEN) + } + } } diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenItemDefinitions.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenItemDefinitions.kt index 1a51b8f8..dba3def3 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenItemDefinitions.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenItemDefinitions.kt @@ -86,6 +86,7 @@ class JoystickButton( val secondTapDiff = currentTime - fingerUpTime if (firstTapDiff in 0..500 && secondTapDiff in 0..500) { shortDoubleTapped = true + drawable.alpha = 50 } fingerDownTime = currentTime } @@ -97,6 +98,7 @@ class JoystickButton( fingerUpTime = SystemClock.elapsedRealtime() shortDoubleTapped = false + drawable.alpha = 255 } fun onFingerMoved(x : Float, y : Float) : PointF { @@ -152,8 +154,7 @@ open class RectangularButton( defaultRelativeHeight, drawableId ) { - override fun isTouched(x : Float, y : Float) = - currentBounds.contains(x.roundToInt(), y.roundToInt()) + override fun isTouched(x : Float, y : Float) = currentBounds.contains(x.roundToInt(), y.roundToInt()) override fun onFingerDown(x : Float, y : Float) { drawable.alpha = (255 * 0.5f).roundToInt() @@ -217,6 +218,8 @@ class Controls(onScreenControllerView : OnScreenControllerView) { TriggerButton(onScreenControllerView, ZR, 0.9f, 0.1f, 0.075f, 0.08f) ) + val allButtons = circularButtons + joysticks + rectangularButtons + triggerButtons + /** * We can take any of the global scale variables from the buttons */ diff --git a/app/src/main/res/drawable/ic_button.xml b/app/src/main/res/drawable/ic_button.xml index 84e5688b..0e745b12 100644 --- a/app/src/main/res/drawable/ic_button.xml +++ b/app/src/main/res/drawable/ic_button.xml @@ -1,8 +1,8 @@ + android:shape="oval"> + android:width="2.5dp" + android:color="#A0FFFFFF" /> diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml new file mode 100644 index 00000000..13256e17 --- /dev/null +++ b/app/src/main/res/drawable/ic_close.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_edit.xml b/app/src/main/res/drawable/ic_edit.xml new file mode 100644 index 00000000..10f94811 --- /dev/null +++ b/app/src/main/res/drawable/ic_edit.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_rectangular_button.xml b/app/src/main/res/drawable/ic_rectangular_button.xml index 251af221..6fc96728 100644 --- a/app/src/main/res/drawable/ic_rectangular_button.xml +++ b/app/src/main/res/drawable/ic_rectangular_button.xml @@ -4,11 +4,11 @@ + android:width="2dp" + android:color="#A0FFFFFF" /> + android:width="25dp" + android:height="25dp" /> diff --git a/app/src/main/res/drawable/ic_stick.xml b/app/src/main/res/drawable/ic_stick.xml index 6b1011a1..43cd3feb 100644 --- a/app/src/main/res/drawable/ic_stick.xml +++ b/app/src/main/res/drawable/ic_stick.xml @@ -4,24 +4,24 @@ + android:width="2dp" + android:color="#A0FFFFFF" /> + android:width="25dp" + android:height="25dp" /> + android:bottom="10dp" + android:left="10dp" + android:right="10dp" + android:top="10dp" /> + android:width="30dp" + android:height="30dp" /> diff --git a/app/src/main/res/drawable/ic_stick_circle.xml b/app/src/main/res/drawable/ic_stick_circle.xml index 84e5688b..0e745b12 100644 --- a/app/src/main/res/drawable/ic_stick_circle.xml +++ b/app/src/main/res/drawable/ic_stick_circle.xml @@ -1,8 +1,8 @@ + android:shape="oval"> + android:width="2.5dp" + android:color="#A0FFFFFF" /> diff --git a/app/src/main/res/drawable/ic_toggle.xml b/app/src/main/res/drawable/ic_toggle.xml new file mode 100644 index 00000000..44a67e4c --- /dev/null +++ b/app/src/main/res/drawable/ic_toggle.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_trigger_button_left.xml b/app/src/main/res/drawable/ic_trigger_button_left.xml index 6b2ab5f7..91431b17 100644 --- a/app/src/main/res/drawable/ic_trigger_button_left.xml +++ b/app/src/main/res/drawable/ic_trigger_button_left.xml @@ -4,16 +4,16 @@ + android:width="2dp" + android:color="#A0FFFFFF" /> + android:width="25dp" + android:height="25dp" /> + android:bottomLeftRadius="10dp" + android:bottomRightRadius="10dp" + android:topLeftRadius="50dp" + android:topRightRadius="10dp" /> diff --git a/app/src/main/res/drawable/ic_trigger_button_right.xml b/app/src/main/res/drawable/ic_trigger_button_right.xml index 5403d742..748cbb73 100644 --- a/app/src/main/res/drawable/ic_trigger_button_right.xml +++ b/app/src/main/res/drawable/ic_trigger_button_right.xml @@ -4,16 +4,16 @@ + android:width="2dp" + android:color="#A0FFFFFF" /> + android:width="25dp" + android:height="25dp" /> + android:bottomLeftRadius="10dp" + android:bottomRightRadius="10dp" + android:topLeftRadius="10dp" + android:topRightRadius="50dp" /> diff --git a/app/src/main/res/drawable/ic_zoom_in.xml b/app/src/main/res/drawable/ic_zoom_in.xml new file mode 100644 index 00000000..d50a0ed1 --- /dev/null +++ b/app/src/main/res/drawable/ic_zoom_in.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_zoom_out.xml b/app/src/main/res/drawable/ic_zoom_out.xml new file mode 100644 index 00000000..8390cbe0 --- /dev/null +++ b/app/src/main/res/drawable/ic_zoom_out.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/layout/on_screen_edit_activity.xml b/app/src/main/res/layout/on_screen_edit_activity.xml new file mode 100644 index 00000000..6d42d697 --- /dev/null +++ b/app/src/main/res/layout/on_screen_edit_activity.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7c775bb3..90d388d1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -57,6 +57,9 @@ On-Screen Controls won\'t be shown On-Screen Controls will be shown Edit On-Screen Controls layout + Joystick + Confirm + Cancel Controller Configure Controller Controller Type @@ -106,6 +109,8 @@ Left Right D-pad + Left Stick + Right Stick Face Buttons Shoulder Buttons on Joy-Con Rail