Suppress or resolve common warnings

This commit is contained in:
Abandoned Cart 2023-04-21 09:48:28 -04:00 committed by Billy Laws
parent 97694e639a
commit fe4ccd1ee0
8 changed files with 13 additions and 9 deletions

View File

@ -78,7 +78,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
/**
* 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]
@ -108,7 +108,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
@Inject
lateinit var appSettings : AppSettings
lateinit var emulationSettings : EmulationSettings
private lateinit var emulationSettings : EmulationSettings
@Inject
lateinit var inputManager : InputManager

View File

@ -7,7 +7,6 @@ package emu.skyline.adapter
import android.app.Dialog
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.View

View File

@ -5,6 +5,7 @@
package emu.skyline.adapter
import android.annotation.SuppressLint
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import emu.skyline.data.GpuDriverMetadata
@ -24,6 +25,7 @@ open class GpuDriverViewItem(
override fun getViewBindingFactory() = GpuDriverBindingFactory
@SuppressLint("SetTextI18n")
override fun bind(holder : GenericViewHolder<GpuDriverItemBinding>, position : Int) {
this.holder = holder
val binding = holder.binding

View File

@ -25,6 +25,7 @@ val OutsideOfMiiNicknameCodepoints = getCodepointArray('@', '%', '\\', 'ō', 'Ō
data class KeyboardMode(
var mode : u32 = 0u
) : ByteBufferSerializable {
@Suppress("unused")
companion object {
val Full = KeyboardMode(0u)
val Numeric = KeyboardMode(1u)
@ -118,6 +119,7 @@ data class PasswordMode(
data class InputFormMode(
var mode : u32 = 0u
) : ByteBufferSerializable {
@Suppress("unused")
companion object {
val OneLine = InputFormMode(0u)
val MultiLine = InputFormMode(1u)
@ -144,6 +146,7 @@ data class DictionaryInfo(
/**
* This data class matches KeyboardConfigVB in skyline/applet/swkbd/software_keyboard_config.h
*/
@Suppress("ArrayInDataClass")
data class SoftwareKeyboardConfig(
var keyboardMode : KeyboardMode = KeyboardMode(),
@param:ByteBufferSerializable.ByteBufferSerializableArray(0x9) val okText : CharArray = CharArray(0x9),

View File

@ -18,7 +18,7 @@ import emu.skyline.settings.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 {
private fun launchOpenIntent(action : String) : Boolean {
return try {
val intent = Intent(action)
intent.addCategory(Intent.CATEGORY_DEFAULT)

View File

@ -4,6 +4,7 @@
*/
@file:OptIn(ExperimentalUnsignedTypes::class)
@file:Suppress("SERIAL")
package emu.skyline.utils
@ -111,6 +112,7 @@ interface ByteBufferSerializable : Parcelable {
/**
* 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<*, *>>) {
companion object {
fun getSerializationData(kClass : KClass<*>) : ByteBufferSerializationData {
@ -233,7 +235,7 @@ interface ByteBufferSerializable : Parcelable {
}
companion object {
@JvmField
@JvmField @Suppress("unused")
val CREATOR : ParcelableCreator = ParcelableCreator()
/**

View File

@ -15,14 +15,12 @@ inline fun <reified T : Parcelable> Bundle.parcelable(key: String): T? = when {
else -> @Suppress("DEPRECATION") getParcelable(key) as? T
}
@Suppress("unused")
inline fun <reified T : Parcelable> Intent.parcelable(key: String): T? = when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> getParcelableExtra(key, T::class.java)
else -> @Suppress("DEPRECATION") getParcelableExtra(key) as? T
}
@Suppress("unused")
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)
else -> @Suppress("DEPRECATION") getParcelableArrayListExtra(key)
}
}

View File

@ -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
val basePadding = object {
val left = view.paddingLeft