DEV Community

Discussion on: My first published library in the Android arsenal

Collapse
 
neokleoys2005 profile image
Giorgos Neokleous • Edited

Congrats!

I've got a question which you might want to address in your README.md.

Why does the library need an ACCESS_NETWORK_STATE permission? I'm guessing it has to do with InternetSensableButton.

Also, the library lacks documentation. Although simple, it gives zero info to the implementator what for example InternetSensableButton does.

Edit:
Comments on implementation

connected.also {
                when(it){
                    true -> button.alpha = 1f
                    false -> button.alpha = disabledAlpha
                }
            }

connected is a non-nullable boolean, the also adds redundant verbosity to the logic.
Also, I think a simple if-else will be cleaner here. When-statement is fantastic but it's not the one stop for all conditional logic.

Collapse
 
devit951 profile image
Ildarov

Thanks for the response.
On a weekend I will fix README, to describe new button type "InernetSensableButton". The reason why I couldn't because I didn't have enough free time.

Collapse
 
devit951 profile image
Ildarov

Done.