Skip to content

Commit

Permalink
Using button
Browse files Browse the repository at this point in the history
  • Loading branch information
berardo committed Dec 31, 2017
1 parent 3022d98 commit c5be703
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion demo/app/home/home.component.android.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<GridLayout rows="*, auto" columns="*" class="page">
<StackLayout row="0" col="0">
<Label class="h3 m-15 p-10 ex1" [text]="'shadow=\''+elevation+'\''" [shadow]="elevation"></Label>
<Button class="h3 m-15 p-10 ex1" [text]="'shadow=\''+elevation+'\''" [shadow]="elevation"></Button>
<Label class="h3 m-15 p-10 ex2" [text]="'shadow elevation=\''+elevation+'\''" shadow [elevation]="elevation"></Label>
<Label class="h3 m-15 p-10 ex3" [text]="'shadow [elevation]=\''+elevation+'\' bgcolor=\'#006968\' [shape]=\'shape.RECTANGLE\' corderRadius=15'" shadow [elevation]="elevation" bgcolor="#006968" [shape]="shape.RECTANGLE" cornerRadius="15"></Label>
<Label class="h1 m-15 p-15 ex4" text="" [shadow]="androidData"></Label>
Expand Down
44 changes: 22 additions & 22 deletions demo/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ import { ListPicker } from 'ui/list-picker';
styleUrls: ['./home.component.css'],
})
export class HomeComponent implements OnInit {
elevation = 2;
shape = ShapeEnum;
stdElevations: string[] = [];
androidData: AndroidData;
elevation = 2;
shape = ShapeEnum;
stdElevations: string[] = [];
androidData: AndroidData;

ngOnInit(): void {
for (const x in Elevation) {
if (isNaN(parseInt(x, 10))) {
this.stdElevations.push(x);
}
ngOnInit(): void {
for (const x in Elevation) {
if (isNaN(parseInt(x, 10))) {
this.stdElevations.push(x);
}
this.androidData = this.getAndroidData();
}
this.androidData = this.getAndroidData();
}

getAndroidData(): AndroidData {
return {
elevation: this.elevation,
bgcolor: '#ff1744',
shape: ShapeEnum.OVAL,
};
}
getAndroidData(): AndroidData {
return {
elevation: this.elevation,
bgcolor: '#ff1744',
shape: ShapeEnum.OVAL,
};
}

setElevation(newValue) {
const picker = newValue.object as ListPicker;
this.elevation = Elevation[this.stdElevations[picker.selectedIndex]];
this.androidData = this.getAndroidData();
}
setElevation(newValue) {
const picker = newValue.object as ListPicker;
this.elevation = Elevation[this.stdElevations[picker.selectedIndex]];
this.androidData = this.getAndroidData();
}
}

0 comments on commit c5be703

Please sign in to comment.