Skip to content

chrystoffer/ti.snackbar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ti.Snackbar

Use the Android Snackbar in Appcelerator Titanium.

Snackbar Example

Run the Sample

  1. Copy the ti.snackbar folder to your lib/ (Alloy) or your Resources (Classic) directory
  2. Copy the design-23.1.1.aar to app/platform/android/ (Alloy) or platform/android (Classic)
  3. Copy the example code to your Titanium app
  4. Go for it!

Example

var Snackbar = require('ti.snackbar');

var window = Ti.UI.createWindow({
  backgroundColor: '#fff'
});

var btn = Ti.UI.createButton({
  title: 'Show message!'
});

btn.addEventListener('click', function() {
  Snackbar.show({
    message: 'Titanium rocks!',
    container: window,
    style: 'success', //error - warn - success - info (If not add the style property will be the default color)
    length: Snackbar.SNACKBAR_LENGTH_SHORT,
    action: 'Press me!',
    onActionClicked: function() {
      alert('Action clicked!');
    }
  });
});

window.add(btn);
window.open();

License

MIT

Copyright

© 2017 by Appcelerator

About

Use the Android Snackbar in Appcelerator Titanium.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%