Skip to content

cesarferreira/MaterialComponent.Banner

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:{latest_version}'
}

Reason

material-components/material-components-android#74

About

Material component for Android: Banner

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages