Skip to content
Permalink
Browse files
Merge pull request #11494 from t895/orientation-jank
Android: Rewrite Wii system updates in Kotlin
  • Loading branch information
lioncash committed Mar 8, 2023
2 parents 0b9002e + 75ce7a0 commit f1e4b6a
Show file tree
Hide file tree
Showing 14 changed files with 384 additions and 513 deletions.
@@ -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'

This file was deleted.

@@ -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.

@@ -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.

0 comments on commit f1e4b6a

Please sign in to comment.