Skip to content

Commit

Permalink
Merge pull request #129 from radko93/master
Browse files Browse the repository at this point in the history
Update for latest React Native, Spinkit Android dependency and TS support
  • Loading branch information
maxs15 authored Sep 27, 2019
2 parents 8bbdd2b + 2deb22b commit 9cd8c75
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 34 deletions.
66 changes: 34 additions & 32 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
}

buildscript {
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
//noinspection GradleDependency
classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.4.1')}")
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion safeExtGet('compileSdkVersion', 23)
buildToolsVersion safeExtGet('buildToolsVersion', "23.0.1")
compileSdkVersion safeExtGet('compileSdkVersion', 28)
//noinspection GradleDependency
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 23)
versionCode 1
versionName "1.0"
minSdkVersion safeExtGet('minSdkVersion', 16)
//noinspection OldTargetApi
targetSdkVersion safeExtGet('targetSdkVersion', 28)
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
lintOptions {
abortOnError false
}
}

repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://jitpack.io"
}
}

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
}
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}"
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
}
2 changes: 1 addition & 1 deletion android/src/main/java/com/react/rnspinkit/RNSpinkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import android.graphics.Color;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
Expand Down
30 changes: 30 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
declare module 'react-native-spinkit' {
import React from 'react';

export type SpinnerType =
| 'CircleFlip'
| 'Bounce'
| 'Wave'
| 'WanderingCubes'
| 'Pulse'
| 'ChasingDots'
| 'ThreeBounce'
| 'Circle'
| '9CubeGrid'
| 'WordPress'
| 'FadingCircle'
| 'FadingCircleAlt'
| 'Arc'
| 'ArcAlt'
| 'Plane';

export type SpinnerProps = {
isVisible?: boolean;
color?: string;
size?: number;
type?: SpinnerType;
};

const Spinner: React.ComponentType<SpinnerProps>;
export default Spinner;
}
2 changes: 1 addition & 1 deletion react-native-spinkit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "react-native-spinkit"
s.version = "1.0.2"
s.version = "1.4.1"
s.license = "MIT"
s.homepage = "https://github.com/maxs15/react-native-spinkit"
s.authors = { 'Maxime Mezrahi' => '[email protected]' }
Expand Down

0 comments on commit 9cd8c75

Please sign in to comment.