Android: Convert RunRunnable to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-15 03:28:32 -04:00
parent 62679bacc1
commit 1fc9f03b27
2 changed files with 24 additions and 59 deletions

View File

@ -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();
}
}

View File

@ -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()
}