> For the complete documentation index, see [llms.txt](https://kishannareshpal.gitbook.io/stateview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kishannareshpal.gitbook.io/stateview/master.md).

# StateView

An alternate state control for views for Android. Can be used to show that a RecyclerView or any other View has no data

[![forthebadge](https://forthebadge.com/images/badges/built-for-android.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/made-with-java.svg)](https://forthebadge.com)\
![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat) [![Download](https://api.bintray.com/packages/kishannareshpal/maven/stateview/images/download.svg?version=1.2.1)](https://bintray.com/kishannareshpal/maven/stateview/1.2.1/link)

## 💪 Installation

Add the library to the **dependencies { ... }** section of your **app** level `build.gradle` file:

```groovy
// Refer to the badge named Download for the version number.
implementation 'com.kishannareshpal:stateview:<version>'
```

## 🍺 Usage

### In the layout:

```markup
<com.kishannareshpal.stateview.StateView
     android:id="@+id/stateview"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     app:stateMode="normal">

        <!-- 
         Place 1 child view here.
         E.g.: <RecyclerView .../> 
        -->
</com.kishannareshpal.stateview.StateView>
```

> **NOTE: You can only add One (1) child view to StateView.**\
> If you try adding more than one child view, you will get an IllegalStateException.

### Attributes

| **Attribute**                             | **Description**                                                                                            | **Data Type**  | **Enums**                                                                              | **Default Value**                                                                     |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **`app:stateMode`**                       | Sets the state mode.                                                                                       | enum           | <p><strong><code>normal</code></strong><br><strong><code>alternate</code></strong></p> | **`normal`**                                                                          |
| **`app:stateBackgroundColor`**            | Sets the background color for the **alternate** state mode.                                                | color          | n/a                                                                                    | <p><code>#FFFFFF</code></p><p>(white)</p>                                             |
| **`app:stateGravity`**                    | Change the **alternate** state components gravity (icon, title, icons, progress bars, description, button) | enum           | <p><code>left</code></p><p><code>center</code></p><p><code>right</code></p>            | `center`                                                                              |
| **`app:stateContentPaddingLeft`**         | Change the left content padding.                                                                           | dimension (dp) | n/a                                                                                    | `18dp`                                                                                |
| **`app:stateContentPaddingTop`**          | Change the top content padding.                                                                            | dimension (dp) | n/a                                                                                    | `18dp`                                                                                |
| **`app:stateContentPaddingRight`**        | Change the right content padding.                                                                          | dimension (dp) | n/a                                                                                    | `18dp`                                                                                |
| **`app:stateContentPaddingBottom`**       | Change the bottom content padding.                                                                         | dimension (dp) | n/a                                                                                    | `18dp`                                                                                |
| **`app:stateMainProgressEnabled`**        | If the main circular progress is enabled/shown.                                                            | boolean        | n/a                                                                                    | `true`                                                                                |
| **`app:stateSmallProgressEnabled`**       | If the small circular progress is enabled/shown.                                                           | boolean        | n/a                                                                                    | `true`                                                                                |
| **`app:stateProgressStrokeColor`**        | Sets the circular progress stroke color.                                                                   | color          | n/a                                                                                    | <p><code>#000</code></p><p>(black)</p>                                                |
| **`app:stateProgressBackgroundColor`**    | Sets the circular progress background color                                                                | color          | n/a                                                                                    | <p><code>#00000000</code></p><p>(transparent)</p>                                     |
| **`app:stateIcon`**                       | Sets a **56x56dp** image.                                                                                  | drawable       | n/a                                                                                    | `null`                                                                                |
| **`app:stateTitle`**                      | Sets the title text.                                                                                       | string         | n/a                                                                                    | `null`                                                                                |
| **`app:stateTitleTextSize`**              | Sets the title text size.                                                                                  | dimension (sp) | n/a                                                                                    | `24sp`                                                                                |
| **`app:stateTitleTextColor`**             | Sets the title text color.                                                                                 | color          | n/a                                                                                    | <p><code>#000</code></p><p>(black)</p>                                                |
| **`app:stateTitleTextAppearance`**        | Customize color, fontFamily, size via style for title text.                                                | StyleRes       | n/a                                                                                    | `@style/StateViewTheme.TitleTextAppearance`                                           |
| **`app:stateDescription`**                | Sets the description text.                                                                                 | string         | n/a                                                                                    | `null`                                                                                |
| **`app:stateDescriptionTextSize`**        | Sets the description text size.                                                                            | dimension (sp) | n/a                                                                                    | `16sp`                                                                                |
| **`app:stateDescriptionTextColor`**       | Sets the description text color                                                                            | color          | n/a                                                                                    | <p><code>#3f3f3f</code></p><p>(dark grey)</p>                                         |
| **`app:stateDescriptionTextAppearance`**  | Customize color, fontFamily, size via style for description text.                                          | StyleRes       | n/a                                                                                    | `@style/StateViewTheme.DescriptionTextAppearance`                                     |
| **`app:stateActionButtonText`**           | Sets the action button text.                                                                               | string         | n/a                                                                                    | `null`                                                                                |
| **`app:stateActionButtonTextColor`**      | Sets the action button text color.                                                                         | color          | n/a                                                                                    | <p><code>#fff</code></p><p>(white)</p>                                                |
| **`app:stateActionButtonColor`**          | Sets the action button background color.                                                                   | color          | n/a                                                                                    | <p><code>#000</code></p><p>(black)</p>                                                |
| **`app:stateActionButtonCornerRadius`**   | Sets the action button corner radius.                                                                      | dimension (dp) | n/a                                                                                    | rounded (64dp)                                                                        |
| **`app:stateActionButtonTextAppearance`** | Customize color, fontFamily, size via style for action button text.                                        | StyleRes       | n/a                                                                                    | <p><code>@style/StateViewTheme.ActionButton</code><br><code>TextAppearance</code></p> |

### Theming

You can overwrite `StateViewTheme` in your styles.xml to apply your customized theme for the StateView:

```markup
<styles name="MyStateViewTheme" parent="StateViewTheme">
    <!-- Customize the stateview here with any attribute listed
       on the atrributes table above. 
    -->

    <!-- Example: -->
    <item name="stateBackgroundColor">#ff6363</item>
    <item name="stateActionButtonCornerRadius">8dp</item>
    …    
</styles>
```

After you have your styles `MyStateViewTheme` set, use it by applying the style attribute to the StateView in your layout file as follows:

```markup
<com.kishannareshpal.stateview.StateView
    …
    style="@style/MyStateViewTheme">

</com.kishannareshpal.stateview.StateView>
```

### TextAppearance Styling (text color, font, size, spacing, ...)

To customise the default text appearance for title, description and actionButton you can override the following styles:

| Style names                                 | Description                    |
| ------------------------------------------- | ------------------------------ |
| `StateViewTheme.TitleTextAppearance`        | Styles the title text.         |
| `StateViewTheme.DescriptionTextAppearance`  | Styles the description text.   |
| `StateViewTheme.ActionButtonTextAppearance` | Styles the action button text. |

For example, if you want to style the title, add this to your `styles.xml`

```markup
<styles name="MyTitleTextAppearance" parent="StateViewTheme.TitleTextAppearance">
    <!-- Customize the text appearance for the title -->

    <!-- Example: -->
    <item name="android:fontFamily">@font/times_new_roman</item>
    <item name="android:textColor">@color/blue</item>
    <item name="android:textSize">48sp</item>
    …    
</styles>
```

Now either apply it to the attribute `app:stateTitleTextAppearance` in your layout:

```markup
<!-- The same applies to
      • app:stateDescriptionTextAppearance
      • app:stateActionButtonTextAppearance 
 -->
<com.kishannareshpal.stateview.StateView
     …
     app:stateTitleTextAppearance="@style/MyTitleTextAppearance">

</com.kishannareshpal.stateview.StateView>
```

Or in your custom StateView theme:

```markup
<styles name="MyStateViewTheme" parent="StateViewTheme">
    …    
    <item name="stateTitleTextAppearance">@style/MyTitleTextAppearance</item>
    <!-- The same applies to
      • <item name="stateDescriptionTextAppearance">…</item>
      • <item name="stateActionButtonTextAppearance">…</item> 
     -->

</styles>
```

### Methods: List

#### Getters

| Name                       | Return type                  | Description                                                                    |
| -------------------------- | ---------------------------- | ------------------------------------------------------------------------------ |
| **`getState()`**           | **`State`**                  | Gets the currently set state.                                                  |
| **`getTitleText()`**       | **`@Nullable CharSequence`** | Gets the currently set title text.                                             |
| **`getDescriptionText()`** | **`@Nullable CharSequence`** | Gets the currently set description text.                                       |
| **`getActionButton()`**    | **`MaterialButton`**         | Exposes the action button. May be used to customise stuff like adding an icon. |

#### Setter

| Name                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`void backgroundColor(@ColorInt int backgroundColor)`**                                                                                                                                              |
| **`void contentPadding(int left, int top, int right, int bottom)`**                                                                                                                                    |
| **`void contentPadding(int padding)`**                                                                                                                                                                 |
| **`void gravity(ComponentGravity gravity)`**                                                                                                                                                           |
| **`void mainIcon(@Nullable @DrawableRes Integer iconRes, boolean isGif)`**                                                                                                                             |
| **`void mainProgressEnabled(boolean mainProgressEnabled)`**                                                                                                                                            |
| **`void smallProgressEnabled(boolean smallProgressEnabled)`**                                                                                                                                          |
| **`void progressStrokeColor(@ColorInt int progressStrokeColor)`**                                                                                                                                      |
| **`void progressBackgroundColor(@ColorInt int progressBackgroundColor)`**                                                                                                                              |
| <p><strong><code>void state(State state)</code></strong></p><p><strong><code>void state(State state, boolean animated)</code></strong></p>                                                             |
| <p><strong><code>void title(@Nullable CharSequence title)</code></strong></p><p><strong><code>void title(@Nullable CharSequence title, AnimationType titleTextChangeAnimationType)</code></strong></p> |
| **`void titleTextSize(int titleTextSize)`**                                                                                                                                                            |
| **`void titleTextColor(@ColorInt int titleTextColor)`**                                                                                                                                                |
| **`void description(@Nullable CharSequence description)`**                                                                                                                                             |
| **`void description(@Nullable CharSequence description, AnimationType descriptionTextChangeAnimationType)`**                                                                                           |
| **`void descriptionTextColor(@ColorInt int descriptionTextColor)`**                                                                                                                                    |
| **`void descriptionTextSize(int descriptionTextSize)`**                                                                                                                                                |
| **`void actionButtonText(@Nullable CharSequence actionButtonText)`**                                                                                                                                   |
| **`void actionButtonCornerRadius(int actionButtonCornerRadius)`**                                                                                                                                      |
| **`void actionButtonTextColor(@ColorInt int actionButtonTextColor)`**                                                                                                                                  |
| **`void actionButtonColor(@ColorInt int actionButtonColor)`**                                                                                                                                          |
| **`void onActionButtonClick(OnActionButtonClickListener onActionButtonClickListener)`**                                                                                                                |
| **`void actionButtonEnabled(boolean enabled)`**                                                                                                                                                        |
| **`void actionButtonIsVisible(boolean isVisible)`**                                                                                                                                                    |

### Methods: Details

#### `backgroundColor`

Changes the default background color of the state view in **`State#NORMAL`**.

```java
public void backgroundColor (@ColorInt int backgroundColor)
```

| Parameter           | Description                                                                                                                                                                                                                         |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **backgroundColor** | <p><strong>@ColorInt int:</strong> the background color you want to set.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `contentPadding`

Change the content padding.

```java
public void contentPadding (int left, int top, int right, int bottom)
public void contentPadding (int padding)
```

| Parameter   | Description                   |
| ----------- | ----------------------------- |
| **padding** | **int:** all sides padding.   |
| **left**    | **int:** left side padding.   |
| **top**     | **int:** top side padding.    |
| **right**   | **int:** right side padding.  |
| **bottom**  | **int:** bottom side padding. |

#### `gravity`

Change the gravity of the state view components in `State#ALTERNATE`.

```java
public void gravity (ComponentGravity gravity)
```

| Parameter   | Description                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **gravity** | <p><strong>ComponentGravity:</strong> the gravity of title, main progress, description and button on <strong><code>State#ALTERNATE</code></strong> .<br>This is an enum consisting of three (3) values:</p><ul><li><strong>LEFT</strong>: to set the gravity to the left (start)</li><li><strong>CENTER</strong>: to set the gravity to the center.</li><li><strong>RIGHT</strong>: to set the gravity to the right (end).</li></ul> |

#### `mainIcon`

Change the icon.

```java
public void mainIcon (@Nullable @DrawableRes Integer iconRes, boolean isGif)
```

| Parameter   | Description                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| **iconRes** | **@Nullable @DrawableRes Integer:** the drawable resource identifier. If `null`, icon will be hidden.      |
| **isGif**   | **boolean**: set this to true if you are passing a **.gif** file to iconRes to view it animate infinitely. |

#### `mainProgressEnabled`

Shows/hides the main circular progress.

```java
public void mainProgressEnabled (boolean mainProgressEnabled)
```

| Parameter               | Description                                                                                                                                                                                     |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **mainProgressEnabled** | **boolean:** set this to true to show the main circular progress (this will replace the icon). If false, the main progress will be hidden (and be replaced with the icon if `mainIcon` is set). |

#### `smallProgressEnabled`

Shows/hides the small circular progress.

```java
public void smallProgressEnabled (boolean smallProgressEnabled)
```

| Parameter                | Description                                                                                                                                      |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **smallProgressEnabled** | **boolean:** set this to true to show the small circular progress in front of the description text. If false, the small progress will be hidden. |

#### `progressStrokeColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change all circular progress stroke color.

```
public void progressStrokeColor (@ColorInt int progressStrokeColor)
```

| Parameter               | Description                                                                                                                                                                                                                                             |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **progressStrokeColor** | <p><strong>@ColorInt int:</strong> the stroke color of the main and small circular progress.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `progressBackgroundColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change all circular progress background color.

```
public void progressBackgroundColor (@ColorInt int progressBackgroundColor)
```

| Parameter                   | Description                                                                                                                                                                                                                                                 |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **progressBackgroundColor** | <p><strong>@ColorInt int:</strong> the background color of the main and small circular progress.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `state` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the state.

```java
public void state (State state)
public void state (State state, boolean animated)
```

| Parameter    | Description                                                                                                                                                                                                                                                                                                             |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **state**    | <p><strong>State:</strong> the state to which you want to change.</p><p>This is an enum consisting of two (2) values:</p><ul><li><strong>NORMAL</strong>: use this to view the original view.</li><li><strong>ALTERNATE</strong>: use this for showing the StateView Title, Description and other components.</li></ul> |
| **animated** | **boolean:** if true, show a slight fade animation on the changing of states.                                                                                                                                                                                                                                           |

#### `title` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the title text.

```java
public void title (@Nullable CharSequence title)
public void title (@Nullable CharSequence title, AnimationType titleTextChangeAnimationType)
```

| Parameter                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **title**                        | <p><strong>@Nullable CharSequence:</strong> the title text.</p><p>If <code>null</code>, title will be hidden.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **titleTextChangeAnimationType** | <p><strong>AnimationType:</strong> the animation type to use when changing the title text.<br>This is an enum consisting of four (4) values:</p><ul><li><strong>NO\_ANIMATION</strong>: does not animate the text change. Same as <code>title(CharSequence)</code></li><li><strong>SLIDE\_TO\_TOP</strong>: slides the old text to top and back to normal with the new text.</li><li><strong>SLIDE\_TO\_BOTTOM</strong>: slides the old text to bottom and back to normal with the new text.</li><li><strong>FADE</strong>: fades out the old text and fades in the new text.</li></ul> |

#### `titleTextSize` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the title text size.

```java
public void titleTextSize (int titleTextSize)
```

| Parameter         | Description                           |
| ----------------- | ------------------------------------- |
| **titleTextSize** | **int:** the title text size in `sp`. |

#### `titleTextColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the title text color

```java
public void titleTextColor (@ColorInt int titleTextColor)
```

| Parameter          | Description                                                                                                                                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **titleTextColor** | <p><strong>@ColorInt int:</strong> the title text color.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `description` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the description text.

```java
public void description (@Nullable CharSequence description)
public void description (@Nullable CharSequence description, AnimationType descriptionTextChangeAnimationType)
```

| Parameter                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **description**                        | <p><strong>@Nullable CharSequence:</strong> the description text.</p><p>If <code>null</code>, description will be hidden.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **descriptionTextChangeAnimationType** | <p><strong>AnimationType:</strong> the animation type to use when changing the description text.<br>This is an enum consisting of four (4) values:</p><ul><li><strong>NO\_ANIMATION</strong>: does not animate the text change. Same as <code>title(CharSequence)</code></li><li><strong>SLIDE\_TO\_TOP</strong>: slides the old text to top and back to normal with the new text.</li><li><strong>SLIDE\_TO\_BOTTOM</strong>: slides the old text to bottom and back to normal with the new text.</li><li><strong>FADE</strong>: fades out the old text and fades in the new text.</li></ul> |

#### `descriptionTextSize` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the description text size.

```java
public void descriptionTextSize (int descriptionTextSize)
```

| Parameter               | Description                                 |
| ----------------------- | ------------------------------------------- |
| **descriptionTextSize** | **int:** the description text size in `sp`. |

#### `descriptionTextColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the description text color

```java
public void descriptionTextColor (@ColorInt int descriptionTextColor)
```

| Parameter                | Description                                                                                                                                                                                                               |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **descriptionTextColor** | <p><strong>@ColorInt int:</strong> the description text color.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `actionButtonText` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the action button text.

```java
public void actionButtonText (@Nullable CharSequence actionButtonText)
```

| Parameter            | Description                                                                                                                        |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **actionButtonText** | <p><strong>@Nullable CharSequence:</strong> the action button text.</p><p>If <code>null</code> , action button will be hidden.</p> |

#### `actionButtonColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the action button background color.

```java
public void actionButtonColor (@ColorInt int actionButtonColor)
```

| Parameter             | Description                                                                                                                                                                                                                       |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **actionButtonColor** | <p><strong>@ColorInt int:</strong> the action button background color.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `actionButtonCornerRadius` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the action button corner radius.

```java
public void actionButtonCornerRadius (int actionButtonCornerRadiues)
```

| Parameter                    | Description                   |
| ---------------------------- | ----------------------------- |
| **actionButtonCornerRadius** | **int:** corner radius in sp. |

#### `actionButtonTextColor` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the action button text color.

```java
public void actionButtonTextColor (@ColorInt int actionButtonTextColor)
```

| Parameter                 | Description                                                                                                                                                                                                                 |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **actionButtonTextColor** | <p><strong>@ColorInt int:</strong> the action button text color.</p><p>Use <a href="https://developer.android.com/reference/android/support/v4/content/ContextCompat#getcolor">ContextCompat#getColor(Context, int)</a></p> |

#### `onActionButtonClickListener` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

The action to execute when the button is clicked.

```java
public void onActionButtonClickListener (OnActionButtonClickListener onActionButtonClickListener)
```

| Parameter | Description |
| --------- | ----------- |

| **onActionButtonClickListener** | <p><strong>OnActionButtonClickListener:</strong> Interface definition for a callback to be invoked when the action button is clicked.</p><p><strong><code>void OnActionButtonClick(StateView sv, View actionBtn)</code></strong></p> |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

#### `actionButtonEnabled` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Change the enabled or disabled state of the action button.

```java
public void actionButtonEnabled (boolean actionButtonEnabled)
```

| Parameter               | Description                                                                                                                                   |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **actionButtonEnabled** | **boolean:** if false, action button will be disabled of any touch input, and will have a visually light grey background. Otherwise, enabled. |

#### `actionButtonIsVisible` <a href="#smallprogressenabled" id="smallprogressenabled"></a>

Changes the action button visibility only.

```java
public void actionButtonIsVisible (boolean isVisible)
```

| Parameter     | Description                                                             |
| ------------- | ----------------------------------------------------------------------- |
| **isVisible** | **boolean:** if true, action button will be visible, otherwise, hidden. |

## 🩺 Public Enums

### `enum State`

State consists of two (2) enum values:

* **NORMAL**: original view.
* **ALTERNATE**: state view alternate view with custom Title, Description and other components.

### `enum ComponentGravity`

ComponentGravity consists of four (3) enum values:

* **LEFT**: to set the gravity to the left (start)
* **CENTER**: to set the gravity to the center/middle.
* **RIGHT**: to set the gravity to the right (end).

### `enum AnimationType`

AnimationType consists of four (4) enum values:

* **NO\_ANIMATION**: no animation!
* **SLIDE\_TO\_TOP**: slides the old text to top and back to normal with the new text.
* **SLIDE\_TO\_BOTTOM**: slides the old text to bottom and back to normal with the new text.
* **FADE**: fades out the old text and fades in the new text.
