Android: Convert SystemMenuNotInstalledDialogFragment to Kotlin

This commit is contained in:
Charles Lombardo 2023-01-25 14:03:48 -05:00
parent c8907349be
commit 0ac4fe763b
2 changed files with 27 additions and 34 deletions

View File

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

View File

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