mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Android: Convert SystemMenuNotInstalledDialogFragment to Kotlin
This commit is contained in:
parent
c8907349be
commit
0ac4fe763b
@ -1,34 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.dolphinemu.dolphinemu.features.sysupdate.ui;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
|
||||
public class SystemMenuNotInstalledDialogFragment extends DialogFragment
|
||||
{
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState)
|
||||
{
|
||||
return new MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.system_menu_not_installed_title)
|
||||
.setMessage(R.string.system_menu_not_installed_message)
|
||||
.setPositiveButton(R.string.yes, (dialog, which) ->
|
||||
{
|
||||
FragmentManager fragmentManager = getParentFragmentManager();
|
||||
OnlineUpdateRegionSelectDialogFragment dialogFragment =
|
||||
new OnlineUpdateRegionSelectDialogFragment();
|
||||
dialogFragment.show(fragmentManager, "OnlineUpdateRegionSelectDialogFragment");
|
||||
dismiss();
|
||||
})
|
||||
.setNegativeButton(R.string.no, (dialog, which) -> dismiss())
|
||||
.create();
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.dolphinemu.dolphinemu.features.sysupdate.ui
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import org.dolphinemu.dolphinemu.R
|
||||
|
||||
class SystemMenuNotInstalledDialogFragment : DialogFragment() {
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.system_menu_not_installed_title)
|
||||
.setMessage(R.string.system_menu_not_installed_message)
|
||||
.setPositiveButton(R.string.yes) { _: DialogInterface?, _: Int ->
|
||||
OnlineUpdateRegionSelectDialogFragment().show(
|
||||
parentFragmentManager,
|
||||
"OnlineUpdateRegionSelectDialogFragment"
|
||||
)
|
||||
dismiss()
|
||||
}
|
||||
.setNegativeButton(R.string.no) { _: DialogInterface?, _: Int -> dismiss() }
|
||||
.create()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user