Skip to content

Visibility Extension on Android

Views visibility on android must always be used in the development process. Implementing visibility of view is easier if we make extensions so that our code is cleaner and not a lot of redundant. Here is an example of an extension that I usually use.

You can create a class that contains the following functions:

For example maybe you can use ViewExt to hold those functions.

Oke, and how to use those functions? that so easy dude! just call that function inside class yo want to use. For example you want to hide a view(TextView) in class MainActivity, you just call the fuction

I think this way make our coding easier and simply our code.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.