mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Android: Convert RunRunnable to Kotlin
This commit is contained in:
parent
62679bacc1
commit
1fc9f03b27
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -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()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user