|
1 |
| -<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->This monorepo contains multiple packages:<br><br><details> |
| 1 | +<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️--> |
| 2 | +[](#nativescript-material-components) |
| 3 | + |
| 4 | +# Nativescript Material Components |
| 5 | + |
| 6 | +[](https://opensource.org/license/apache-2-0/) |
| 7 | +[](http://www.typescriptlang.org/) |
| 8 | +[](https://github.com/lerna-lite/lerna-lite) |
| 9 | + |
| 10 | +Build beautiful, usable products using Material Components for NativeScript. |
| 11 | + |
| 12 | + |
| 13 | +[](#installation) |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +### Android |
| 18 | +Ensure your Android Theme is inheriting from `MaterialComponents`. |
| 19 | +Inside ```App_resources/android/res/values/styles.xml``` replace all occurences of ```Theme.AppCompat``` with ```Theme.MaterialComponents``` |
| 20 | +You can see an example in the demo-vue app. |
| 21 | + |
| 22 | + |
| 23 | +[](#theming) |
| 24 | + |
| 25 | +## Theming |
| 26 | +Defining the theme and the default colors must be done a bit differently on iOS and Android |
| 27 | + |
| 28 | +* **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) |
| 29 | +* **iOS**: You must set the colors programmatically at your app startup |
| 30 | +```typescript |
| 31 | +import { themer } from '@nativescript-community/ui-material-core'; |
| 32 | +if (global.isIOS) { |
| 33 | + themer.setPrimaryColor('#bff937'); |
| 34 | + themer.setAccentColor('#ff8a39'); |
| 35 | + themer.setSecondaryColor('#a830d7'); |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +[](#mixins) |
| 41 | + |
| 42 | +## Mixins |
| 43 | +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. |
| 44 | +```typescript |
| 45 | +import { installMixins } from '@nativescript-community/ui-material-core'; |
| 46 | +installMixins(); |
| 47 | +``` |
| 48 | +This monorepo contains multiple packages:<br><br><details> |
2 | 49 | <summary><b>activityindicator</b></summary>
|
3 | 50 |
|
4 | 51 | [](#nativescript-material-circular-progress-indicator)
|
@@ -2981,6 +3028,34 @@ A boolean attribute to set the floating state of the textview.
|
2981 | 3028 |
|
2982 | 3029 | </details>
|
2983 | 3030 |
|
| 3031 | +[](#faq) |
| 3032 | + |
| 3033 | +## FAQ |
| 3034 | + |
| 3035 | +**Question:** How to use the latest version of this plugin for iOS? |
| 3036 | + |
| 3037 | +**Answer:** To get latest versions of Material Components for iOS (> 112.1) you will need to change Pod min version to 10.0 |
| 3038 | +To do that modify or create `App_Resources/iOS/Podfile` to add `platform :ios, '10.0'`. |
| 3039 | +You can see an example in the demo-vue app. |
| 3040 | + |
| 3041 | +## |
| 3042 | + |
| 3043 | +**Q:** How to migrate to AndroidX with this plugin installed (Android only)? |
| 3044 | + |
| 3045 | +**A:** For Material Components to work correctly with {N} 6 and AndroidX you need to update your android app theme. |
| 3046 | +Inside ```App_resources/android/res/values/styles.xml``` replace all occurences of ```Theme.AppCompat``` with ```Theme.MaterialComponents``` |
| 3047 | +You can see an example in the demo-vue app. |
| 3048 | + |
| 3049 | +## |
| 3050 | + |
| 3051 | +**Q:** What is the difference between Bottom Navigation and Bottom Navigation Bar component? |
| 3052 | + |
| 3053 | +**A:** The _Bottom Navigation Bar_ is a new component to draw a bottom navigation bar in material design. |
| 3054 | +The _Bottom Navigation_ component is a simple extract of the [eponymous component from NativeScript](https://docs.nativescript.org/ui/components/bottom-navigation), which probably will be removed in the future so this one can be used for easy transition. |
| 3055 | + |
| 3056 | +## |
| 3057 | + |
| 3058 | + |
2984 | 3059 | [](#demos-and-development)
|
2985 | 3060 |
|
2986 | 3061 | ## Demos and Development
|
|
0 commit comments