diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-05-16 21:18:10 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:06:02 +0200 |
commit | 8d3288b6ff7067cde2b8199c941454638eb40f18 (patch) | |
tree | cbdd02a874235ec9a1bba5aa78fa77ebbd95eca7 /src/android/app | |
parent | android: Use cutout insets on setup fragment (diff) | |
download | yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar.gz yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar.bz2 yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar.lz yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar.xz yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.tar.zst yuzu-8d3288b6ff7067cde2b8199c941454638eb40f18.zip |
Diffstat (limited to 'src/android/app')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index 8e3422922..961b5b822 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt @@ -164,9 +164,15 @@ class MainActivity : AppCompatActivity(), ThemeProvider { binding.navigationView.height.toFloat() * 2 translationY(0f) } else { - binding.navigationView.translationX = - binding.navigationView.width.toFloat() * -2 - translationX(0f) + if (ViewCompat.getLayoutDirection(binding.navigationView) == ViewCompat.LAYOUT_DIRECTION_LTR) { + binding.navigationView.translationX = + binding.navigationView.width.toFloat() * -2 + translationX(0f) + } else { + binding.navigationView.translationX = + binding.navigationView.width.toFloat() * 2 + translationX(0f) + } } } else { duration = 300 @@ -175,7 +181,11 @@ class MainActivity : AppCompatActivity(), ThemeProvider { if (smallLayout) { translationY(binding.navigationView.height.toFloat() * 2) } else { - translationX(binding.navigationView.width.toFloat() * -2) + if (ViewCompat.getLayoutDirection(binding.navigationView) == ViewCompat.LAYOUT_DIRECTION_LTR) { + translationX(binding.navigationView.width.toFloat() * -2) + } else { + translationX(binding.navigationView.width.toFloat() * 2) + } } } }.withEndAction { |