Skip to main content

Components

Alert

Alert are to display a list of options on a temporary surface

banner-Alert

Alert is component to displays a short message or notification to the user from an existing activity.

Usage


To implement Alert, you can use this tag `LgnAlertButton` in the xml file.
<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:alertType="INFO"
app:description="Interactively monetize corporate alignment"
app:title="Info title"

Variant

In its use, alert has following variants :

  1. Themes
  2. Alert Button

Themes

There are 4 themes which are available :

1. Info

The following is properties value to implement Alert info

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:alertType="INFO"
app:description="Interactively monetize corporate alignment"
app:title="Info title"

2. Success

The following is properties value to implement Alert Success .

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:alertType="SUCCESS"
app:description="Interactively monetize corporate alignment"
app:title="Info title"

3. Warning

The following is properties value to implement Alert Warning .

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:alertType="WARNING"
app:description="Interactively monetize corporate alignment"
app:title="Info title"

4. Error

The following is properties value to implement Alert Error.

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:alertType="ERROR"
app:description="Interactively monetize corporate alignment"
app:title="Info title"

Alert Button

Alert consists of 2 action buttons :

  1. Action button app:actionText
  2. Dismiss button app:isDismissible

The following is example usage for alert button, this code represent alert with action button and dismiss button

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:actionText="Call to action"
app:description="Interactively monetize corporate alignment"
app:title="Info title"
/>

The following is example usage for alert button, this code represent alert without action button and dismiss button

<com.telkom.legion.component.alert.LgnAlert
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_20dp"
app:description="Interactively monetize corporate alignment"
app:isDismissible="false"
app:title="Info title"
/>

Attributes

Attribute NameXml AttrsRelated method(s)Description
Alert Titleapp:title.titleAdd title on alert
Alert Descriptionapp:description.descriptionAdd description on alert
Alert Action Textapp:actionText.actionTextAdd action text on alert
Alert Dissmis Buttonapp:isDismissible.isDismissibleAdd dismiss button visibility on alert
Alert Typeapp:alertType.alertTypeConfigure alert type

Example