Skip to content

Instantly share code, notes, and snippets.

@ariedov
Created October 25, 2018 13:53
Show Gist options
  • Save ariedov/7953c3003dbdb618435c6d4184686908 to your computer and use it in GitHub Desktop.
Save ariedov/7953c3003dbdb618435c6d4184686908 to your computer and use it in GitHub Desktop.
Restrict attribute to it's type
TypedArray ta = getActivity().obtainStyledAttributes(R.styleable.LeanbackTheme);
mContainerListMarginStart = (int) ta.getDimension(
R.styleable.LeanbackTheme_browseRowsMarginStart, getActivity().getResources()
.getDimensionPixelSize(R.dimen.lb_browse_rows_margin_start));
mContainerListAlignTop = (int) ta.getDimension(
R.styleable.LeanbackTheme_browseRowsMarginTop, getActivity().getResources()
.getDimensionPixelSize(R.dimen.lb_browse_rows_margin_top));
ta.recycle();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment