diff --git a/views/src/main/java/ru/touchin/roboswag/views/widget/Switcher.java b/views/src/main/java/ru/touchin/roboswag/views/widget/Switcher.java index 949f993..a57dd1e 100644 --- a/views/src/main/java/ru/touchin/roboswag/views/widget/Switcher.java +++ b/views/src/main/java/ru/touchin/roboswag/views/widget/Switcher.java @@ -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) {