Anki-Android
Anki-Android copied to clipboard
Kotlin Cleanup
Currently, there are 84 @KotlinCleanup in AnkiDroid code source. Most of those changes are supposed to be simple to do and would be a good pull request by themselves. Also, if you are a java developer and new to Kotlin, it will be a great way to learn Kotlin advantages, since it's usually tasks that were introduced when translating java to Kotlin, and which can actually be improved in Kotlin compared to original java code.
Ideally, each PR should contains a single cleanup. This ensure the PR is very very quick to review and merge. The main exception would be if a clean-up is dependent on another clean-up and this would cause merge conflict.
i would like to work on this
Sounds good! IMO it's not worth assigning to this one as there's so much to do and it'd be great to get other people on this at the same time
Ideally one PR per class - just let us know which one you're working on so someone else doesn't work on it at the same time
Working on CustomStudyDialog.kt
I would like some help concerning the second part of this KotlinCleanup https://github.com/ankidroid/Anki-Android/blob/a9ca2cfa854d999e5e4cbe905239b9109f1aee9c/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialog.kt#L343-L417
What exactly is meant by "mapping dialogID to an enum"?
- IMO, the only thing that would make sense is replacing the CONTEXT_MENU_* and all other fields of the companion object (see below) with two seperate enums (One for the context menu configuration and one for the context menu options). However this would be a huge change across this file.
- Introducing an additional enum which dialogID will get mapped to before entering the when statement would be the alternative. This feels dirty to me due to code duplication
https://github.com/ankidroid/Anki-Android/blob/a9ca2cfa854d999e5e4cbe905239b9109f1aee9c/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialog.kt#L500-L520
I would also like to work on it. So basically, I have to go through each class marked with @KotlinCleanup and convert ko Kotlin making sure that changes don't break and pass all the tests.
I would also like to work on it. So basically, I have to go through each class marked with @KotlinCleanup and convert ko Kotlin making sure that changes don't break and pass all the tests.
Well, you just need to find one @KotlinCleanup that is not the one @kilitr is working on, and correct it. Please don't try to solve all clean up in a single PR, that would be very hard to review
@kilitr Please do the thing that makes sens to you. This guidance is true all of the time actually. It's easy to be not clear, to miss a nuance, while writtings todo/issues, that is only really catched while implementing the code. It's quite rare that we require something to be done exactly the way we required it, and it never occurs that we are not willing to discuss our demands. So, if you do the work and that you find an idea that is great, feel free to do it. We can always discuss it in details during the code review. The only case where I would really want you to ask for permission before doing the work is if the work will take you hours; and it's only because that will avoid you to write code during hours and then lose all of this works when the PR gets closed without being merged
Currently I'm working on DeckPickerFloatingActionMenu.kt
Other working on this issue, please mention which class/file they are working on.
Currently, I'm working on CardTemplatePreviewer.kt.
Others also please mention which files they are working on to avoid merge conflicts.
Currently, I'm working on
CardTemplatePreviewer.kt. Others also please mention which files they are working on to avoid merge conflicts.
Just FYI: conflicts with https://github.com/ankidroid/Anki-Android/pull/10526
Currently, I'm working on
CardTemplatePreviewer.kt. Others also please mention which files they are working on to avoid merge conflicts.Just FYI: conflicts with #10526
Thanks, I didn't notice it.
Currently, I'm working on LanguageUtils.kt.
Heya, I'll take on cleaning up ImportUtils.kt
@Arthur-Milchior @mikehardy. @david-allison Sir can i work on AsyncDialogFragment,kt
@Arthur-Milchior @mikehardy. @david-allison Sir can i work on AsyncDialogFragment,kt
Sure, and no need for the "sir" 😇
I also want to work on it . can you please assign it to me
Sounds good! IMO it's not worth assigning to this one as there's so much to do and it'd be great to get other people on this at the same time
Ideally one PR per class - just let us know which one you're working on so someone else doesn't work on it at the same time
https://github.com/ankidroid/Anki-Android/issues/10489#issuecomment-1065610715
Can anyone tell me what exactly I have to do in this issue?
Can anyone tell me what exactly I have to do in this issue?
Search the entire codebase for @KotlinCleanup("Description") annotations... read and understand the description and resolve whatever issue was pointed out in the Description.
One basic example that you'll come across very often is removing nullability from a certain Field.

So for example: in the above codebase what exactly I have to do?
anyone could explain what exactly I have to do in the above codebase?
d needs a rename (or a scope function)
@david-allison Is there anything left in this issue?? I would like to work on it.
Started tackling MyAccount.kt's various cleanup tasks. Might have a PR in later once I verify that the tests pass.
I am facing this issue while setting up the project can you plese help me out and i wanna convert Taskmangaer.java async task to kotlin coroutines as i am intrested in the project async task to coroutines

I am facing this issue while setting up the project can you plese help me out and i wanna convert Taskmangaer.java async task to kotlin coroutines as i am intrested in the project async task to coroutines
What version of Android Studio are you using?
@david-allison Is there anything left in this issue?? I would like to work on it.
Lots to do - just state the class you're working on so you don't get conflicts
Heya👋!
I am currently working on Kotlin Cleanup for Counts.kt.
File link : https://github.com/ankidroid/Anki-Android/blob/main/AnkiDroid/src/main/java/com/ichi2/libanki/sched/Counts.kt
I am facing this issue while setting up the project can you plese help me out and i wanna convert Taskmangaer.java async task to kotlin coroutines as i am intrested in the project async task to coroutines
What version of Android Studio are you using?

it is showing this error but i already set the sdk path in local.properties

Currently, I am working on Kotlin Cleanup for HelpDialog.kt