From 90ac08c98d7ccc1207e46a818248b43541bf891b Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Sat, 3 Jun 2023 20:40:54 -0400 Subject: [PATCH] Android: Convert NVidiaShieldWorkaroundView to Kotlin --- .../ui/NVidiaShieldWorkaroundView.java | 27 ------------------- .../ui/NVidiaShieldWorkaroundView.kt | 21 +++++++++++++++ 2 files changed, 21 insertions(+), 27 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.java deleted file mode 100644 index 4b4b763c2b..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013 Dolphin Emulator Project - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -package org.dolphinemu.dolphinemu.ui; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.View; - -/** - * Work around a bug with the nVidia Shield. - * - * Without this View, the emulation SurfaceView acts like it has the - * highest Z-value, blocking any other View, such as the menu fragments. - */ -public final class NVidiaShieldWorkaroundView extends View -{ - public NVidiaShieldWorkaroundView(Context context, AttributeSet attrs) - { - super(context, attrs); - - // Setting this seems to workaround the bug - setWillNotDraw(false); - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.kt new file mode 100644 index 0000000000..16679e2c5f --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/NVidiaShieldWorkaroundView.kt @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.ui + +import android.content.Context +import android.util.AttributeSet +import android.view.View + +/** + * Work around a bug with the nVidia Shield. + * + * + * Without this View, the emulation SurfaceView acts like it has the + * highest Z-value, blocking any other View, such as the menu fragments. + */ +class NVidiaShieldWorkaroundView(context: Context?, attrs: AttributeSet?) : View(context, attrs) { + init { + // Setting this seems to workaround the bug + setWillNotDraw(false) + } +}