Skip to content

Commit 5992033

Browse files
committed
chore : lint fix
- Removed unused constants which were there in `Pref` - Removed the redundant override method from `Settings Activity`. - Removed unused parameter requireActivity from `Setting Fragment`
1 parent 038ae9a commit 5992033

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

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

-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package fr.free.nrw.commons.settings
22

33
object Prefs {
4-
const val GLOBAL_PREFS = "fr.free.nrw.commons.preferences"
5-
6-
const val TRACKING_ENABLED = "eventLogging"
74
const val DEFAULT_LICENSE = "defaultLicense"
8-
const val UPLOADS_SHOWING = "uploadsShowing"
95
const val MANAGED_EXIF_TAGS = "managed_exif_tags"
106
const val DESCRIPTION_LANGUAGE = "languageDescription"
117
const val APP_UI_LANGUAGE = "appUiLanguage"

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

-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import fr.free.nrw.commons.theme.BaseActivity
1212
class SettingsActivity : BaseActivity() {
1313

1414
private lateinit var binding: ActivitySettingsBinding
15-
// private var settingsDelegate: AppCompatDelegate? = null
1615

1716
/**
1817
* to be called when the activity starts
@@ -28,19 +27,6 @@ class SettingsActivity : BaseActivity() {
2827
supportActionBar?.setDisplayHomeAsUpEnabled(true)
2928
}
3029

31-
// Get an action bar
32-
/**
33-
* takes care of actions taken after the creation has happened
34-
* @param savedInstanceState the saved state
35-
*/
36-
override fun onPostCreate(savedInstanceState: Bundle?) {
37-
super.onPostCreate(savedInstanceState)
38-
// if (settingsDelegate == null) {
39-
// settingsDelegate = AppCompatDelegate.create(this, null)
40-
// }
41-
// settingsDelegate?.onPostCreate(savedInstanceState)
42-
}
43-
4430
override fun onSupportNavigateUp(): Boolean {
4531
onBackPressed()
4632
return true

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package fr.free.nrw.commons.settings
22

33
import android.Manifest.permission
4-
import android.annotation.SuppressLint
54
import android.app.Activity
65
import android.app.Dialog
76
import android.content.Context.MODE_PRIVATE
@@ -11,7 +10,6 @@ import android.net.Uri
1110
import android.os.Bundle
1211
import android.text.Editable
1312
import android.text.TextWatcher
14-
import android.view.KeyEvent
1513
import android.view.View
1614
import android.widget.AdapterView
1715
import android.widget.Button
@@ -131,7 +129,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
131129
inAppCameraLocationPref?.setOnPreferenceChangeListener { _, newValue ->
132130
val isInAppCameraLocationTurnedOn = newValue as Boolean
133131
if (isInAppCameraLocationTurnedOn) {
134-
createDialogsAndHandleLocationPermissions(requireActivity())
132+
createDialogsAndHandleLocationPermissions()
135133
}
136134
true
137135
}
@@ -256,7 +254,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
256254
*
257255
* @param activity
258256
*/
259-
private fun createDialogsAndHandleLocationPermissions(activity: Activity) {
257+
private fun createDialogsAndHandleLocationPermissions() {
260258
inAppCameraLocationPermissionLauncher.launch(arrayOf(permission.ACCESS_FINE_LOCATION))
261259
}
262260

@@ -284,7 +282,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
284282
return object : PreferenceGroupAdapter(preferenceScreen) {
285283
override fun onBindViewHolder(holder: PreferenceViewHolder, position: Int) {
286284
super.onBindViewHolder(holder, position)
287-
val preference = getItem(position)
288285
val iconFrame: View? = holder.itemView.findViewById(R.id.icon_frame)
289286
iconFrame?.visibility = View.GONE
290287
}

0 commit comments

Comments
 (0)