diff --git a/app/src/main/java/emu/skyline/EmulationActivity.kt b/app/src/main/java/emu/skyline/EmulationActivity.kt index 0d4fc8c6..6c6054e9 100644 --- a/app/src/main/java/emu/skyline/EmulationActivity.kt +++ b/app/src/main/java/emu/skyline/EmulationActivity.kt @@ -214,11 +214,11 @@ 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.isGone = !InputManager.controllers[0]!!.type.firstController || !settings.onScreenControl + on_screen_controller_view.isGone = InputManager.controllers[0]!!.type == ControllerType.None || !settings.onScreenControl on_screen_controller_view.setOnButtonStateChangedListener(::onButtonStateChanged) on_screen_controller_view.setOnStickStateChangedListener(::onStickStateChanged) - on_screen_controller_toggle.isGone = on_screen_controller_toggle.isGone + on_screen_controller_toggle.isGone = on_screen_controller_view.isGone on_screen_controller_toggle.setOnClickListener { on_screen_controller_view.isInvisible = !on_screen_controller_view.isInvisible } diff --git a/app/src/main/java/emu/skyline/adapter/controller/ControllerCheckBoxViewItem.kt b/app/src/main/java/emu/skyline/adapter/controller/ControllerCheckBoxViewItem.kt index b414eb20..42dac04e 100644 --- a/app/src/main/java/emu/skyline/adapter/controller/ControllerCheckBoxViewItem.kt +++ b/app/src/main/java/emu/skyline/adapter/controller/ControllerCheckBoxViewItem.kt @@ -11,8 +11,8 @@ import android.view.ViewGroup import androidx.core.view.isGone import emu.skyline.R import emu.skyline.adapter.GenericLayoutFactory -import emu.skyline.adapter.GenericViewHolder import emu.skyline.adapter.GenericListItem +import emu.skyline.adapter.GenericViewHolder import kotlinx.android.synthetic.main.controller_checkbox_item.* private object ControllerCheckBoxLayoutFactory : GenericLayoutFactory { @@ -33,4 +33,8 @@ class ControllerCheckBoxViewItem(var title : String, var summary : String, var c onCheckedChange.invoke(this, position) } } + + override fun areItemsTheSame(other : GenericListItem) = other is ControllerCheckBoxViewItem + + override fun areContentsTheSame(other : GenericListItem) = other is ControllerCheckBoxViewItem && title == other.title && summary == other.summary && checked == other.checked } diff --git a/app/src/main/java/emu/skyline/adapter/controller/ControllerViewItem.kt b/app/src/main/java/emu/skyline/adapter/controller/ControllerViewItem.kt index 72a3c3c9..4187cfd3 100644 --- a/app/src/main/java/emu/skyline/adapter/controller/ControllerViewItem.kt +++ b/app/src/main/java/emu/skyline/adapter/controller/ControllerViewItem.kt @@ -38,4 +38,8 @@ open class ControllerViewItem(var content : String = "", var subContent : String } fun update() = adapter?.notifyItemChanged(position) + + override fun areItemsTheSame(other : GenericListItem) = other is ControllerViewItem + + override fun areContentsTheSame(other : GenericListItem) = other is ControllerViewItem && content == other.content && subContent == other.subContent } diff --git a/app/src/main/java/emu/skyline/input/ControllerActivity.kt b/app/src/main/java/emu/skyline/input/ControllerActivity.kt index f4b1e9e8..5c66ae81 100644 --- a/app/src/main/java/emu/skyline/input/ControllerActivity.kt +++ b/app/src/main/java/emu/skyline/input/ControllerActivity.kt @@ -65,7 +65,7 @@ class ControllerActivity : AppCompatActivity() { if (controller.type == ControllerType.None) return - if (id == 0 && controller.type.firstController) { + if (id == 0) { items.add(HeaderViewItem(getString(R.string.osc))) val oscSummary = { checked : Boolean -> getString(if (checked) R.string.osc_shown else R.string.osc_not_shown) } diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 37612925..c93da0a0 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -1,5 +1,5 @@ #FF424242 - @android:color/black + #FF121212 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a5ad29d7..42a61c48 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,7 +60,7 @@ Joystick Confirm Cancel - Recenter sticks on touch + Recenter Sticks On Touch Controller Configure Controller Controller Type