android-gif-drawable
android-gif-drawable copied to clipboard
#457: Converted java to Kotlin
Fixes: https://github.com/koral--/android-gif-drawable/issues/457
@koral-- Let me know if more comments on the review. I have resolved the comments couple of days back.
Changes are looking very good. Great work!
I plan to add some binary compatibility checker https://plugins.gradle.org/search?term=binary-compatibility and depending on the results decide whether it will be version 2.x or we can keep the backwards compatibility and stick to 1.x. Some minor changes like changing the visibility to internal may be required next.
I'll try to do that in a few days from now.
Hi @rahul13agrawal I've just added https://github.com/Kotlin/binary-compatibility-validator. You can rebase on the latest dev and execute the gradle tasks:
-
apiCheck
- this will give you a diff in terminal -
apiDump
- this will overwrite the current apiDump file so you can inspect the git diff in your Android Studio or whatever you prefer
It is perfectly OK that some method or class gets added. It will happen for e.g. all companion objects. But, if signature of the method, class or field has changed it can break the compatibility for existing users. The diff is quite large now, but here are some easily fixable insights:
- classes become final by default in kotlin, so we need to add
open
modifiers, this also applies to methods - some fields like
GifError.description
were replaced by methods, you can probably use@JvmField
for them - some extra methods are added like
GifDrawable.setMIsRunning
which should probably not be part of an API
@koral-- I will go through this by this weekend.
Hi @koral-- Sorry for such late response. I have rebase with the latest changes but whenever I run ./gradlew apiCheck
or apiDump
I get build successful. I am unable to find any changes. Neither in Android Studio nor in the terminal.
I have gone through https://github.com/Kotlin/binary-compatibility-validator and tried to check but with no result.
Indeed, it seems that disabling the check in the sample module only causes disabling it entirely. I need to investigate this.
In the meantime you can comment out or delete this line: https://github.com/koral--/android-gif-drawable/blob/dev/sample/build.gradle#L65 and ignore the generate dump of the sample module.