Skip to content

Commit ea291ee

Browse files
first release
0 parents  commit ea291ee

File tree

93 files changed

+11671
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+11671
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# node.js
6+
#
7+
node_modules/
8+
npm-debug.log
9+
yarn-error.log
10+
11+
# Xcode
12+
#
13+
build/
14+
*.pbxuser
15+
!default.pbxuser
16+
*.mode1v3
17+
!default.mode1v3
18+
*.mode2v3
19+
!default.mode2v3
20+
*.perspectivev3
21+
!default.perspectivev3
22+
xcuserdata
23+
*.xccheckout
24+
*.moved-aside
25+
DerivedData
26+
*.hmap
27+
*.ipa
28+
*.xcuserstate
29+
project.xcworkspace
30+
31+
# Android/IntelliJ
32+
#
33+
build/
34+
.idea
35+
.gradle
36+
local.properties
37+
*.iml
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore

.npmignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# node.js
6+
#
7+
node_modules/
8+
npm-debug.log
9+
yarn-error.log
10+
11+
# Xcode
12+
#
13+
ios/build/
14+
ios/*.pbxuser
15+
ios/!default.pbxuser
16+
ios/*.mode1v3
17+
ios/!default.mode1v3
18+
ios/*.mode2v3
19+
ios/!default.mode2v3
20+
ios/*.perspectivev3
21+
ios/!default.perspectivev3
22+
ios/xcuserdata
23+
ios/*.xccheckout
24+
ios/*.moved-aside
25+
ios/DerivedData
26+
ios/*.hmap
27+
ios/*.ipa
28+
ios/*.xcuserstate
29+
30+
# Android/IntelliJ
31+
#
32+
android/build/
33+
android/.idea
34+
android/.gradle
35+
android/local.properties
36+
android/*.iml
37+
38+
# BUCK
39+
buck-out/
40+
\.buckd/
41+
*.keystore
42+
43+
example
44+
.git*
45+
*.gif

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<h1 align="center">
2+
<div>
3+
React Native Loader Kit
4+
</div>
5+
<br>
6+
<div align="center">
7+
<img src="./demo_android.gif" style="margin-right: 30px;" />
8+
<img src="./demo_ios.gif" />
9+
</div>
10+
</h1>
11+
12+
# Table of Contents
13+
1. [Installation](#Installation)
14+
2. [Usage](#usage)
15+
3. [List animations](#list-animations)
16+
4. [Demo](#demo)
17+
18+
# Installation
19+
With npm:
20+
`$ npm install react-native-loader-kit --save`
21+
22+
With yarn:
23+
`$ yarn add react-native-loader-kit`
24+
25+
## Extra setup step for iOS
26+
Run the following command to setup for iOS:
27+
```
28+
cd ios && pod install
29+
```
30+
# Usage
31+
```js
32+
import LoaderKit from 'react-native-loader-kit'
33+
34+
<LoaderKit
35+
style={{ width: 50, height: 50 }}
36+
name={'BallPulse'} // Optional: see list of animations below
37+
size={50} // Required on iOS
38+
color={'red'} // Optional: color can be: 'red', 'green',... or '#ddd', '#ffffff',...
39+
/>
40+
```
41+
> Note: size is required for iOS
42+
# List animations
43+
As shown in the demo above, animations are as follows:
44+
## Default animations (both Android and iOS)
45+
```json
46+
'1': 'BallPulse',
47+
'2': 'BallGridPulse',
48+
'3': 'BallClipRotate',
49+
'4': 'SquareSpin',
50+
'5': 'BallClipRotatePulse',
51+
'6': 'BallClipRotateMultiple',
52+
'7': 'BallPulseRise',
53+
'8': 'BallRotate',
54+
'9': 'CubeTransition',
55+
'10': 'BallZigZag',
56+
'11': 'BallZigZagDeflect',
57+
'12': 'BallTrianglePath',
58+
'13': 'BallScale',
59+
'14': 'LineScale',
60+
'15': 'LineScaleParty',
61+
'16': 'BallScaleMultiple',
62+
'17': 'BallPulseSync',
63+
'18': 'BallBeat',
64+
'19': 'LineScalePulseOut',
65+
'20': 'LineScalePulseOutRapid',
66+
'21': 'BallScaleRipple',
67+
'22': 'BallScaleRippleMultiple',
68+
'23': 'BallSpinFadeLoader',
69+
'24': 'LineSpinFadeLoader',
70+
'25': 'TriangleSkewSpin',
71+
'26': 'Pacman',
72+
'27': 'BallGridBeat',
73+
'28': 'SemiCircleSpin'
74+
```
75+
## iOS extra animations
76+
```json
77+
'1': 'BallRotateChase',
78+
'2': 'Orbit',
79+
'3': 'AudioEqualizer',
80+
'4': 'CircleStrokeSpin',
81+
'5': 'BallDoubleBounce'
82+
```
83+
# Demo
84+
A fully working demo is located at [example folder](./example/App.js)
85+
86+
If you like this project, encourage me by giving me a ⭐️. Happy hacking

android/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
README
2+
======
3+
4+
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
5+
6+
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
7+
2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
8+
```
9+
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
10+
sdk.dir=/Users/{username}/Library/Android/sdk
11+
```
12+
3. Delete the `maven` folder
13+
4. Run `./gradlew installArchives`
14+
5. Verify that latest set of generated files is in the maven folder with the correct version number

android/build.gradle

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
// android/build.gradle
2+
3+
// based on:
4+
//
5+
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
6+
// original location:
7+
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
8+
//
9+
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
10+
// original location:
11+
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
12+
13+
def DEFAULT_COMPILE_SDK_VERSION = 28
14+
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
15+
def DEFAULT_MIN_SDK_VERSION = 16
16+
def DEFAULT_TARGET_SDK_VERSION = 28
17+
18+
def safeExtGet(prop, fallback) {
19+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20+
}
21+
22+
apply plugin: 'com.android.library'
23+
apply plugin: 'maven'
24+
25+
buildscript {
26+
// The Android Gradle plugin is only required when opening the android folder stand-alone.
27+
// This avoids unnecessary downloads and potential conflicts when the library is included as a
28+
// module dependency in an application project.
29+
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
30+
if (project == rootProject) {
31+
repositories {
32+
google()
33+
jcenter()
34+
}
35+
dependencies {
36+
classpath 'com.android.tools.build:gradle:3.4.1'
37+
}
38+
}
39+
}
40+
41+
apply plugin: 'com.android.library'
42+
apply plugin: 'maven'
43+
44+
android {
45+
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
46+
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
47+
defaultConfig {
48+
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
49+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
50+
versionCode 1
51+
versionName "1.0"
52+
}
53+
lintOptions {
54+
abortOnError false
55+
}
56+
}
57+
58+
repositories {
59+
// ref: https://www.baeldung.com/maven-local-repository
60+
mavenLocal()
61+
maven {
62+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63+
url "$rootDir/../node_modules/react-native/android"
64+
}
65+
maven {
66+
// Android JSC is installed from npm
67+
url "$rootDir/../node_modules/jsc-android/dist"
68+
}
69+
google()
70+
jcenter()
71+
}
72+
73+
dependencies {
74+
//noinspection GradleDynamicVersion
75+
implementation 'com.facebook.react:react-native:+' // From node_modules
76+
implementation 'com.wang.avi:library:2.1.3'
77+
}
78+
79+
def configureReactNativePom(def pom) {
80+
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
81+
82+
pom.project {
83+
name packageJson.title
84+
artifactId packageJson.name
85+
version = packageJson.version
86+
group = "com.reactlibrary"
87+
description packageJson.description
88+
url packageJson.repository.baseUrl
89+
90+
licenses {
91+
license {
92+
name packageJson.license
93+
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
94+
distribution 'repo'
95+
}
96+
}
97+
98+
developers {
99+
developer {
100+
id packageJson.author.username
101+
name packageJson.author.name
102+
}
103+
}
104+
}
105+
}
106+
107+
afterEvaluate { project ->
108+
// some Gradle build hooks ref:
109+
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
110+
task androidJavadoc(type: Javadoc) {
111+
source = android.sourceSets.main.java.srcDirs
112+
classpath += files(android.bootClasspath)
113+
classpath += files(project.getConfigurations().getByName('compile').asList())
114+
include '**/*.java'
115+
}
116+
117+
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
118+
classifier = 'javadoc'
119+
from androidJavadoc.destinationDir
120+
}
121+
122+
task androidSourcesJar(type: Jar) {
123+
classifier = 'sources'
124+
from android.sourceSets.main.java.srcDirs
125+
include '**/*.java'
126+
}
127+
128+
android.libraryVariants.all { variant ->
129+
def name = variant.name.capitalize()
130+
def javaCompileTask = variant.javaCompileProvider.get()
131+
132+
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
133+
from javaCompileTask.destinationDir
134+
}
135+
}
136+
137+
artifacts {
138+
archives androidSourcesJar
139+
archives androidJavadocJar
140+
}
141+
142+
task installArchives(type: Upload) {
143+
configuration = configurations.archives
144+
repositories.mavenDeployer {
145+
// Deploy to react-native-event-bridge/maven, ready to publish to npm
146+
repository url: "file://${projectDir}/../android/maven"
147+
configureReactNativePom pom
148+
}
149+
}
150+
}
53.1 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue May 05 23:18:30 SGT 2020
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

0 commit comments

Comments
 (0)