kazutoyo / UIComponentCatalog

Android UI Component Catalog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIComponentCatalog

Android UI Component Catalog

demo

Usage

Add JitPack

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

Add UIComponentCatalog library.

dependencies {
    implementation 'com.github.kazutoyo:UIComponentCatalog:0.0.+'
}

Implement ComponentCatalogActivity

class MainActivity : ComponentCatalogActivity() {
    override fun createCollections(): List<ComponentCatalogCategory> {
        return listOf(
            ComponentCatalogCategory("Image", listOf(
                ComponentCatalogSubCategory("Icon", listOf(
                    object : ComponentItem("Circle Icon") {
                        override fun buildItem(): View {
                            return IconImageView(this@MainActivity).apply {
                                setImageResource(R.drawable.sample)
                            }
                        }
                    }
                ))
            ))
        )
    }
}

set NoActionBar Theme.

<activity
    android:name="jp.kazutoyo.uicomponentcatalogsample.MainActivity"
    android:theme="@style/Theme.AppCompat.NoActionBar">

About

Android UI Component Catalog

License:MIT License


Languages

Language:Kotlin 88.5%Language:Java 11.5%