Advertisement
ebergar

Untitled

Mar 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.49 KB | None | 0 0
  1. public ListItemView(Context context, AttributeSet attrs) {
  2.    super(context, attrs);
  3.    init(attrs);
  4. }
  5. private void init(AttributeSet attrs) {
  6.    final TypedArray a = getContext().obtainStyledAttributes(
  7.            attrs, R.styleable.ListItemView);
  8.  
  9.    String title = a.getString(
  10.            R.styleable.ListItemView_ListItemView_text);
  11.    Drawable image = a.getDrawable(
  12.            R.styleable.ListItemView_ListItemView_image);
  13.  
  14.    setTitle(title);
  15.    setImage(image);
  16.    a.recycle();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement