Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RN 0.60 #2

Open
wants to merge 9 commits into
base: fix/rn-0-56-support
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ImageCapInset.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ImageCapInset extends Component {
style={{position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}}
capInsets={capInsets}
source={normalizedSource}
resizeMode={Image.resizeMode.stretch}
resizeMode={'stretch'}
/>
{children}
</View>
Expand Down
10 changes: 3 additions & 7 deletions ImageCapInset.ios.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import React, { Component } from 'react';
import {
StyleSheet,
ImageBackground,
Image,
} from 'react-native';

const styles = StyleSheet.create({

});

class ImageCapInset extends Component {
render() {
return (
<Image
<ImageBackground
{...this.props}
resizeMode={Image.resizeMode.stretch}
resizeMode={'stretch'}
/>
);
}
Expand Down
26 changes: 10 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
def DEFAULT_TARGET_SDK_VERSION = 28
def DEFAULT_MIN_SDK_VERSION = 16

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}

dependencies {
compile 'com.facebook.react:react-native:+'
implementation 'com.facebook.react:react-native:+'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public RCTImageCapInsetView(Context context) {

public void setCapInsets(Rect insets) {
mCapInsets = insets;

reload();
}

Expand All @@ -30,6 +31,11 @@ public void setSource(String uri) {
}

public void reload() {
if (this.mUri == null)
{
return;
}

final String key = mUri + "-" + mCapInsets.toShortString();
final RCTImageCache cache = RCTImageCache.getInstance();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "https://github.com/madsleejensen/react-native-image-capinsets.git"
},
"version": "0.3.1",
"version": "0.5.1",
"description": "android support for Image `capInsets`",
"author": {
"name": "Mads Lee Jensen",
Expand Down