From cc00b845ad801a3fbe0673edf0038a5130390bb5 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 29 Jan 2016 18:51:34 -0500 Subject: [PATCH] docs(demos): update action sheet demo to have icons for MD --- demos/action-sheet/index.ts | 71 ++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/demos/action-sheet/index.ts b/demos/action-sheet/index.ts index 66ac40f4af..4f1ee721ed 100644 --- a/demos/action-sheet/index.ts +++ b/demos/action-sheet/index.ts @@ -1,4 +1,4 @@ -import {App, Page, ActionSheet, NavController} from 'ionic/ionic'; +import {App, Page, ActionSheet, NavController, Platform} from 'ionic/ionic'; @App({ @@ -15,24 +15,79 @@ class ApiDemoApp { templateUrl: 'main.html' }) export class InitialPage { - constructor(nav: NavController) { + constructor(nav: NavController, platform: Platform) { this.nav = nav; + this.platform = platform; } present() { - let actionSheet = ActionSheet.create({ + if (this.platform.is('android')) { + var androidSheet = { + title: 'Albums', + buttons: [ + { text: 'Share', + icon: 'share', + handler: () => { + console.log('Share clicked'); + } + }, + { text: 'Play', + icon: 'arrow-dropright-circle', + handler: () => { + console.log('Play clicked'); + } + }, + { text: 'Favorite', + icon: 'md-heart-outline', + handler: () => { + console.log('Favorite clicked'); + } + }, + { + text: 'Delete', + style: 'destructive', + icon: 'md-trash', + handler: () => { + console.log('Destructive clicked'); + } + }, + { + text: 'Cancel', + style: 'cancel', + icon: 'md-close', + handler: () => { + console.log('Cancel clicked'); + } + } + ], + }; + } + + let actionSheet = ActionSheet.create( androidSheet || { buttons: [ { - text: 'Destructive', - style: 'destructive', + text: 'Share', handler: () => { - console.log('Destructive clicked'); + console.log('Share clicked'); } }, { - text: 'Archive', + text: 'Play', handler: () => { - console.log('Archive clicked'); + console.log('Play clicked'); + } + }, + { + text: 'Favorite', + handler: () => { + console.log('Favorite clicked'); + } + }, + { + text: 'Delete', + style: 'destructive', + handler: () => { + console.log('Destructive clicked'); } }, {