Created
August 31, 2013 17:14
-
-
Save YoungjaeKim/6399516 to your computer and use it in GitHub Desktop.
아바타 레이아웃 셋업
This file contains 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
/** | |
* 아바타 셋업. | |
* | |
* @param avatarLayout | |
* @param avatar | |
*/ | |
private void setAvatar(RelativeLayout avatarLayout, Avatar avatar) { | |
int resourceId; | |
// Head | |
ImageView imageViewHead = (ImageView) avatarLayout.findViewById(R.id.imageViewHead); | |
resourceId = this.getResources().getIdentifier("h_" + avatar.head, "drawable", this.getPackageName()); | |
imageViewHead.setImageResource(resourceId); | |
// Torso | |
ImageView imageViewTorso = (ImageView) avatarLayout.findViewById(R.id.imageViewTorso); | |
resourceId = this.getResources().getIdentifier("t_" + avatar.torso, "drawable", this.getPackageName()); | |
imageViewTorso.setImageResource(resourceId); | |
// Leg | |
ImageView imageViewLeg = (ImageView) avatarLayout.findViewById(R.id.imageViewLeg); | |
resourceId = this.getResources().getIdentifier("l_" + avatar.leg, "drawable", this.getPackageName()); | |
imageViewLeg.setImageResource(resourceId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment