Skip to content

Commit f6bc617

Browse files
david-allisonlukstbit
authored andcommitted
refactor(crash-dialog): simplify preferences access
1 parent 8486c2f commit f6bc617

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

AnkiDroid/src/main/java/com/ichi2/anki/analytics/AnkiDroidCrashReportDialog.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,13 @@ class AnkiDroidCrashReportDialog :
6464
* Build the custom view used by the dialog
6565
*/
6666
override fun buildCustomView(savedInstanceState: Bundle?): View {
67-
val preferences = this.sharedPrefs()
6867
val inflater = layoutInflater
6968

7069
@SuppressLint("InflateParams")
7170
val rootView = // when you inflate into an alert dialog, you have no parent view
7271
inflater.inflate(R.layout.feedback, null)
7372
alwaysReportCheckBox = rootView.findViewById(R.id.alwaysReportCheckbox)
74-
alwaysReportCheckBox?.isChecked = preferences.getBoolean("autoreportCheckboxValue", true)
73+
alwaysReportCheckBox?.isChecked = sharedPrefs().getBoolean("autoreportCheckboxValue", true)
7574
userComment = rootView.findViewById(R.id.etFeedbackText)
7675
// Set user comment if reloading after the activity has been stopped
7776
savedInstanceState?.getString(STATE_COMMENT)?.let { savedComment ->

0 commit comments

Comments
 (0)