Android View Visibility Change switchVisible(ViewGroup viewGroup, View _view)

Here you can find the source of switchVisible(ViewGroup viewGroup, View _view)

Description

switch Visible

Declaration

public static void switchVisible(ViewGroup viewGroup, View _view) 

Method Source Code

//package com.java2s;
import android.view.View;

import android.view.ViewGroup;

public class Main {
    public static void switchVisible(ViewGroup viewGroup, int id) {
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            View view = viewGroup.getChildAt(i);
            if (view.getId() == id) {
                view.setVisibility(View.VISIBLE);
            } else {
                view.setVisibility(View.GONE);
            }//from  ww  w .jav  a  2 s. c o m
        }
    }

    public static void switchVisible(ViewGroup viewGroup, View _view) {
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            View view = viewGroup.getChildAt(i);
            if (_view == view) {
                view.setVisibility(View.VISIBLE);
            } else {
                view.setVisibility(View.GONE);
            }
        }
    }
}

Related

  1. switchVisible(ViewGroup viewGroup, int id)