mirror of
https://github.com/rafaelvcaetano/melonDS-android.git
synced 2025-02-23 07:10:51 +00:00
Update Kotlin and some AndroidX libraries
This commit is contained in:
parent
077a8c7913
commit
fb60821484
@ -105,7 +105,7 @@ class BackgroundsActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.backgrounds_menu, menu)
|
||||
return true
|
||||
}
|
||||
|
@ -359,6 +359,7 @@ class EmulatorActivity : AppCompatActivity(), RendererListener {
|
||||
newParams.bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
newParams.rightToRight = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
}
|
||||
FpsCounterPosition.HIDDEN -> { /* Do nothing here */ }
|
||||
}
|
||||
binding.textFps.layoutParams = newParams
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ abstract class FrontendInputHandler : IInputListener {
|
||||
Input.QUICK_SAVE -> onQuickSave()
|
||||
Input.QUICK_LOAD -> onQuickLoad()
|
||||
Input.REWIND -> onRewind()
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,10 +97,7 @@ class RomListActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
if (menu == null)
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.rom_list_menu, menu)
|
||||
|
||||
val searchItem = menu.findItem(R.id.action_search_roms)
|
||||
|
@ -67,12 +67,10 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat?, pref: Preference?): Boolean {
|
||||
if (pref == null) {
|
||||
return false
|
||||
}
|
||||
override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat, pref: Preference): Boolean {
|
||||
val fragmentClassName = pref.fragment ?: return false
|
||||
|
||||
val fragment = supportFragmentManager.fragmentFactory.instantiate(ClassLoader.getSystemClassLoader(), pref.fragment).apply {
|
||||
val fragment = supportFragmentManager.fragmentFactory.instantiate(ClassLoader.getSystemClassLoader(), fragmentClassName).apply {
|
||||
arguments = pref.extras
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class GeneralPreferencesFragment : PreferenceFragmentCompat(), PreferenceFragmen
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
// Set proper value for Rewind preference since the value is not updated when returning from the fragment
|
||||
rewindPreference.onPreferenceChangeListener.onPreferenceChange(rewindPreference, rewindPreference.sharedPreferences.getBoolean(rewindPreference.key, false))
|
||||
rewindPreference.onPreferenceChangeListener?.onPreferenceChange(rewindPreference, rewindPreference.sharedPreferences?.getBoolean(rewindPreference.key, false))
|
||||
}
|
||||
|
||||
override fun getTitle() = getString(R.string.category_general)
|
||||
|
@ -41,6 +41,6 @@ class SystemPreferencesFragment : PreferenceFragmentCompat(), PreferenceFragment
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
// Set proper value for Custom BIOS option when returning from the fragment. Let's just pretend this is not here
|
||||
customBiosPreference.onPreferenceChangeListener.onPreferenceChange(customBiosPreference, customBiosPreference.sharedPreferences.getBoolean(customBiosPreference.key, false))
|
||||
customBiosPreference.onPreferenceChangeListener?.onPreferenceChange(customBiosPreference, customBiosPreference.sharedPreferences?.getBoolean(customBiosPreference.key, false))
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ import me.magnum.melonds.domain.model.ConfigurationDirResult
|
||||
import me.magnum.melonds.domain.model.ConsoleType
|
||||
import me.magnum.melonds.ui.settings.FileStatusPopup
|
||||
|
||||
class BiosDirectoryPickerPreference(context: Context?, attrs: AttributeSet?) : StoragePickerPreference(context, attrs) {
|
||||
class BiosDirectoryPickerPreference(context: Context, attrs: AttributeSet?) : StoragePickerPreference(context, attrs) {
|
||||
interface BiosDirectoryValidator {
|
||||
fun getBiosDirectoryValidationResult(consoleType: ConsoleType, directory: Uri?): ConfigurationDirResult
|
||||
}
|
||||
@ -46,7 +46,7 @@ class BiosDirectoryPickerPreference(context: Context?, attrs: AttributeSet?) : S
|
||||
validateDirectory(uri)
|
||||
}
|
||||
|
||||
override fun onDependencyChanged(dependency: Preference?, disableDependent: Boolean) {
|
||||
override fun onDependencyChanged(dependency: Preference, disableDependent: Boolean) {
|
||||
super.onDependencyChanged(dependency, disableDependent)
|
||||
imageViewStatus?.isGone = disableDependent
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import me.magnum.melonds.R
|
||||
import me.magnum.melonds.databinding.DialogFirmwareBirthdayBinding
|
||||
import java.text.NumberFormat
|
||||
|
||||
class FirmwareBirthdayPreference(context: Context?, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
class FirmwareBirthdayPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
companion object {
|
||||
private val daysInMonth = mapOf(
|
||||
1 to 31,
|
||||
|
@ -13,7 +13,7 @@ import me.magnum.melonds.R
|
||||
import me.magnum.melonds.databinding.DialogFirmwareColourPickerBinding
|
||||
import me.magnum.melonds.domain.model.FirmwareColour
|
||||
|
||||
class FirmwareColourPickerPreference(context: Context?, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
class FirmwareColourPickerPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
companion object {
|
||||
private val colorMapper = mapOf(
|
||||
FirmwareColour.GRAY to 0x61829A,
|
||||
@ -74,11 +74,10 @@ class FirmwareColourPickerPreference(context: Context?, attrs: AttributeSet?) :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: PreferenceViewHolder?) {
|
||||
override fun onBindViewHolder(holder: PreferenceViewHolder) {
|
||||
super.onBindViewHolder(holder)
|
||||
if (holder != null) {
|
||||
|
||||
viewSelectedColour = holder.findViewById(R.id.viewSelectedColour)
|
||||
updateSelectedColour(getPersistedInt(0))
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ import me.magnum.melonds.databinding.DialogMacAddressEditorBinding
|
||||
import me.magnum.melonds.domain.model.MacAddress
|
||||
import kotlin.random.Random
|
||||
|
||||
class MacAddressPreference(context: Context?, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
class MacAddressPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
private val random = Random(System.nanoTime())
|
||||
private var currentMacAddress: MacAddress? = null
|
||||
|
||||
|
@ -7,7 +7,7 @@ import androidx.preference.Preference
|
||||
import me.magnum.melonds.R
|
||||
import me.magnum.melonds.common.Permission
|
||||
|
||||
open class StoragePickerPreference(context: Context?, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
open class StoragePickerPreference(context: Context, attrs: AttributeSet?) : Preference(context, attrs) {
|
||||
enum class SelectionType {
|
||||
FILE,
|
||||
DIRECTORY
|
||||
|
@ -5,7 +5,7 @@ import androidx.preference.Preference
|
||||
class CompositeOnPreferenceChangeListener : Preference.OnPreferenceChangeListener {
|
||||
private val listeners = mutableListOf<Preference.OnPreferenceChangeListener>()
|
||||
|
||||
override fun onPreferenceChange(preference: Preference?, newValue: Any?): Boolean {
|
||||
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
|
||||
val allListenersReturnedTrue = listeners.all { it.onPreferenceChange(preference, newValue) }
|
||||
return allListenersReturnedTrue
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ object Dependencies {
|
||||
const val AppCompat = "1.3.0"
|
||||
const val CardView = "1.0.0"
|
||||
const val CommonsCompress = "1.21"
|
||||
const val ConstraintLayout = "2.0.4"
|
||||
const val Core = "1.6.0"
|
||||
const val ConstraintLayout = "2.1.4"
|
||||
const val Core = "1.8.0"
|
||||
const val Desugar = "1.1.5"
|
||||
const val DocumentFile = "1.0.1"
|
||||
const val Flexbox = "3.0.0"
|
||||
@ -13,23 +13,22 @@ object Dependencies {
|
||||
const val Gradle = "7.0.0"
|
||||
const val Gson = "2.8.6"
|
||||
const val HiltX = "1.0.0"
|
||||
const val Hilt = "2.38.1"
|
||||
const val Hilt = "2.42"
|
||||
const val Junit = "4.12"
|
||||
const val Kotlin = "1.5.10"
|
||||
const val Kotlin = "1.7.10"
|
||||
const val KotlinxCoroutinesRx = "1.6.4"
|
||||
const val LifecycleExtensions = "2.0.0"
|
||||
const val LifecycleViewModel = "2.3.1"
|
||||
const val MasterSwitchPreference = "0.9.4"
|
||||
const val LifecycleExtensions = "2.2.0"
|
||||
const val LifecycleViewModel = "2.5.1"
|
||||
const val Material = "1.4.0"
|
||||
const val Picasso = "2.71828"
|
||||
const val Preference = "1.1.1"
|
||||
const val Preference = "1.2.0"
|
||||
const val RecyclerView = "1.2.1"
|
||||
const val Room = "2.3.0"
|
||||
const val Room = "2.4.3"
|
||||
const val RxAndroid = "2.1.1"
|
||||
const val RxJava = "2.2.10"
|
||||
const val Splashscreen = "1.0.0-beta01"
|
||||
const val SwipeRefreshLayout = "1.1.0"
|
||||
const val Work = "2.7.0"
|
||||
const val Work = "2.7.1"
|
||||
const val Markwon = "4.6.2"
|
||||
const val Retrofit = "2.9.0"
|
||||
const val Xz = "1.9"
|
||||
|
Loading…
x
Reference in New Issue
Block a user