Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imaaronjames/Simple-Android-Snackbar

A Framer Studio module for adding Android Material Design Snackbars to your project
https://github.com/imaaronjames/Simple-Android-Snackbar

Last synced: about 2 months ago
JSON representation

A Framer Studio module for adding Android Material Design Snackbars to your project

Awesome Lists containing this project

README

        

# Simple Android Snackbar
A Framer Studio module for adding Android Material Design Snackbars to your project

## Installation

1. Download the androidSnackbar.coffee file.
2. Create a new Framer project and add androidSnackbar.coffee to your /modules folder.
3. Add `Android = require 'androidSnackbar'` at the top of your document.

[Sample Project can be found here.](http://share.framerjs.com/ambwyc922b0m/)

More info about modules for Framer Studio: [FramerJS Docs - Modules](http://framerjs.com/docs/#modules)

![TextLayer](https://raw.githubusercontent.com/imaaronjames/Simple-Android-Snackbar/master/androidSnackbar-Sample-Project.framer/images/sample-code.png)

## How to use this module
You only need one line of code to make Simple Android Snackbars work. It looks a little something like this:

    `Android.Snackbar("Snackbar is one line by default.")`

### Simple yet powerful customization
There are three parameters you can change: keyboardType, keyboardTheme, and hasAutoCorrect

    **snackbarMessage** (string) -- Add your custom message

    **actionText** (string) -- Add your custom action text. if null, the button will be turned off.

    **textColor** (string) -- You can change the color of the action button using rgba()

    **twoLines** (boolean) -- true = multi-line snackbar, false = single-line snackbar

## Adding Events to the action button
Any Event can be assigned to the snackbar action button. To do this, use this line:

    `snackbarActionBTN.on Events.Click, ->`

___
That's it! the snackbar layers will automatically animate in and out for you. When the layers animate out, they will be destroyed for you. Simple.