-
-
Save emedinaa/12d3d71cce65688ca949d784b90d8c7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onBindViewHolder(@NonNull RecyclerAdapter.CharacterViewHolder holder, int position) { | |
Character character = characterList.get(position); | |
holder.tvName.setText(character.getName()); | |
holder.tvHouse.setText(character.getHouse()); | |
holder.tvPatronous.setText(character.getPatronus()); | |
holder.tvSpecies.setText(character.getBloodStatus()); | |
holder.tvSpecies.setText(character.getSpecies()); | |
holder.tvBloodStatus.setText(character.getBloodStatus()); | |
holder.tvRole.setText(character.getRole()); | |
holder.tvSchool.setText(character.getSchool()); | |
if(character.isDeathEater() == true){ | |
holder.tvDeathEater.setText("true"); | |
} else { | |
holder.tvDeathEater.setText("false"); | |
} | |
if(character.isDumboldoresArmy() == true){ | |
holder.tvDumbArmy.setText("true"); | |
} else { | |
holder.tvDumbArmy.setText("false"); | |
} | |
if(character.isOrderOfThePhoenix() == true){ | |
holder.tvOrderFenix.setText("true"); | |
} else { | |
holder.tvOrderFenix.setText("false"); | |
} | |
if(character.isMinistryOfMagic() == true){ | |
holder.tvMinMagic.setText("true"); | |
} else { | |
holder.tvMinMagic.setText("false"); | |
} | |
holder.tvAlias.setText(character.getAlias()); | |
holder.tvWand.setText(character.getWand()); | |
holder.tvBoggart.setText(character.getBoggart()); | |
holder.tvAnimagus.setText(character.getAnimagus()); | |
val name = character.getName() | |
/*if(name.isEmpty){ | |
holder.tvName.visibility = View.GONE | |
}else{ | |
holder.tvName.visibility = View.VISIBLE | |
holder.tvName.text = name | |
}*/ | |
val visibility = if (name.isEmpty()) View.GONE else View.VISIBLE | |
holder.tvName.text = name | |
holder.tvName.visibility = visibility | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment