question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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

  1. 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:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

0reactions
AndroidDeveloperLBcommented, Apr 1, 2021

Seems now it’s possible again to use the short form again. Weird that the IDE doesn’t suggest it though.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found