[BUG] - setOnSetImageUriCompleteListener can't use lambda form anymore for the interface OnSetImageUriCompleteListener
See original GitHub issue- Lib Version [e.g. 1.1.0] 2.3.0
Describe the bug When it was in Java, I could use :
cropImageView.setOnSetImageUriCompleteListener { _, _, error ->
...
Now I have to use :
cropImageView.setOnSetImageUriCompleteListener(object : CropImageView.OnSetImageUriCompleteListener {
override fun onSetImageUriComplete(view: CropImageView, uri: Uri, error: Exception?) {
To Reproduce
- Just try the code I wrote above, of before this version and after.
Expected behavior Should still allow to do it.
Screenshots No need
Smartphone (please complete the following information): None.
Additional context I think whoever converted to Kotlin didn’t look enough at the resulting code… To fix this, I think it’s possible to use “fun interface” instead of just “interface”. This should be added for each interface in the project that has a single function.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Troubleshoot networking issues in Lambda
Depending on the issue, you might see a specific error or timeout if a request can't reach its destination. VPC: Function loses internet...
Read more >Cannot use lambda functions in Android with Java 1.8
I had this problem when I was using consumers, and the way I fixed it was to create my own clown of java.util.function.Consumer...
Read more >Lambda Expressions (The Java™ Tutorials > Learning the ...
Lambda expressions let you express instances of single-method classes more ... Approach 6: Use Standard Functional Interfaces with Lambda Expressions.
Read more >Lambda expressions and anonymous functions | Microsoft Learn
C# lambda expressions that are used to create anonymous functions and ... You use a lambda expression to create an anonymous function.
Read more >Lambda Expressions in Java - Full Simple Tutorial - YouTube
Full tutorial for Lamba expressions in Java. Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginnersLambdas in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK here: https://github.com/CanHub/Android-Image-Cropper/compare/main...AndroidDeveloperLB:main https://github.com/CanHub/Android-Image-Cropper/pull/104
Seems now it’s possible again to use the short form again. Weird that the IDE doesn’t suggest it though.