diff options
Diffstat (limited to '')
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 598a9d42b..07bd78bf7 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | |||
| @@ -15,6 +15,7 @@ import android.net.Uri | |||
| 15 | import android.os.Bundle | 15 | import android.os.Bundle |
| 16 | import android.os.Handler | 16 | import android.os.Handler |
| 17 | import android.os.Looper | 17 | import android.os.Looper |
| 18 | import android.os.SystemClock | ||
| 18 | import android.view.* | 19 | import android.view.* |
| 19 | import android.widget.TextView | 20 | import android.widget.TextView |
| 20 | import android.widget.Toast | 21 | import android.widget.Toast |
| @@ -25,6 +26,7 @@ import androidx.core.graphics.Insets | |||
| 25 | import androidx.core.view.ViewCompat | 26 | import androidx.core.view.ViewCompat |
| 26 | import androidx.core.view.WindowInsetsCompat | 27 | import androidx.core.view.WindowInsetsCompat |
| 27 | import androidx.drawerlayout.widget.DrawerLayout | 28 | import androidx.drawerlayout.widget.DrawerLayout |
| 29 | import androidx.drawerlayout.widget.DrawerLayout.DrawerListener | ||
| 28 | import androidx.fragment.app.Fragment | 30 | import androidx.fragment.app.Fragment |
| 29 | import androidx.fragment.app.activityViewModels | 31 | import androidx.fragment.app.activityViewModels |
| 30 | import androidx.lifecycle.Lifecycle | 32 | import androidx.lifecycle.Lifecycle |
| @@ -156,6 +158,32 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 156 | binding.showFpsText.setTextColor(Color.YELLOW) | 158 | binding.showFpsText.setTextColor(Color.YELLOW) |
| 157 | binding.doneControlConfig.setOnClickListener { stopConfiguringControls() } | 159 | binding.doneControlConfig.setOnClickListener { stopConfiguringControls() } |
| 158 | 160 | ||
| 161 | binding.drawerLayout.addDrawerListener(object : DrawerListener { | ||
| 162 | override fun onDrawerSlide(drawerView: View, slideOffset: Float) { | ||
| 163 | binding.surfaceInputOverlay.dispatchTouchEvent( | ||
| 164 | MotionEvent.obtain( | ||
| 165 | SystemClock.uptimeMillis(), | ||
| 166 | SystemClock.uptimeMillis() + 100, | ||
| 167 | MotionEvent.ACTION_UP, | ||
| 168 | 0f, | ||
| 169 | 0f, | ||
| 170 | 0 | ||
| 171 | ) | ||
| 172 | ) | ||
| 173 | } | ||
| 174 | |||
| 175 | override fun onDrawerOpened(drawerView: View) { | ||
| 176 | // No op | ||
| 177 | } | ||
| 178 | |||
| 179 | override fun onDrawerClosed(drawerView: View) { | ||
| 180 | // No op | ||
| 181 | } | ||
| 182 | |||
| 183 | override fun onDrawerStateChanged(newState: Int) { | ||
| 184 | // No op | ||
| 185 | } | ||
| 186 | }) | ||
| 159 | binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) | 187 | binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) |
| 160 | binding.inGameMenu.getHeaderView(0).findViewById<TextView>(R.id.text_game_title).text = | 188 | binding.inGameMenu.getHeaderView(0).findViewById<TextView>(R.id.text_game_title).text = |
| 161 | game.title | 189 | game.title |