Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cleanup]: Resolve Android Studio Warnings (#13282) #17648

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Siddheshjondhale
Copy link

@Siddheshjondhale Siddheshjondhale commented Dec 22, 2024

Purpose / Description

Reducing Android Studio warnings by cleaning up unused code and fixing initialization.

Fixes

Approach

  • Made the unmountReceiver property private in AppCompatPreferenceActivity.kt.
  • Removed the unused import (import androidx.activity.addCallback) in CardTemplateBrowserAppearanceEditor.kt.
  • Removed the unused property editedModelFileName in CardTemplateNotetype.kt.
  • Fixed the unresolved reference to BuildConfig in CardTemplateNotetype.kt.
  • Made the legacyAnkiDroidDirectory property private in CollectionHelper.kt.
  • Removed the unused property fieldsAsBundleForPreview in NoteEditor.kt.
  • Fixed the initialization of activity in RtlCompliantActionProvider.kt by assigning it immediately during declaration, rather than inside the init block. This ensures proper initialization and avoids potential issues.

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have performed a self-review of your own code

Copy link

welcome bot commented Dec 22, 2024

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one issue to fix and then we can merge this.

@@ -22,6 +22,7 @@ import android.os.Bundle
import android.os.Parcel
import android.os.Parcelable
import androidx.core.os.bundleOf
import com.arcao.slf4j.timber.BuildConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this added?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed and squash merged

@lukstbit lukstbit added the Needs Author Reply Waiting for a reply from the original author label Dec 24, 2024
Removed unused imports and properties
Made some properties private for encapsulation
Fixed unresolved references (e.g., BuildConfig)
Simplified 'activity' initialization

removed unused import
@Siddheshjondhale Siddheshjondhale force-pushed the fix-activity-initialization-and-code-cleanup branch from 0dc96ff to a0b1f48 Compare December 24, 2024 14:56
Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lukstbit lukstbit added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Second Approval Has one approval, one more approval to merge New contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants