diff options
| author | JMC47 <JMC4789@gmail.com> | 2020-09-16 16:42:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-16 16:42:04 -0400 |
| commit | 6ada03fca2e5f8a55992d5c9fd35c91e2825fff7 (patch) | |
| tree | 2934cc50e9deed32cf56aa6d4c6ee408b49a6e07 /Source/Android | |
| parent | 097a4f4ecf8db18737ee64d4721fd46d98695302 (diff) | |
| parent | 161f99b864795bf714941e981ad4032c6f50855e (diff) | |
Merge pull request #9075 from JosJuice/android-osd-left-margin
Android: Move OSD out of the way when menu is open
Diffstat (limited to 'Source/Android')
3 files changed, 29 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java index 86e75d55ec..a03376bb8a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -431,6 +431,10 @@ public final class NativeLibrary public static native String FormatSize(long bytes, int decimals); + public static native void SetObscuredPixelsLeft(int width); + + public static native void SetObscuredPixelsTop(int height); + private static boolean alertResult = false; public static boolean displayAlertMsg(final String caption, final String text, diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java index f468240c4d..3badbd3e48 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java @@ -137,6 +137,11 @@ public final class MenuFragment extends Fragment implements View.OnClickListener mTitleText.setText(title); } + if (getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) + { + rootView.post(() -> NativeLibrary.SetObscuredPixelsLeft(rootView.getWidth())); + } + return rootView; } @@ -156,6 +161,14 @@ public final class MenuFragment extends Fragment implements View.OnClickListener options.findViewById(R.id.menu_emulation_load_root).setVisibility(savestateVisibility); } + @Override + public void onDestroyView() + { + super.onDestroyView(); + + NativeLibrary.SetObscuredPixelsLeft(0); + } + private void updatePauseUnpauseVisibility() { boolean paused = EmulationActivity.getHasUserPausedEmulation(); diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 3dfafacf7c..25df43dc20 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -671,6 +671,18 @@ JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_FormatSiz return ToJString(env, UICommon::FormatSize(bytes, decimals)); } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetObscuredPixelsLeft( + JNIEnv* env, jobject obj, jint width) +{ + OSD::SetObscuredPixelsLeft(width); +} + +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetObscuredPixelsTop( + JNIEnv* env, jobject obj, jint height) +{ + OSD::SetObscuredPixelsTop(height); +} + #ifdef __cplusplus } #endif |
