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

Bump sdk #305

Open
wants to merge 23 commits into
base: master
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ project.xcworkspace
.idea
.gradle
local.properties
*.iml

# node.js
#
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Forked from https://github.com/RepairShopr/react-native-signature-capture.

# react-native-signature-capture

## About this
Expand Down
18 changes: 18 additions & 0 deletions RNSignatureCapture.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "RNSignatureCapture"
s.version = package["version"]
s.summary = "React Native library for capturing signature"
s.homepage = "https://github.com/QDivision/react-native-signature-capture"
s.license = "MIT"
s.author = { "RepairShopr" => "https://github.com/RepairShopr" }
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/QDivision/react-native-signature-capture.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m}"

s.dependency "React"
end
4 changes: 2 additions & 2 deletions SignatureCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ class SignatureCapture extends React.Component {
saveImage() {
UIManager.dispatchViewManagerCommand(
ReactNative.findNodeHandle(this),
UIManager.RSSignatureView.Commands.saveImage,
UIManager.getViewManagerConfig('RSSignatureView').Commands.saveImage,
[],
);
}

resetImage() {
UIManager.dispatchViewManagerCommand(
ReactNative.findNodeHandle(this),
UIManager.RSSignatureView.Commands.resetImage,
UIManager.getViewManagerConfig('RSSignatureView').Commands.resetImage,
[],
);
}
Expand Down
20 changes: 0 additions & 20 deletions android/android.iml

This file was deleted.

40 changes: 33 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 33
buildToolsVersion "30.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
minSdkVersion 23
targetSdkVersion 33
versionCode 1
versionName "1.0"
ndk {
Expand All @@ -15,7 +15,33 @@ android {
}
}

buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

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

dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.facebook.react:react-native:0.19.+'
}
implementation 'com.facebook.react:react-native:+'
}
21 changes: 21 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.useAndroidX=true
android.enableJetifier=true
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rssignaturecapture">
</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import android.content.Context;

import android.content.res.Resources;
import android.content.res.TypedArray;

import android.util.Log;
import android.view.View;
import android.view.MotionEvent;

Expand Down Expand Up @@ -86,23 +82,26 @@ public RSSignatureCaptureView(Context context, SignatureCallback callback) {
}

/**
* Get signature
*
* @return
* Get signature as a Bitmap
*/
public Bitmap getSignature() {
// Initialize a Bitmap to contain the signature
Bitmap signatureBitmap = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);

Bitmap signatureBitmap = null;

// set the signature bitmap
if (signatureBitmap == null) {
signatureBitmap = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.RGB_565);
}

// important for saving signature
// This view's pixels constitute the signature, so draw this view onto the signatureBitmap
final Canvas canvas = new Canvas(signatureBitmap);
this.draw(canvas);

// The signatureBitmap now contains the signature with a white background,
// so we will change it to a transparent background.
for (int x = 0; x < signatureBitmap.getWidth(); x++) {
for (int y = 0; y < signatureBitmap.getHeight(); y++) {
if (Color.WHITE == signatureBitmap.getPixel(x, y)) {
signatureBitmap.setPixel(x, y, Color.TRANSPARENT);
}
}
}

return signatureBitmap;
}

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{
"name": "react-native-signature-capture",
"version": "0.4.7",
"name": "@qdivision/react-native-signature-capture",
"version": "0.5.3",
"description": "Lets users sign their signatures",
"main": "SignatureCapture.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/RepairShopr/react-native-signature-capture.git"
"url": "git+https://github.com/QDivision/react-native-signature-capture.git"
},
"keywords": [
"react-component",
"react-native",
"ios",
"android",
"signature"
],
"peerDependencies": {
"react-native": ">=0.47"
},
"author": "RepairShopr",
"author": "QDivision",
"license": "ISC",
"bugs": {
"url": "https://github.com/RepairShopr/react-native-signature-capture/issues"
"url": "https://github.com/QDivision/react-native-signature-capture/issues"
},
"homepage": "https://github.com/RepairShopr/react-native-signature-capture#readme",
"homepage": "https://github.com/QDivision/react-native-signature-capture#readme",
"dependencies": {
"prop-types": "^15.5.10"
}
Expand Down