-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Convert several Java files to Kotlin #2493
Conversation
Yes, some of it is ok to change to Kotlin. Prefs is, ApplicationConstants is. However, The reason why |
So if you revert the changes not related to these two files, I can merge it. |
If you feel like helping out by doing some small refactorings, there is something else that could be done - decoupling the data-side of quests (more) from UI and Android: TaskFor the cycleway quest, the cycleway answer options are cleanly seperated into two files: This is better than how it is done for for example the surface quest (and others). There, in Exampleenum class Surface(val value: String) { // or osmValue?
ASPHALT("asphalt"),
...
}
// in SurfaceItem.kt
fun Surface.asItem(): Item<Surface> = ... ReasonApart from it being good style, it is a step towards making #1892 a little less work to do |
(If you are up for it, I can create a ticket for that so it can be properly referred to) |
I'm not sure how much time that will take for a Kotlin novice like me, but I will try :) |
👍 thanks, merged! |
Are any of the remaining Java files eligible to be converted to Kotlin? Critical → should not be convertedCould be extracted into a library → should not be converted
Dagger 2 can't find these as Kotlin files → should not be convertedRemaining → ❓ |
Serializer is closely related to KryoSerializer... and it is just 2 lines of code |
|
Maybe there is a more kotlin-y way to do that. Something like |
I hope this kind of PR is fine for you. I followed these steps for each of the commits:
Please tell me if I missed any obvious "idiomatic Kotlin" opportunities, as I'm new to Kotlin.