zoo_app/app/src/main/java/com/example/jhalloran/zoo/ui/detail/AnimalDetailActivity.java
private void configureViewForAnimalType() {
    if (animal instanceof SwimmingAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.VISIBLE);
      waterTypesGroup.setVisibility(View.VISIBLE);
      airVolumeRequiredGroup.setVisibility(View.GONE);
    } else if (animal instanceof FlyingAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.GONE);
      waterTypesGroup.setVisibility(View.GONE);
      airVolumeRequiredGroup.setVisibility(View.VISIBLE);
    } else if (animal instanceof LandAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.GONE);
      waterTypesGroup.setVisibility(View.GONE);
      airVolumeRequiredGroup.setVisibility(View.GONE);
    } else {
      Log.e(TAG, String.format("Animal %s is not of valid type", animal.getName()));
    }
  }
// Hide / show relevant fields for different animals
Hide / show relevant fields for different animals
Hide / show relevant fields for different animals
private void configureViewForAnimalType() {
    if (animal instanceof SwimmingAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.VISIBLE);
      waterTypesGroup.setVisibility(View.VISIBLE);
      airVolumeRequiredGroup.setVisibility(View.GONE);
    } else if (animal instanceof FlyingAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.GONE);
      waterTypesGroup.setVisibility(View.GONE);
      airVolumeRequiredGroup.setVisibility(View.VISIBLE);
    } else if (animal instanceof LandAnimal) {
      waterVolumeRequiredGroup.setVisibility(View.GONE);
      waterTypesGroup.setVisibility(View.GONE);
      airVolumeRequiredGroup.setVisibility(View.GONE);
    } else {
      Log.e(TAG, String.format("Animal %s is not of valid type", animal.getName()));
    }
  }
private void configureViewForAnimalType ( ) { if ( animal instanceof SwimmingAnimal ) { waterVolumeRequiredGroup . setVisibility ( View . VISIBLE ) ; waterTypesGroup . setVisibility ( View . VISIBLE ) ; airVolumeRequiredGroup . setVisibility ( View . GONE ) ; } else if ( animal instanceof FlyingAnimal ) { waterVolumeRequiredGroup . setVisibility ( View . GONE ) ; waterTypesGroup . setVisibility ( View . GONE ) ; airVolumeRequiredGroup . setVisibility ( View . VISIBLE ) ; } else if ( animal instanceof LandAnimal ) { waterVolumeRequiredGroup . setVisibility ( View . GONE ) ; waterTypesGroup . setVisibility ( View . GONE ) ; airVolumeRequiredGroup . setVisibility ( View . GONE ) ; } else { Log . e ( TAG , String . format ( "Animal %s is not of valid type" , animal . getName ( ) ) ) ; } }
Hide / show relevant fields for different animals
Hide / show relevant fields for different animals