Skip to content

Standard dimensions, colors (Material design colors, HTML color codes) for use in Android app development.

License

Notifications You must be signed in to change notification settings

rshavinda/android-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Canvas

alt text

♘ Android values directory files can be defined both as standard resources (under res/values/), as well as direct values supplied for mappings (in styles, themes and attributes in XML files such as layouts). Here are some standard dimensions, color codes for use in Android app development.


1) color.xml

Themable, flexible color ramps for design applications.

  • ➤ Color - Style - Material Design
    Material Design is a cross-platform design system from Google, and it is the design system for Android.

    Out of color ideas?
    Material Design Color Palette will assist you quickly decide which color to choose for your project.


  • Or add colour.xml file in the res/values folder of your project to easily work with standard color formats (All Color Codes from Google's Material design color palette).

    alt text


  • ➤ Color Library
    HTML Color Codes library features flat design colors, Google's Material design scheme and the classic web safe color palette, all with Hex color codes and color names.

alt text



  • Add colour.xml file in the res/values folder of your project to work with wide range of colours.

2) dimens.xml

Dimensions file which is used to define all size dimensions used within an app. A dimension is specified with a number followed by a unit of measure. For example: 10px, 5sp. Dimensions should be defined within res/values/dimens.xml.

- Dimensions Style #01

The 'space' tag represent both margins and padding properties as follows,

  <resources>
       <!-- Margins and Padding -->
       <dimen name="space_xl">32dp</dimen>
       <dimen name="space_large">24dp</dimen>
       <dimen name="space_medium">16dp</dimen> 
       <dimen name="space_small">8dp</dimen>
       <dimen name="space_xs">4dp</dimen>
  </resources>
  • Format 01 : dimens.xml ( space_xs, space_xl )
  • Format 02 : dimens.xml ( space_extra_small, space_extra_large )


- Dimensions Style #02 :

Margins and padding properties defined in separate sections as shown below,

  <resources>
        <!-- Margins -->
        <dimen name="margin_xxl">48dp</dimen>
        <dimen name="margin_xl">32dp</dimen>
        <dimen name="margin_large">24dp</dimen>
        <dimen name="margin_medium">16dp</dimen> 
        <dimen name="margin_small">8dp</dimen>
        <dimen name="margin_xs">4dp</dimen>

        <!-- Padding -->
        <dimen name="padding_xl">32dp</dimen>
        <dimen name="padding_large">24dp</dimen>
        <dimen name="padding_medium">16dp</dimen>
        <dimen name="padding_small">8dp</dimen>
        <dimen name="padding_xs">4dp</dimen>
  </resources>
  • Format 01 : dimens.xml ( margin_xs, padding_xl )
  • Format 02 : dimens.xml ( margin_extra_small, padding_extra_large )

MIT License

Copyright (c) 2021 Rajitha Shavinda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Standard dimensions, colors (Material design colors, HTML color codes) for use in Android app development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published