add hideAllChildren() in Switcher ViewGroup
This commit is contained in:
parent
d9a9957cd4
commit
e2d744c5d3
|
|
@ -67,6 +67,13 @@ public class Switcher extends FrameLayout {
|
|||
}
|
||||
}
|
||||
|
||||
public void hideAllChildren() {
|
||||
for (int index = 0; index < getChildCount(); index++) {
|
||||
final View child = getChildAt(index);
|
||||
setVisibilityWithAnimation(child, View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setVisibilityWithAnimation(@NonNull final View view, final int targetVisibility) {
|
||||
final Animation animation = targetVisibility == View.VISIBLE ? inAnimation : outAnimation;
|
||||
if (view.getVisibility() != targetVisibility) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue