Material Design Guideline

Additional

Language
Kotlin
Version
N/A
Created
Apr 5, 2017
Updated
May 31, 2018
Owner
Nonthawit Doungsodsri (TheKhaeng)
Contributor
Nonthawit Doungsodsri (TheKhaeng)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertisement

「 MATERIAL DESIGN GUIDELINE V.2 」

Very lightweight library for Android developers that facilitate how you use XML resources, especially if you strictly follow Google material design principle. This library is mostly about XML resources. For example, colors that is defined by the principle or dimension sizes that is divisible by 4dp. The guideline is here. Google Material guideline V.2.

TOPIC

  • Demo app
  • Install
  • Default color and dimens: margin and padding / corner / aspect / tablet device
  • Color: base color / material color / alert color
  • Icons: size / color
  • Typography: size / font / space / color / style
  • Elevation
  • Elevation Anim
  • Animation duration
  • Component

「 DEMO APPLICATION 」

「 INSTALLATION 」

implementation 'com.github.thekhaeng:material-design-color:2.0.0' //only material color
implementation 'com.github.thekhaeng:material-design-metric:2.0.1'

// or 
// If your project not use androidx you must exclulde this group out.
implementation('com.github.thekhaeng:material-design-color:2.0.0') {
    exclude group: 'androidx.annotation', module: 'annotation'
}
implementation('com.github.thekhaeng:material-design-metric:2.0.2') {
    exclude group: 'androidx.appcompat', module: 'appcompat'
}

Changelog

  • 2.0.2: lastest version

    • update new icon click size
  • 2.0.0

    • update all new Material Design
  • 1.0.4

    • Added devices.xml for check tablet (sw540dp)
    • Added tablet font size +1sp
  • 1.0.3

    • Added no transparent text and icon color
    • Added default_stroke_large
    • Added default_divider_large
  • 1.0.2

    • Added some example usage in demo project
    • Changed name light to light_theme
    • Changed name dark to dark_theme
  • 1.0.1

    • Added default_padding_margin_extra_extra_extra_large 48dp
    • Changed default_padding_margin_extra_extra_large 48dp to 32dp








or you can use via xml

DIMEN NAMES FLOAT
md_aspect_16_9 1.7777777
md_aspect_3_2 1.5
md_aspect_4_3 1.333333
md_aspect_1_1 1

Tablet Device

This project use sw540dp magic number to seperate smart phone and tablet.

[Kotlin]
Context.isTablet
Fragment.isTablet

[Java]
TabletDevice.isTablet(context)
TabletDevice.isTablet(Fragment.isTablet)

or

boolean isTabletSize = getResources().getBoolean(R.bool.isTablet);