twilio / twilio-chat-demo-android

Chat API Demo Application for Android
MIT License
63 stars 51 forks source link

Suggestion: Have null aware annotations for the SDK #134

Closed emartynov closed 4 years ago

emartynov commented 4 years ago

Description

When I override classes or implement interfaces from SDK IDE generates me methods with nullable parameters.

Example:

abstract class TwilioChatListenerAdapter : ChatClientListener{
    override fun onChannelDeleted(p0: Channel?) {
        TODO("Not yet implemented")
    }

I believe in almost all cases it is non null value.

Expected Behavior

Parameter type is non nullable in Kotlin

Reproduces how Often

Always

Chat Android SDK

5.0.1

P.S. Can you also submit some dummy source code some param name is not p0. Unfortunate IDE doesn't take it from javadoc.

rusmonster commented 4 years ago

Hi @emartynov! Thank you for using twilio!

Yes, this improvements are on the table as well as providing convenient kotlin interfaces based on coroutines and many others. Unfortunately I can't provide any ETA at the moment. Right now we are focused on providing adjustable network timeouts and reducing SDK size.

Also I can confirm that it is safe to change auto-generated method signature to

override fun onChannelDeleted(channel: Channel) {
emartynov commented 4 years ago

Why not to open source library? I believe it is just using Chat API and doesn't contain any company secrets?

In this way you can expect other people contribution in these small improvements that will land faster.

berkus commented 4 years ago

@emartynov we will opensource it at some point certainly. Currently it doesn't seem doable.

emartynov commented 4 years ago

Cool, I'm closing ticket then.