Skip to content

Comments

code cleanup in FilteredDeckOptins.kt and AppcompatPreferenceActivity.kt#20047

Closed
ialwaysbeatmywifi wants to merge 1 commit intoankidroid:mainfrom
ialwaysbeatmywifi:cleanup/fix-android-studio-warnings-13282
Closed

code cleanup in FilteredDeckOptins.kt and AppcompatPreferenceActivity.kt#20047
ialwaysbeatmywifi wants to merge 1 commit intoankidroid:mainfrom
ialwaysbeatmywifi:cleanup/fix-android-studio-warnings-13282

Conversation

@ialwaysbeatmywifi
Copy link

Purpose / Description

This PR addresses Android Studio IDE warnings about unnecessary wrapper class usage.

Fixes

Approach

Replaced unnecessary Java wrapper class calls with native Kotlin methods:

  1. FilteredDeckOptions.kt:

    • Changed java.lang.Boolean.toString(true)true.toString()
    • Changed java.lang.Boolean.toString(false)false.toString()
    • Changed java.lang.Boolean.toString(deck.getBoolean(...))deck.getBoolean(...).toString()
  2. AppCompatPreferenceActivity.kt:

    • Simplified boolean parsing from java.lang.Boolean.parseBoolean(this.getString(key, java.lang.Boolean.toString(defValue))) to this.getString(key, defValue.toString()).toBoolean()

How Has This Been Tested?

./gradlew ktlintFormat and ./gradlew Libanki:test do the work

Learning (optional, can help others)

mentioned in the issue itself no any knowledge req

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@ialwaysbeatmywifi
Copy link
Author

@david-allison when time permits please approve

@david-allison
Copy link
Member

Thanks!!!!

It's been 3 minutes, no need for a ping

@BrayanDSO
Copy link
Member

both files are being replaced at #19669, so no need to review this

@BrayanDSO BrayanDSO closed this Jan 8, 2026
@ialwaysbeatmywifi
Copy link
Author

thanx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cleanup]: Fix Android Studio Warnings

3 participants