mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-01 04:25:07 +01:00
Suppress or resolve common warnings
This commit is contained in:
parent
97694e639a
commit
fe4ccd1ee0
@ -78,7 +78,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
|||||||
/**
|
/**
|
||||||
* The built-in [Vibrator] of the device
|
* The built-in [Vibrator] of the device
|
||||||
*/
|
*/
|
||||||
lateinit var builtinVibrator : Vibrator
|
private lateinit var builtinVibrator : Vibrator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of [Vibrator]s that correspond to [InputManager.controllers]
|
* A map of [Vibrator]s that correspond to [InputManager.controllers]
|
||||||
@ -108,7 +108,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
|||||||
@Inject
|
@Inject
|
||||||
lateinit var appSettings : AppSettings
|
lateinit var appSettings : AppSettings
|
||||||
|
|
||||||
lateinit var emulationSettings : EmulationSettings
|
private lateinit var emulationSettings : EmulationSettings
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var inputManager : InputManager
|
lateinit var inputManager : InputManager
|
||||||
|
@ -7,7 +7,6 @@ package emu.skyline.adapter
|
|||||||
|
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package emu.skyline.adapter
|
package emu.skyline.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import emu.skyline.data.GpuDriverMetadata
|
import emu.skyline.data.GpuDriverMetadata
|
||||||
@ -24,6 +25,7 @@ open class GpuDriverViewItem(
|
|||||||
|
|
||||||
override fun getViewBindingFactory() = GpuDriverBindingFactory
|
override fun getViewBindingFactory() = GpuDriverBindingFactory
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
override fun bind(holder : GenericViewHolder<GpuDriverItemBinding>, position : Int) {
|
override fun bind(holder : GenericViewHolder<GpuDriverItemBinding>, position : Int) {
|
||||||
this.holder = holder
|
this.holder = holder
|
||||||
val binding = holder.binding
|
val binding = holder.binding
|
||||||
|
@ -25,6 +25,7 @@ val OutsideOfMiiNicknameCodepoints = getCodepointArray('@', '%', '\\', 'ō', 'Ō
|
|||||||
data class KeyboardMode(
|
data class KeyboardMode(
|
||||||
var mode : u32 = 0u
|
var mode : u32 = 0u
|
||||||
) : ByteBufferSerializable {
|
) : ByteBufferSerializable {
|
||||||
|
@Suppress("unused")
|
||||||
companion object {
|
companion object {
|
||||||
val Full = KeyboardMode(0u)
|
val Full = KeyboardMode(0u)
|
||||||
val Numeric = KeyboardMode(1u)
|
val Numeric = KeyboardMode(1u)
|
||||||
@ -118,6 +119,7 @@ data class PasswordMode(
|
|||||||
data class InputFormMode(
|
data class InputFormMode(
|
||||||
var mode : u32 = 0u
|
var mode : u32 = 0u
|
||||||
) : ByteBufferSerializable {
|
) : ByteBufferSerializable {
|
||||||
|
@Suppress("unused")
|
||||||
companion object {
|
companion object {
|
||||||
val OneLine = InputFormMode(0u)
|
val OneLine = InputFormMode(0u)
|
||||||
val MultiLine = InputFormMode(1u)
|
val MultiLine = InputFormMode(1u)
|
||||||
@ -144,6 +146,7 @@ data class DictionaryInfo(
|
|||||||
/**
|
/**
|
||||||
* This data class matches KeyboardConfigVB in skyline/applet/swkbd/software_keyboard_config.h
|
* This data class matches KeyboardConfigVB in skyline/applet/swkbd/software_keyboard_config.h
|
||||||
*/
|
*/
|
||||||
|
@Suppress("ArrayInDataClass")
|
||||||
data class SoftwareKeyboardConfig(
|
data class SoftwareKeyboardConfig(
|
||||||
var keyboardMode : KeyboardMode = KeyboardMode(),
|
var keyboardMode : KeyboardMode = KeyboardMode(),
|
||||||
@param:ByteBufferSerializable.ByteBufferSerializableArray(0x9) val okText : CharArray = CharArray(0x9),
|
@param:ByteBufferSerializable.ByteBufferSerializableArray(0x9) val okText : CharArray = CharArray(0x9),
|
||||||
|
@ -18,7 +18,7 @@ import emu.skyline.settings.SettingsActivity
|
|||||||
import emu.skyline.provider.DocumentsProvider
|
import emu.skyline.provider.DocumentsProvider
|
||||||
|
|
||||||
class DocumentsProviderPreference @JvmOverloads constructor(context : Context, attrs : AttributeSet? = null, defStyleAttr : Int = R.attr.preferenceStyle) : Preference(context, attrs, defStyleAttr) {
|
class DocumentsProviderPreference @JvmOverloads constructor(context : Context, attrs : AttributeSet? = null, defStyleAttr : Int = R.attr.preferenceStyle) : Preference(context, attrs, defStyleAttr) {
|
||||||
fun launchOpenIntent(action : String) : Boolean {
|
private fun launchOpenIntent(action : String) : Boolean {
|
||||||
return try {
|
return try {
|
||||||
val intent = Intent(action)
|
val intent = Intent(action)
|
||||||
intent.addCategory(Intent.CATEGORY_DEFAULT)
|
intent.addCategory(Intent.CATEGORY_DEFAULT)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@file:OptIn(ExperimentalUnsignedTypes::class)
|
@file:OptIn(ExperimentalUnsignedTypes::class)
|
||||||
|
@file:Suppress("SERIAL")
|
||||||
|
|
||||||
package emu.skyline.utils
|
package emu.skyline.utils
|
||||||
|
|
||||||
@ -111,6 +112,7 @@ interface ByteBufferSerializable : Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Holds information about the constructor of the classes and the properties for serialization
|
* Holds information about the constructor of the classes and the properties for serialization
|
||||||
*/
|
*/
|
||||||
|
@Suppress("ArrayInDataClass")
|
||||||
private data class ByteBufferSerializationData(val bytes : Int, val classesAndSizes : Array<ClassAndSize>, val properties : Array<KProperty1<*, *>>) {
|
private data class ByteBufferSerializationData(val bytes : Int, val classesAndSizes : Array<ClassAndSize>, val properties : Array<KProperty1<*, *>>) {
|
||||||
companion object {
|
companion object {
|
||||||
fun getSerializationData(kClass : KClass<*>) : ByteBufferSerializationData {
|
fun getSerializationData(kClass : KClass<*>) : ByteBufferSerializationData {
|
||||||
@ -233,7 +235,7 @@ interface ByteBufferSerializable : Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField
|
@JvmField @Suppress("unused")
|
||||||
val CREATOR : ParcelableCreator = ParcelableCreator()
|
val CREATOR : ParcelableCreator = ParcelableCreator()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,13 +15,11 @@ inline fun <reified T : Parcelable> Bundle.parcelable(key: String): T? = when {
|
|||||||
else -> @Suppress("DEPRECATION") getParcelable(key) as? T
|
else -> @Suppress("DEPRECATION") getParcelable(key) as? T
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
inline fun <reified T : Parcelable> Intent.parcelable(key: String): T? = when {
|
inline fun <reified T : Parcelable> Intent.parcelable(key: String): T? = when {
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getParcelableExtra(key, T::class.java)
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getParcelableExtra(key, T::class.java)
|
||||||
else -> @Suppress("DEPRECATION") getParcelableExtra(key) as? T
|
else -> @Suppress("DEPRECATION") getParcelableExtra(key) as? T
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
inline fun <reified T : Parcelable> Intent.parcelableArrayList(key: String): ArrayList<T>? = when {
|
inline fun <reified T : Parcelable> Intent.parcelableArrayList(key: String): ArrayList<T>? = when {
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getParcelableArrayListExtra(key, T::class.java)
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getParcelableArrayListExtra(key, T::class.java)
|
||||||
else -> @Suppress("DEPRECATION") getParcelableArrayListExtra(key)
|
else -> @Suppress("DEPRECATION") getParcelableArrayListExtra(key)
|
||||||
|
@ -75,7 +75,7 @@ interface WindowInsetsHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addPadding(view : View, consume : Boolean = true, left : Boolean = false, top : Boolean = false, right : Boolean = false, bottom : Boolean = false) {
|
private fun addPadding(view : View, consume : Boolean = true, left : Boolean = false, top : Boolean = false, right : Boolean = false, bottom : Boolean = false) {
|
||||||
// Save initial padding values to avoid adding to the initial padding multiple times
|
// Save initial padding values to avoid adding to the initial padding multiple times
|
||||||
val basePadding = object {
|
val basePadding = object {
|
||||||
val left = view.paddingLeft
|
val left = view.paddingLeft
|
||||||
|
Loading…
Reference in New Issue
Block a user