Skip to content

Bizyback/materially

Repository files navigation

Materially

Materially

Reusable Material3 components for Mobile & Tv

Why?

Currently in order to use Material3 components for both mobile and tv you'll have to add checks for most of them. Materially merges mobile and tv Material3 components into one.

Example

Material3

  • dependencies

    Mobile Television
    androidx.compose.material3.Button androidx.tv.material3.Button
  • usage

    composable {
        ...
        val isTv = // add your check here
        if (isTv)
            androidx.tv.material3.Button(...)
        else
            androidx.compose.material3.Button(...)
        ...
    }

Materially

  • dependency

    Mobile & Television
    com.bizyback.materially.components.atoms.Button
  • usage

    composable {
        Button(...)
    }

Sample

mobile tablet telly
mobile tablet telly

Installation

  • Install jitpack

Find settings.gradle.kts in the root project folder and add :

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { setUrl("https://jitpack.io") } // add this line
    }
}
  • Add Materially Dependency

In your app module find build.gradle.kts and add :

  implementation("com.github.bizyback:materially:$version")
  • Sync gradle and proceed use the library

Usage

  • Change MaterialTheme to MateriallyTheme
    @Composable
    fun MateriallyTheme(
        shapes: MateriallyShapes = materiallyShapes(), // to customize shapes
        padding: MateriallyPadding = materiallyPadding(), // to customize padding sizes
        typography: MateriallyTypography = materiallyTypography(), // to customize typography
        colorScheme: MateriallyColorScheme = materiallyColorScheme(), // to customize color scheme
        content: @Composable () -> Unit // pass your content
    ): Unit

About

Reusable Material3 components for Mobile & Tv

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages