Skip to content

Commit eaaa3c7

Browse files
committed
chore: doc update
1 parent 1299c70 commit eaaa3c7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44

55
Build beautiful, usable products using Material Components for NativeScript.
66

7+
## Installation
8+
9+
### Android
10+
Ensure your Android Theme is inheriting from `MaterialComponents`.
11+
Inside ```App_resources/android/res/values/styles.xml``` replace all occurences of ```Theme.AppCompat``` with ```Theme.MaterialComponents```
12+
You can see an example in the demo-vue app.
13+
14+
## Theming
15+
Defining the theme and the default colors must be done a bit differently on iOS and Android
16+
17+
* **Android**: You must set the colors through [android Style](https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md#appcompat-themes)
18+
* **iOS**: You must set the colors programmatically at your app startup
19+
```typescript
20+
import { themer } from '@nativescript-community/ui-material-core';
21+
if (global.isIOS) {
22+
themer.setPrimaryColor('#bff937');
23+
themer.setAccentColor('#ff8a39');
24+
themer.setSecondaryColor('#a830d7');
25+
}
26+
```
27+
28+
## Mixins
29+
Through this component you can apply `elevation` or `rippleColor` to any `View`. To enable that feature your must "install" the mixins. Make sure you do it before creating any view.
30+
```typescript
31+
import { installMixins } from '@nativescript-community/ui-material-core';
32+
installMixins();
33+
```
34+
735
## Components
836

937
| Name | README | npm | Material design |

0 commit comments

Comments
 (0)