$ yarn add react-native-android-shimmer
10 |
11 | ### Option: Manually
12 |
13 | * Edit `android/settings.gradle` to look like this (without the +):
14 |
15 | ```diff
16 | rootProject.name = 'MyApp'
17 |
18 | include ':app'
19 |
20 | + include ':react-native-android-shimmer'
21 | + project(':react-native-android-shimmer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-shimmer/android')
22 | ```
23 |
24 | * Edit `android/app/build.gradle` (note: **app** folder) to look like this:
25 |
26 | ```diff
27 | apply plugin: 'com.android.application'
28 |
29 | android {
30 | ...
31 | }
32 |
33 | dependencies {
34 | compile fileTree(dir: 'libs', include: ['*.jar'])
35 | compile "com.android.support:appcompat-v7:23.0.1"
36 | compile "com.facebook.react:react-native:+" // From node_modules
37 | + compile project(':react-native-android-shimmer')
38 | }
39 | ```
40 |
41 | * Edit your `MainApplication.java` (deep in `android/app/src/main/java/...`) to look like this (note **two** places to edit):
42 |
43 | ```diff
44 | package com.myapp;
45 |
46 | + import com.ibrahim.ReactAndroidShimmerPackage;
47 |
48 | ....
49 |
50 | @Override
51 | protected ListShimmer
may only have one child and currently doesn't work with View
.
64 |
65 | ### Example with Text
66 | ```javascript
67 | import AndroidShimmer from 'react-native-android-shimmer';
68 |
69 | Prop | 98 |Description | 99 |
---|---|
baseAlpha |
104 | Alpha used to render the base view i.e. the unhighlighted view over which the highlight is drawn. | 105 |
duration |
108 | Time it takes for the highlight to move from one end of the layout to the other. | 109 |
dropoff |
112 | Controls the size of the fading edge of the highlight. | 113 |
intensity |
117 | Controls the brightness of the highlight at the center. | 118 |
maskShape |
122 | Shape of the highlight mask, either with a linear or a circular gradient. | 123 |
maskAngle |
127 | Angle at which the highlight mask is animated, from left-to-right, top-to-bottom etc. | 128 |
tilt |
132 | Angle at which the highlight is tilted, measured in degrees. | 133 |
repeatMode |
137 | What the animation should do after reaching the end, either restart from the beginning or reverse back towards it. | 138 |