Created
May 26, 2014 09:22
-
-
Save ShinJJang/f4db750c6a3914c61412 to your computer and use it in GitHub Desktop.
Android different background
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
TableRow last_row = (TableRow) contact_table.getChildAt(contact_table.getChildCount() - 1); | |
TableRow row; | |
if (last_row == null || last_row.getChildCount() == 2) { | |
row = new TableRow(context); | |
if (last_row != null) { | |
int color = ((ColorDrawable) last_row.getChildAt(1).getBackground()).getColor(); | |
view.setBackgroundColor(color); | |
} | |
} else { | |
row = last_row; | |
if (context.getResources().getColor(R.color.contact_name_background_2) == ((ColorDrawable) last_row.getChildAt(0).getBackground()).getColor()) { | |
view.setBackgroundColor(context.getResources().getColor(R.color.contact_name_background_1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment