Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 950 Bytes

README.md

File metadata and controls

46 lines (35 loc) · 950 Bytes

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,
    length: Snackbar.SNACKBAR_LENGTH_SHORT,
    action: 'Press me!',
    onActionClicked: function() {
      alert('Action clicked!');
    }
  });
});

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

License

MIT

Copyright

© 2017 by Appcelerator