From 1fc9f03b273cd6b79618e4933757c75c22aa6472 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 15 Mar 2023 03:28:32 -0400 Subject: [PATCH] Android: Convert RunRunnable to Kotlin --- .../settings/model/view/RunRunnable.java | 59 ------------------- .../settings/model/view/RunRunnable.kt | 24 ++++++++ 2 files changed, 24 insertions(+), 59 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.java deleted file mode 100644 index c83d4e292e..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.java +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.model.view; - -import android.content.Context; - -import org.dolphinemu.dolphinemu.NativeLibrary; -import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; - -public final class RunRunnable extends SettingsItem -{ - private final int mAlertText; - private final int mToastTextAfterRun; - private final boolean mWorksDuringEmulation; - private final Runnable mRunnable; - - public RunRunnable(Context context, int titleId, int descriptionId, int alertText, - int toastTextAfterRun, boolean worksDuringEmulation, Runnable runnable) - { - super(context, titleId, descriptionId); - mAlertText = alertText; - mToastTextAfterRun = toastTextAfterRun; - mWorksDuringEmulation = worksDuringEmulation; - mRunnable = runnable; - } - - public int getAlertText() - { - return mAlertText; - } - - public int getToastTextAfterRun() - { - return mToastTextAfterRun; - } - - public Runnable getRunnable() - { - return mRunnable; - } - - @Override - public int getType() - { - return TYPE_RUN_RUNNABLE; - } - - @Override - public AbstractSetting getSetting() - { - return null; - } - - @Override - public boolean isEditable() - { - return mWorksDuringEmulation || !NativeLibrary.IsRunning(); - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.kt new file mode 100644 index 0000000000..f9d5786e22 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RunRunnable.kt @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.model.view + +import android.content.Context +import org.dolphinemu.dolphinemu.NativeLibrary +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting + +class RunRunnable( + context: Context, + titleId: Int, + descriptionId: Int, + val alertText: Int, + val toastTextAfterRun: Int, + private val worksDuringEmulation: Boolean, + val runnable: Runnable +) : SettingsItem(context, titleId, descriptionId) { + override val type: Int = TYPE_RUN_RUNNABLE + + override val setting: AbstractSetting? = null + + override val isEditable: Boolean + get() = worksDuringEmulation || !NativeLibrary.IsRunning() +}