Skip to content

Commit

Permalink
Add snackbar example
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Nov 16, 2015
1 parent f2f033b commit ac0a9f6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/android/snackbar.js
@@ -0,0 +1,9 @@
(function (container) {
var Snackbar = require('android.support.design.widget.Snackbar');

$.button.addEventListener('click', function () {
var snack = Snackbar.make(container, "Hello world!", Snackbar.LENGTH_LONG);
snack.show();
});

})($.alert_container);
11 changes: 11 additions & 0 deletions app/views/android/snackbar.xml
@@ -0,0 +1,11 @@
<Alloy>
<Window id="win" title="Snackbar Controller">

<ScrollView>
<View class="vbox" id="alert_container"></View>
<Button id="button">Show Snackbar</Button>
<Label id="notice"></Label>
</ScrollView>

</Window>
</Alloy>
1 change: 1 addition & 0 deletions app/views/index.xml
Expand Up @@ -24,6 +24,7 @@
<ListItem itemId="tinder" platform="ios" title="Tinder UI"/>
<ListItem itemId="gravity" platform="ios" title="Gravity"/>
<ListItem itemId="tableview" platform="ios" title="Table View"/>
<ListItem itemId="snackbar" platform="android" title="Snackbar"/>
</ListSection>
</ListView>
</Window>
Expand Down
Binary file added platform/android/design-23.1.1.aar
Binary file not shown.

0 comments on commit ac0a9f6

Please sign in to comment.