Skip to content

Commit 6544165

Browse files
committed
update styles
1 parent bd436dd commit 6544165

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,33 @@ public getCheckProp() {
5555

5656
```
5757

58-
### Angular Usage Help:
59-
[Here](https://github.com/bradmartin/nativescript-drawingpad#angular) is a sample on using UI components in Angular Native (NativeScript + Angular2)
58+
### Angular Usage Sample:
59+
60+
```typescript
61+
import { CheckBox } from 'nativescript-checkbox';
62+
import { registerElement } from "nativescript-angular/element-registry";
63+
registerElement("CheckBox", () => require("nativescript-checkbox").CheckBox);
64+
65+
export class SomeComponent {
66+
@ViewChild("CB1") FirstCheckBox: ElementRef;
67+
constructor() {}
68+
public toggleCheck() {
69+
this.FirstCheckBox.nativeElement.toggle();
70+
}
71+
72+
public getCheckProp() {
73+
console.log('checked prop value = ' + this.FirstCheckBox.nativeElement.checked);
74+
}
75+
}
76+
```
77+
78+
```html
79+
<StackLayout>
80+
<CheckBox #CB1 text="CheckBox Label" checked="false"></CheckBox>
81+
<Button (tap)="toggleCheck()" text="Toggle it!"></Button>
82+
<Button (tap)="getCheckProp()" text="Check Property"></
83+
</StackLayout>
84+
```
6085

6186
## Properties
6287

demo/app/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ ActionBar {
1010
color: #fff;
1111
}
1212

13+
.tab-item {
14+
color: #fff;
15+
background-color: #fff000;
16+
}
17+
1318

1419
#wrapper{
1520
padding: 10;

demo/app/main-page.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ ListView{
1111
.list-check{
1212
font-weight: bold;
1313
font-size: 14;
14-
color: black;
1514
margin: 2%, 0, 2%, 2%;
1615
}
1716

demo/app/main-page.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:CheckBox="nativescript-checkbox" loaded="pageLoaded">
44
<ActionBar title="Native Checkbox" />
55

6-
<TabView id="tabViewContainer">
6+
<TabView id="tabViewContainer" selectedColor="#fff" tabsBackgroundColor="#336699">
77
<TabView.items>
88
<TabViewItem title="General" class="tab-item">
99
<TabViewItem.view>
@@ -19,7 +19,7 @@
1919

2020
<Label text="Events" class="title" />
2121
<StackLayout class="listitem">
22-
<CheckBox:CheckBox text="tap test" checked="false" tap="onTapTest" />
22+
<CheckBox:CheckBox text="tap test" tintColor="#fff000" checked="false" tap="onTapTest" />
2323
<Label text="{{ eventLabel }}" textWrap="true" class="message" />
2424
</StackLayout>
2525

@@ -46,7 +46,7 @@
4646
<ListView items="{{ uberData }}" separatorColor="#d0d0d0">
4747
<ListView.itemTemplate>
4848
<StackLayout class="list-item" >
49-
<CheckBox:CheckBox class="list-check" text="{{ text }}" checked="{{ checked }}" fillColor="{{ color }}" tintColor="{{ color }}" propertyChanged="onPropertyChanged" />
49+
<CheckBox:CheckBox class="list-check" ios:color="#555" text="{{ text }}" checked="{{ checked }}" fillColor="{{ color }}" tintColor="{{ color }}" propertyChanged="onPropertyChanged" />
5050
</StackLayout>
5151
</ListView.itemTemplate>
5252
</ListView>

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"typescript": "^1.8.10",
2323
"tns-platform-declarations": "2.0.0"
2424
}
25-
}
25+
}

0 commit comments

Comments
 (0)