Closed Doomsdayrs closed 2 years ago
Heya! Thanks a lot for the contribution! Only now I've found it on the repo, sorry for the late answer 🤦
Anyway, I know I shouldn't be using a BiFunction
like that hahaha 😅
I did it like that to keep the interoperability of the lib with Java without any extra libraries at all (not even kotlin-stdlib
).
As far as I've used the library myself, Kotlin seemed to have abstracted that (the BiFunction
instead of an actual lambda) away from me.
Even though internally it looks not-the-best-nor-the-most-professional-ever (aka "ugly af") that will prevent Java users of the library of needing to import kotlin-stdlib
.
That was the only reason I've done that ^^
I know this might be frustrating, but does this explain why it was done as it was?
I can alter the documentation (and comment the code as well) to explain this.
I'd love to know which use case or issue you ran into so that I could see if we can work out a solution :D
Once again, thanks a lot for the contribution! Your point is a good one!
You're going about this in a severely wrong way IMO.
Kotlin is a multi platform language. There is an MPP module so you can target different platforms.
The reason I made this PR is that BiFunction is not compatible with android. This PR addresses BiFunction specifically.
A PR that would fully fix the core issue is to make this a MP library that can target different platforms.
I was honestly horrified that you were checking for a class existing.
Thanks for the follow up =D
I'll try to address the points you brought up, let me know if I left something out 😀
QRCodeCanvas
. At v1
I had an issue where since the library would always use a BufferedImage
, which as far as I know doesn't exist in Android, and that would throw ClassNotFound
errors in runtime. Because of that, I rewrote the whole image rendering part of the library to support different platform-dependent implementations of renderers :)I hope to have addressed all your points! Let me know if I forgot something or if there is anything else!
About the BiFunction not existing on Android: Are you sure? It seems to exist: https://developer.android.com/reference/java/util/function/BiFunction - I might be wrong, it's been some years since I last developed Android stuff sweat_smile - Could you share more on which error were you having? Maybe I'm not understanding this properly disappointed
While it does exist, Cast from BiFunction to String requires API level 24 (current min is 22)
. It is not available for all versions for android.
About Kotlin Multiplatform: That looks like it'll address the previous point! I'll look into this and might implement this soon! I wasn't aware of this and your comment helped me find that - thanks!
If you need help, I am a Kotlin MP programmer, and have been worked on MP projects. I can happily convert the entire library on my free time.
I apologize if I was a bit harsh before, Your work with this library is great.
Cast from BiFunction to String requires API level 24 (current min is 22)
Android is weird hahaha... I'll change those to actual lambdas soon ^^
I can happily convert the entire library on my free time.
Don't worry! I'm really interested in the whole concept of the Kotlin Multiplatform Library thing and I'll most certainly implement it! I'd love to try it out!
I'll definitely get start implementing this over the weekend!
I apologize if I was a bit harsh before
It happens, thanks for following up on the discussion :)
Your work with this library is great.
Thanks a lot! This really means a lot to me :D - Even though this might look simple and all this is a passion project to me, and having even the smallest bits of recognition makes me very happy :P
Heya! Took me a while, but mind checking the new version of the library?
I'd love to have your input on how it is going!
Also, feel free to suggest any changes and improvements - I'm sure there's a lot to improve still hahahaha ^^
Finally, do you mind if I close the PR given that it might have been fixed by the whole v3.0.0 shtick?
Closing due to inactivity.
Please never use a java specific function like that.