-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove warning #18038
base: main
Are you sure you want to change the base?
Remove warning #18038
Conversation
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. |
can someone please review the changes and say why my changes got error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thank you for contributing, I left some issues to fix. Also, please squash the code this should consist of only one commit.
can someone please review the changes and say why my changes got error
The test is failing because you introduced breaking changes to the code. See review comments.
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.kt
Outdated
Show resolved
Hide resolved
@@ -160,7 +160,7 @@ object UsageAnalytics { | |||
Timber.d("getOptIn() status: %s", sOptIn) | |||
return sOptIn | |||
} | |||
private set(optIn) { | |||
set(optIn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert, this isn't a raised issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not an issue then don't change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant 'private' modifier as a warning
@@ -37,6 +37,8 @@ import timber.log.Timber | |||
* @see Backend.setActiveBrowserColumns | |||
* @see BrowserConfig.activeColumnsKey | |||
*/ | |||
|
|||
@Suppress("Unused", "KDocUnresolvedReference") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issues here shouldn't be suppressed, the proper imports should be added so the documentation references work. This mean importing the BrowserConfig and Backend classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import com.ichi2.libanki.BrowserConfig.ACTIVE_CARD_COLUMNS_KEY
import com.ichi2.libanki.BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY
as both have no usage if i import it a new warning will appear that's why did not import it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see but if you change the documentation to prefix the properties then it should work(I missed that the BrowserConfig class is already imported):
[BrowserConfig.ACTIVE_CARD_COLUMNS_KEY]
[BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY]
and for the other two:
* @see [Backend.setActiveBrowserColumns]
* @see [BrowserConfig.activeColumnsKey]
after importing the net.ankiweb.rsdroid.Backend class. Suppressing is not the proper way to fix these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, also please squash the commits into a single commit for merging.
/** | ||
* Returns the text stored in the clipboard or the empty string if the clipboard is empty or contains something that | ||
* cannot be converted to text. | ||
* | ||
* @return the text in clipboard or the empty string. | ||
*/ | ||
private fun clipboardGetText(): CharSequence { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also delete the documentation above for this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -13,9 +13,7 @@ | |||
* You should have received a copy of the GNU General Public License along with | |||
* this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change random spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i reverted it
@@ -37,6 +37,8 @@ import timber.log.Timber | |||
* @see Backend.setActiveBrowserColumns | |||
* @see BrowserConfig.activeColumnsKey | |||
*/ | |||
|
|||
@Suppress("Unused", "KDocUnresolvedReference") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see but if you change the documentation to prefix the properties then it should work(I missed that the BrowserConfig class is already imported):
[BrowserConfig.ACTIVE_CARD_COLUMNS_KEY]
[BrowserConfig.ACTIVE_NOTE_COLUMNS_KEY]
and for the other two:
* @see [Backend.setActiveBrowserColumns]
* @see [BrowserConfig.activeColumnsKey]
after importing the net.ankiweb.rsdroid.Backend class. Suppressing is not the proper way to fix these.
@@ -160,7 +160,7 @@ object UsageAnalytics { | |||
Timber.d("getOptIn() status: %s", sOptIn) | |||
return sOptIn | |||
} | |||
private set(optIn) { | |||
set(optIn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not an issue then don't change it.
f8decc9
to
8d20df9
Compare
final change
15a9b77
to
9ee3ca9
Compare
Purpose / Description
Reducing Android Studio warnings by cleaning up unused code and fixing initialization.
Fixes
Contributes towards Cleanup Fix Android Studio Warnings
Approach
By using android studio suggestions and deleting never used variables or using suppression
How Has This Been Tested?
I run my code after change on emulator android 11 it runs as previous
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