Material component for Android: Banner
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.
banner-example-remote
banner-example
banner
extras
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Banners

A banner displays a prominent message and related optional actions.

Usage

in your layout.xml

  <com.cesar.materialcomponents.Banner
        android:id="@+id/banner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#ccc"
        app:bannerBackgroundColor="@color/weird_green"
        app:contentText="Your password was updated on another device. Please sign in again"
        app:leftButtonText="Continue as Guest"
        app:rightButtonText="Sign in"/>

In your activity.kt

 banner.setLeftButtonAction { banner.dismiss() }
 banner.setRightButtonAction { navigator.goToSignIn() }

Install

Just add the following dependency in your app's build.gradle

allprojects { repositories { maven { url 'https://jitpack.io' } }}
dependencies {
    implementation 'com.github.cesarferreira:MaterialComponent.Banner:0.13.0'
}

Reason

https://github.com/material-components/material-components-android/issues/74