Skip to content
A glorified layout file to which you can apply your Android theme
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
gradle/wrapper
library
.gitignore
LICENSE Create LICENSE Oct 2, 2019
README.md
build.gradle
dark.png
dependencies.gradle
gradle.properties
gradlew
gradlew.bat
light.png
settings.gradle

README.md

material design components showcase

Nick Rout added this awesome debug activity to MuVi which showcases Material components with a given theme. This library follows the same idea, but saves you from having to do the same in every app that you have!

Light preview Dark preview
light mode dark mode

Add it as a dependency to your project:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

implementation 'com.github.ataulm:material-design-components-showcase:<latest-release-or-commit>'

Then open the included Activity:

class DebugActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_debug)

        openThemeShowcaseButton.setOnClickListener {
            startMdcShowcase()
        }
    }
}

We can specify a particular theme to load too (by default it'll take the application theme):

startMdcShowcase(R.style.Theme_Demo)

There's a MaterialToolbar too, which we can set with a flag:

startMdcShowcase(R.style.Theme_Demo, shouldSetSupportActionBar = true)

If you want to customise the layout, you can pass an ArrayList of layout resources, each of which will be inflated as a separate row.

startMdcShowcase(R.style.Theme_Demo, inflatables = arrayListOf(R.layout.demo_custom_inflatable))

If you want to augment the default set, you can include the original one too:

startMdcShowcase(
    R.style.Theme_Demo,
    shouldSetSupportActionBar = true,
    inflatables = arrayListOf(R.layout.mdcs__default_inflatable, R.layout.demo_custom_inflatable)
)
You can’t perform that action at this time.