I have been working on application which has 3 types of accounts related to it. We create a single layout and view/hide
items on it depending on, from which account you are currently logged in.
With this approach, we have activities/fragments
doing a lot of different things, they handle all cases wrapped in if/else
checks etc. With growing project, it is becoming hard to maintain these classes.
Say, if I have to hide a view in certain scenario, I have to look around many if/else
checks just to hide a single button because if I hide it on one place other check will make it visible again, really hard to maintain.
I am looking forward for best advises on this issue from the experts.