I wrote a function that returns visibility, but I understood correctly:
Must be one of: View.VISIBLE, View.INVISIBLE, View.GONE less ...
for this code:
private int getVisibilityForGlobalAndLocal(final boolean global, final boolean local) { if (global) { return View.GONE; } return local ? View.VISIBLE : View.INVISIBLE; }
using:
view.setVisibility(getVisibilityForGlobalAndLocal(true,false));
Unfortunately, the @Visibility annotation is hidden in the view:
@IntDef({VISIBLE, INVISIBLE, GONE}) @Retention(RetentionPolicy.SOURCE) public @interface Visibility {}
Now I can just copy this part (works), but it's bad. Is there a more elegant solution that I'm missing here? Should I indicate this as an error?
android
ligi
source share