Hide control panels in landscape mode when title screen is visible

This commit is contained in:
cmclark00 2025-04-01 23:50:47 -04:00
parent 212e52aea8
commit ff1a0edd2f
2 changed files with 28 additions and 14 deletions

View file

@ -297,8 +297,6 @@ class TitleScreen @JvmOverloads constructor(
}
override fun onTouchEvent(event: MotionEvent): Boolean {
val isLandscape = resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE
when (event.action) {
MotionEvent.ACTION_DOWN -> {
startX = event.x
@ -308,22 +306,18 @@ class TitleScreen @JvmOverloads constructor(
return true
}
MotionEvent.ACTION_MOVE -> {
// Skip tetromino movement in landscape mode
if (!isLandscape) {
val deltaX = event.x - lastTouchX
val deltaY = event.y - lastTouchY
// Update tetromino positions
for (tetromino in tetrominos) {
tetromino.x += deltaX * 0.5f
tetromino.y += deltaY * 0.5f
}
invalidate()
val deltaX = event.x - lastTouchX
val deltaY = event.y - lastTouchY
// Update tetromino positions
for (tetromino in tetrominos) {
tetromino.x += deltaX * 0.5f
tetromino.y += deltaY * 0.5f
}
lastTouchX = event.x
lastTouchY = event.y
invalidate()
return true
}
MotionEvent.ACTION_UP -> {