Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Rewrite Wii system updates in Kotlin #11494

Merged
merged 11 commits into from
Mar 8, 2023
6 changes: 4 additions & 2 deletions Source/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ dependencies {
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.profileinstaller:profileinstaller:1.2.2'

// Force dependency version to solve build conflict with androidx preferences
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
// Kotlin extensions for lifecycle components
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'

// Android TV UI libraries.
implementation 'androidx.leanback:leanback:1.0.0'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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 androidx.lifecycle.ViewModelProvider
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.dolphinemu.dolphinemu.R

class OnlineUpdateRegionSelectDialogFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val items = arrayOf(
getString(R.string.country_europe),
getString(R.string.country_japan),
getString(R.string.country_korea),
getString(R.string.country_usa)
)
val checkedItem = -1
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.region_select_title)
.setSingleChoiceItems(items, checkedItem) { _: DialogInterface?, which: Int ->
val viewModel =
ViewModelProvider(requireActivity())[SystemUpdateViewModel::class.java]
viewModel.region = which
SystemUpdateProgressBarDialogFragment().show(
parentFragmentManager,
SystemUpdateProgressBarDialogFragment.TAG
)
dismiss()
}
.create()
}

companion object {
const val TAG = "OnlineUpdateRegionSelectDialogFragment"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.TAG
)
dismiss()
}
.setNegativeButton(R.string.no) { _: DialogInterface?, _: Int -> dismiss() }
.create()
}

companion object {
const val TAG = "SystemMenuNotInstalledDialogFragment"
}
}

This file was deleted.