mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
NativeLibrary: Create displayToastMsg Method
This commit is contained in:
@ -454,6 +454,14 @@ public final class NativeLibrary
|
||||
|
||||
private static native String GetCurrentTitleDescriptionUnchecked();
|
||||
|
||||
@Keep
|
||||
public static void displayToastMsg(final String text, final boolean long_length)
|
||||
{
|
||||
final int length = long_length ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT;
|
||||
new Handler(Looper.getMainLooper())
|
||||
.post(() -> Toast.makeText(DolphinApplication.getAppContext(), text, length).show());
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static boolean displayAlertMsg(final String caption, final String text,
|
||||
final boolean yesNo, final boolean isWarning, final boolean nonBlocking)
|
||||
@ -466,9 +474,7 @@ public final class NativeLibrary
|
||||
// and are allowed to block. As a fallback, we can use toasts.
|
||||
if (emulationActivity == null || nonBlocking)
|
||||
{
|
||||
new Handler(Looper.getMainLooper()).post(
|
||||
() -> Toast.makeText(DolphinApplication.getAppContext(), text, Toast.LENGTH_LONG)
|
||||
.show());
|
||||
displayToastMsg(text, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user