Skip to content

Instantly share code, notes, and snippets.

@j-onathan
Created August 7, 2014 08:02
Show Gist options
  • Save j-onathan/677cb9d443fb029b2f50 to your computer and use it in GitHub Desktop.
Save j-onathan/677cb9d443fb029b2f50 to your computer and use it in GitHub Desktop.
TextView textView = (TextView)row.findViewById(android.R.id.text1);
float scale = activity.getResources().getDisplayMetrics().density;
boolean leftPadding = (parent.getTag().equals("right"));
boolean topPadding = (position == 0);
textView.setPadding((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(20 * scale) * (!leftPadding && topPadding ? 1 : 0), (int)(20 * scale), 0);
textView.setText(item);
textView.setTextColor(Color.BLACK);
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment