From f3dd3e53c1fb09729792f6e628a15495505eadb9 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Sat, 9 Jul 2022 16:54:09 +0200 Subject: [PATCH] Miscellaneous imports cleanup in `preference` package --- app/src/main/java/emu/skyline/MainActivity.kt | 3 +-- .../main/java/emu/skyline/preference/ControllerPreference.kt | 5 +++-- .../emu/skyline/preference/DocumentsProviderPreference.kt | 4 ++-- app/src/main/java/emu/skyline/preference/ThemePreference.kt | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/emu/skyline/MainActivity.kt b/app/src/main/java/emu/skyline/MainActivity.kt index fbf20bf2..21d164c1 100644 --- a/app/src/main/java/emu/skyline/MainActivity.kt +++ b/app/src/main/java/emu/skyline/MainActivity.kt @@ -34,12 +34,11 @@ import emu.skyline.databinding.MainActivityBinding import emu.skyline.loader.AppEntry import emu.skyline.loader.LoaderResult import emu.skyline.loader.RomFormat -import emu.skyline.utils.PreferenceSettings import emu.skyline.provider.DocumentsProvider +import emu.skyline.utils.PreferenceSettings import javax.inject.Inject import kotlin.math.ceil - @AndroidEntryPoint class MainActivity : AppCompatActivity() { companion object { diff --git a/app/src/main/java/emu/skyline/preference/ControllerPreference.kt b/app/src/main/java/emu/skyline/preference/ControllerPreference.kt index d81be85d..7cae3fdd 100644 --- a/app/src/main/java/emu/skyline/preference/ControllerPreference.kt +++ b/app/src/main/java/emu/skyline/preference/ControllerPreference.kt @@ -12,9 +12,10 @@ import androidx.activity.ComponentActivity import androidx.activity.result.contract.ActivityResultContracts import androidx.preference.Preference import androidx.preference.Preference.SummaryProvider -import emu.skyline.R +import androidx.preference.R import emu.skyline.di.getInputManager import emu.skyline.input.ControllerActivity +import emu.skyline.R as SkylineR /** * This preference is used to launch [ControllerActivity] using a preference @@ -52,7 +53,7 @@ class ControllerPreference @JvmOverloads constructor(context : Context, attrs : if (key == null) key = "controller_$index" - title = "${context.getString(R.string.config_controller)} #${index + 1}" + title = "${context.getString(SkylineR.string.config_controller)} #${index + 1}" summaryProvider = SummaryProvider { inputManager.controllers[index]!!.type.stringRes.let { context.getString(it) } } } diff --git a/app/src/main/java/emu/skyline/preference/DocumentsProviderPreference.kt b/app/src/main/java/emu/skyline/preference/DocumentsProviderPreference.kt index 5c68f68d..bc9ac53a 100644 --- a/app/src/main/java/emu/skyline/preference/DocumentsProviderPreference.kt +++ b/app/src/main/java/emu/skyline/preference/DocumentsProviderPreference.kt @@ -13,10 +13,10 @@ import android.util.AttributeSet import androidx.preference.Preference import androidx.preference.R import com.google.android.material.snackbar.Snackbar +import emu.skyline.R as SkylineR import emu.skyline.SettingsActivity import emu.skyline.provider.DocumentsProvider - class DocumentsProviderPreference @JvmOverloads constructor(context : Context, attrs : AttributeSet? = null, defStyleAttr : Int = R.attr.preferenceStyle) : Preference(context, attrs, defStyleAttr) { fun launchOpenIntent(action : String) : Boolean { return try { @@ -34,6 +34,6 @@ class DocumentsProviderPreference @JvmOverloads constructor(context : Context, a override fun onClick() { if (launchOpenIntent(Intent.ACTION_VIEW) or launchOpenIntent("android.provider.action.BROWSE")) return - Snackbar.make((context as SettingsActivity).binding.root, emu.skyline.R.string.failed_open_directory, Snackbar.LENGTH_SHORT).show() + Snackbar.make((context as SettingsActivity).binding.root, SkylineR.string.failed_open_directory, Snackbar.LENGTH_SHORT).show() } } diff --git a/app/src/main/java/emu/skyline/preference/ThemePreference.kt b/app/src/main/java/emu/skyline/preference/ThemePreference.kt index 42db3b79..142cc088 100644 --- a/app/src/main/java/emu/skyline/preference/ThemePreference.kt +++ b/app/src/main/java/emu/skyline/preference/ThemePreference.kt @@ -8,7 +8,6 @@ package emu.skyline.preference import android.content.Context import android.util.AttributeSet import androidx.appcompat.app.AppCompatDelegate -import androidx.preference.ListPreference import androidx.preference.R /**