Skip to content

Commit 3a55583

Browse files
authored
Disable linting for icon hiding code in preferences (commons-app#6519)
1 parent 717a855 commit 3a55583

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/fr/free/nrw/commons/settings/SettingsFragment.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package fr.free.nrw.commons.settings
22

33
import android.Manifest.permission
4+
import android.annotation.SuppressLint
45
import android.app.Activity
56
import android.app.Dialog
67
import android.content.Context.MODE_PRIVATE
@@ -303,6 +304,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
303304
)
304305
}
305306

307+
// Remove the space for icons in the settings menu.
308+
// This uses an internal API that shouldn't be used in app code,
309+
// but it appears to be the most robust way to do this at the moment,
310+
// disable the warning.
311+
@SuppressLint("RestrictedApi")
306312
override fun onCreateAdapter(preferenceScreen: PreferenceScreen): Adapter<PreferenceViewHolder>
307313
{
308314
return object : PreferenceGroupAdapter(preferenceScreen) {

0 commit comments

Comments
 (0)