https://kotlinlang.org logo
Title
w

Willy Njundong

05/29/2019, 6:59 AM
I can't quite understand what this syntax is:
private val surfaceTextureListener = object : TextureView.SurfaceTextureListener {

        override fun onSurfaceTextureAvailable(texture: SurfaceTexture, width: Int, height: Int) {
        //...
    }
g

gildor

05/29/2019, 7:00 AM
It’s creation of object
like creation of anonymous class in Java
w

Willy Njundong

05/29/2019, 7:00 AM
Aw man, I never got that far with Java. Only basic classes.
g

gildor

05/29/2019, 7:00 AM
Java analogue would be:
new TextureView.SurfaceTextureListener {
   @Override
   void  onSurfaceTextureAvailable(…)
}
w

Willy Njundong

05/29/2019, 7:00 AM
Can you link me to relevant kotlin docs that might give me more insight
w

Willy Njundong

05/29/2019, 7:01 AM
Wonderful thank you for your help sir