forked from NativeScript/sample-Groceries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroceries.component.html
71 lines (65 loc) · 1.83 KB
/
groceries.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<GridLayout #container
rows="auto, auto, *">
<!-- Row 1: The custom action bar -->
<GridLayout
row="0"
columns="44, *, auto"
class="action-bar-custom">
<Label
col="1"
text="Groceries"></Label>
<!-- Wrap the image in a StackLayout to give it a bigger tap target -->
<StackLayout
col="2"
(tap)="showMenu()">
<Image
src="res://menu"
stretch="none"></Image>
</StackLayout>
</GridLayout>
<!-- Row 2: The text field to add groceries, and recent button -->
<GridLayout
row="1"
columns="auto, *, auto"
[backgroundColor]="isShowingRecent ? '#BBC169' : '#CB1D00'"
class="add-bar">
<StackLayout
class="add-bar-image-container"
col="0"
(tap)="add('button')">
<Image
col="0"
[src]="isShowingRecent ? 'res://recent' : 'res://add'"></Image>
</StackLayout>
<TextField #groceryTextField
col="1"
[(ngModel)]="grocery"
(loaded)="handleAndroidFocus(groceryTextField, container)"
[hint]="isAndroid ? 'ADD A GROCERY' : 'Add a grocery'"
returnKeyType="done"
*ngIf="!isShowingRecent"
(returnPress)="add('textfield')"></TextField>
<Label
col="1"
text="Recent items"
*ngIf="isShowingRecent"
class="add-bar-recent-label"></Label>
<StackLayout
col="2"
class="add-bar-recent-container"
(tap)="toggleRecent()">
<Label
class="add-bar-recent-toggle"
[text]="isShowingRecent ? 'Done' : 'Recent'"></Label>
</StackLayout>
</GridLayout>
<!-- Row 3: The grocery list -->
<gr-grocery-list
[row]="2"
(loading)="showActivityIndicator()"
(loaded)="hideActivityIndicator()"
[showDeleted]="isShowingRecent"></gr-grocery-list>
<ActivityIndicator
[busy]="isLoading"
row="2"></ActivityIndicator>
</GridLayout>