Skip to content

Instantly share code, notes, and snippets.

@rocboronat
Last active June 30, 2018 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rocboronat/8cd4f4901b01e1eea713 to your computer and use it in GitHub Desktop.
Save rocboronat/8cd4f4901b01e1eea713 to your computer and use it in GitHub Desktop.
A basic dimens.xml for Android, with applied Android Design guidelines
<resources>
<!-- http://developer.android.com/design/style/metrics-grids.html -->
<dimen name="gap_small">4dp</dimen>
<dimen name="gap_medium">8dp</dimen>
<dimen name="gap_large">16dp</dimen>
<dimen name="gap_xlarge">32dp</dimen>
<dimen name="gap_xxlarge">64dp</dimen>
<!-- http://developer.android.com/design/style/typography.html -->
<dimen name="text_size_micro">12sp</dimen>
<dimen name="text_size_small">14sp</dimen>
<dimen name="text_size_medium">18sp</dimen>
<dimen name="text_size_large">22sp</dimen>
</resources>
@alorma
Copy link

alorma commented Aug 13, 2014

Maybe add an option to XXXLarge gap?

    <dimen name="gapXXXLarge">128dp</dimen>

@rocboronat
Copy link
Author

Why not? XD

@rocboronat
Copy link
Author

Some days after doing it I've seen that this huge dimen will not be a standard. Actually, that kind of dimens will be defined ad-hoc, ignoring the 8dp rythm. So... going to delete it! :·)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment