Disable linting for icon hiding code in preferences (#6519)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled

This commit is contained in:
Amir E. Aharoni 2025-10-18 00:51:46 -04:00 committed by GitHub
parent 717a855149
commit 3a55583460
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
package fr.free.nrw.commons.settings package fr.free.nrw.commons.settings
import android.Manifest.permission import android.Manifest.permission
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context.MODE_PRIVATE import android.content.Context.MODE_PRIVATE
@ -303,6 +304,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
) )
} }
// Remove the space for icons in the settings menu.
// This uses an internal API that shouldn't be used in app code,
// but it appears to be the most robust way to do this at the moment,
// disable the warning.
@SuppressLint("RestrictedApi")
override fun onCreateAdapter(preferenceScreen: PreferenceScreen): Adapter<PreferenceViewHolder> override fun onCreateAdapter(preferenceScreen: PreferenceScreen): Adapter<PreferenceViewHolder>
{ {
return object : PreferenceGroupAdapter(preferenceScreen) { return object : PreferenceGroupAdapter(preferenceScreen) {