diff --git a/android/app/build.gradle b/android/app/build.gradle index 769a6f20..1357b336 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,6 +152,7 @@ dependencies { compile project(':bugsnag-react-native') compile project(':ReactAndroid') compile project(':RNMail') + compile project(':SNTextView') compile project(':react-native-navigation') compile project(':react-native-keychain') compile project(':react-native-vector-icons') diff --git a/android/app/src/main/java/com/standardnotes/MainApplication.java b/android/app/src/main/java/com/standardnotes/MainApplication.java index e37a0f62..2bbf15f9 100644 --- a/android/app/src/main/java/com/standardnotes/MainApplication.java +++ b/android/app/src/main/java/com/standardnotes/MainApplication.java @@ -5,17 +5,21 @@ import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.WindowManager; + +import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.modules.storage.ReactDatabaseSupplier; import com.chirag.RNMail.RNMail; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.react.modules.core.PermissionAwareActivity; +import com.facebook.react.uimanager.ViewManager; import com.facebook.soloader.SoLoader; import com.oblador.keychain.KeychainPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.reactnativenavigation.NavigationApplication; import com.reactnativenavigation.controllers.ActivityCallbacks; +import com.standardnotes.sntextview.SNTextViewPackage; import com.tectiv3.aes.RCTAesPackage; import com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage; @@ -31,6 +35,10 @@ public class MainApplication extends NavigationApplication { return BuildConfig.DEBUG; } + protected List createViewManagers(ReactApplicationContext reactContext){ + return Arrays.asList(); + } + protected List getPackages() { return Arrays.asList( @@ -40,7 +48,8 @@ public class MainApplication extends NavigationApplication { new VectorIconsPackage(), new RCTAesPackage(), new RNMail(), - new ReactNativeFingerprintScannerPackage() + new ReactNativeFingerprintScannerPackage(), + new SNTextViewPackage() ); } diff --git a/android/settings.gradle b/android/settings.gradle index 31b91843..9527fcbf 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,8 @@ rootProject.name = 'StandardNotes' + +include ':SNTextView' +project(':SNTextView').projectDir = new File(rootProject.projectDir, '../vendor/sn-textview/android') + include ':bugsnag-react-native' project(':bugsnag-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/bugsnag-react-native/android') diff --git a/src/screens/Compose.js b/src/screens/Compose.js index 66c2a67d..78ee8345 100644 --- a/src/screens/Compose.js +++ b/src/screens/Compose.js @@ -8,6 +8,8 @@ import Icons from '../Icons'; var dismissKeyboard = require('dismissKeyboard'); var _ = require('lodash'); +import TextView from "sn-textview"; + import { AppRegistry, StyleSheet, @@ -264,27 +266,33 @@ export default class Compose extends Abstract { placeholderTextColor={GlobalStyles.constants().mainDimColor} /> - - {}} - onContentSizeChange={this.onContentSizeChange} - autoCapitalize={'sentences'} - /> + {Platform.OS == "android" && + + } - + {Platform.OS == "ios" && + + {}} + onContentSizeChange={this.onContentSizeChange} + autoCapitalize={'sentences'} + /> + + + } ); } @@ -321,14 +329,14 @@ export default class Compose extends Abstract { noteText: { height: "100%", flexGrow: 1, - fontSize: 17, + // fontSize: 17, marginTop: 0, paddingTop: 10, - color: GlobalStyles.constants().mainTextColor, + // color: GlobalStyles.constants().mainTextColor, paddingLeft: GlobalStyles.constants().paddingLeft, paddingRight: GlobalStyles.constants().paddingLeft, - textAlignVertical: 'top', - lineHeight: 22, + // textAlignVertical: 'top', + // lineHeight: 22, } } diff --git a/vendor/sn-textview/Libraries/SNTextView/SNTextView.android.js b/vendor/sn-textview/Libraries/SNTextView/SNTextView.android.js new file mode 100644 index 00000000..95aab095 --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/SNTextView.android.js @@ -0,0 +1,17 @@ +/** + * Stub of SNTextView for Android. + * + * @providesModule SNTextView + * @flow + */ +'use strict'; + +var warning = require('fbjs/lib/warning'); + +var SNTextView = { + test: function() { + warning('Not yet implemented for Android.'); + } +}; + +module.exports = SNTextView; diff --git a/vendor/sn-textview/Libraries/SNTextView/SNTextView.h b/vendor/sn-textview/Libraries/SNTextView/SNTextView.h new file mode 100644 index 00000000..5dc0d8e3 --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/SNTextView.h @@ -0,0 +1,5 @@ +#import + +@interface SNTextView : NSObject + +@end diff --git a/vendor/sn-textview/Libraries/SNTextView/SNTextView.ios.js b/vendor/sn-textview/Libraries/SNTextView/SNTextView.ios.js new file mode 100644 index 00000000..c277218a --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/SNTextView.ios.js @@ -0,0 +1,19 @@ +/** + * @providesModule SNTextView + * @flow + */ +'use strict'; + +var NativeSNTextView = require('NativeModules').SNTextView; + +/** + * High-level docs for the SNTextView iOS API can be written here. + */ + +var SNTextView = { + test: function() { + NativeSNTextView.test(); + } +}; + +module.exports = SNTextView; diff --git a/vendor/sn-textview/Libraries/SNTextView/SNTextView.m b/vendor/sn-textview/Libraries/SNTextView/SNTextView.m new file mode 100644 index 00000000..ba0e05a5 --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/SNTextView.m @@ -0,0 +1,12 @@ +#import "SNTextView.h" + +@implementation SNTextView + +RCT_EXPORT_MODULE() + +RCT_EXPORT_METHOD(test) +{ + // Your implementation here +} + +@end diff --git a/vendor/sn-textview/Libraries/SNTextView/SNTextView.xcodeproj/project.pbxproj b/vendor/sn-textview/Libraries/SNTextView/SNTextView.xcodeproj/project.pbxproj new file mode 100644 index 00000000..4a8401f6 --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/SNTextView.xcodeproj/project.pbxproj @@ -0,0 +1,254 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 13BE3DEE1AC21097009241FE /* SNTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* SNTextView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 58B511D91A9E6C8500147676 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 134814201AA4EA6300B7C361 /* libSNTextView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSNTextView.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 13BE3DEC1AC21097009241FE /* SNTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SNTextView.h; sourceTree = ""; }; + 13BE3DED1AC21097009241FE /* SNTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SNTextView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 58B511D81A9E6C8500147676 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 134814211AA4EA7D00B7C361 /* Products */ = { + isa = PBXGroup; + children = ( + 134814201AA4EA6300B7C361 /* libSNTextView.a */, + ); + name = Products; + sourceTree = ""; + }; + 58B511D21A9E6C8500147676 = { + isa = PBXGroup; + children = ( + 13BE3DEC1AC21097009241FE /* SNTextView.h */, + 13BE3DED1AC21097009241FE /* SNTextView.m */, + 134814211AA4EA7D00B7C361 /* Products */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + usesTabs = 0; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 58B511DA1A9E6C8500147676 /* SNTextView */ = { + isa = PBXNativeTarget; + buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SNTextView" */; + buildPhases = ( + 58B511D71A9E6C8500147676 /* Sources */, + 58B511D81A9E6C8500147676 /* Frameworks */, + 58B511D91A9E6C8500147676 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SNTextView; + productName = RCTDataManager; + productReference = 134814201AA4EA6300B7C361 /* libSNTextView.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 58B511D31A9E6C8500147676 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 58B511DA1A9E6C8500147676 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SNTextView" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 58B511D21A9E6C8500147676; + productRefGroup = 58B511D21A9E6C8500147676; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 58B511DA1A9E6C8500147676 /* SNTextView */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 58B511D71A9E6C8500147676 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 13BE3DEE1AC21097009241FE /* SNTextView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 58B511ED1A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 58B511EE1A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 58B511F01A9E6C8500147676 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../React/**", + "$(SRCROOT)/../../node_modules/react-native/React/**", + ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = SNTextView; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 58B511F11A9E6C8500147676 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(SRCROOT)/../../React/**", + ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = SNTextView; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SNTextView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511ED1A9E6C8500147676 /* Debug */, + 58B511EE1A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SNTextView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 58B511F01A9E6C8500147676 /* Debug */, + 58B511F11A9E6C8500147676 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 58B511D31A9E6C8500147676 /* Project object */; +} diff --git a/vendor/sn-textview/Libraries/SNTextView/package.json b/vendor/sn-textview/Libraries/SNTextView/package.json new file mode 100644 index 00000000..b789e73e --- /dev/null +++ b/vendor/sn-textview/Libraries/SNTextView/package.json @@ -0,0 +1,5 @@ +{ + "name": "SNTextView", + "version": "0.0.1", + "keywords": "react-native" +} diff --git a/vendor/sn-textview/android/build.gradle b/vendor/sn-textview/android/build.gradle new file mode 100644 index 00000000..55a93d4a --- /dev/null +++ b/vendor/sn-textview/android/build.gradle @@ -0,0 +1,34 @@ +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 26 + buildToolsVersion "26.0.1" + + defaultConfig { + minSdkVersion 16 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + } + lintOptions { + abortOnError false + } +} + +repositories { + mavenCentral() +} + +dependencies { + compile "com.facebook.react:react-native:+" +} diff --git a/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.jar b/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..13372aef Binary files /dev/null and b/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.properties b/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..242304ba --- /dev/null +++ b/vendor/sn-textview/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Sep 20 15:56:22 CDT 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip diff --git a/vendor/sn-textview/android/gradlew b/vendor/sn-textview/android/gradlew new file mode 100644 index 00000000..9d82f789 --- /dev/null +++ b/vendor/sn-textview/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/vendor/sn-textview/android/gradlew.bat b/vendor/sn-textview/android/gradlew.bat new file mode 100644 index 00000000..aec99730 --- /dev/null +++ b/vendor/sn-textview/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/vendor/sn-textview/android/src/androidTest/java/com/standardnotes/sntextview/ExampleInstrumentedTest.java b/vendor/sn-textview/android/src/androidTest/java/com/standardnotes/sntextview/ExampleInstrumentedTest.java new file mode 100644 index 00000000..7601d205 --- /dev/null +++ b/vendor/sn-textview/android/src/androidTest/java/com/standardnotes/sntextview/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.standardnotes.sntextview; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.standardnotes.sntextview", appContext.getPackageName()); + } +} diff --git a/vendor/sn-textview/android/src/main/AndroidManifest.xml b/vendor/sn-textview/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..16b6c950 --- /dev/null +++ b/vendor/sn-textview/android/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextView.java b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextView.java new file mode 100644 index 00000000..c7d5242f --- /dev/null +++ b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextView.java @@ -0,0 +1,89 @@ +package com.standardnotes.sntextview; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.Color; +import android.graphics.PorterDuff; +import android.text.Editable; +import android.text.TextWatcher; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ScrollView; + +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; + +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.ReactContext; +import com.facebook.react.bridge.WritableMap; +import com.facebook.react.uimanager.events.RCTEventEmitter; + +import static java.security.AccessController.getContext; + +/** + * Created by mo on 9/20/17. + */ + +public class SNTextView extends LinearLayout { + + private EditText editText; + private ScrollView scrollView; + + @SuppressLint("ResourceAsColor") + public SNTextView(Context context) { + super(context); + + LayoutParams lp = new LayoutParams(MATCH_PARENT, MATCH_PARENT); + + scrollView = new ScrollView(context); + scrollView.setBackgroundColor(android.R.color.transparent); + scrollView.setLayoutParams(lp); + + editText = new EditText(this.getContext()); + editText.setLayoutParams(lp); + + editText.addTextChangedListener(new TextWatcher() { + + @Override + public void afterTextChanged(Editable s) { + + } + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + textDidChange(s.toString()); + } + }); + + scrollView.addView(editText); + this.addView(scrollView, lp); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + super.onLayout(changed, left, top, right, bottom); + } + + + public void setText(String text) { + editText.setText(text); + } + + public void textDidChange(String text) { + WritableMap event = Arguments.createMap(); + event.putString("message", editText.getText().toString()); + + final Context context = getContext(); + if (context instanceof ReactContext) { + ((ReactContext) context).getJSModule(RCTEventEmitter.class).receiveEvent(getId(),"onChangeTextValue", event); + } + } +} diff --git a/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewManager.java b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewManager.java new file mode 100644 index 00000000..3db2d8e3 --- /dev/null +++ b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewManager.java @@ -0,0 +1,51 @@ +package com.standardnotes.sntextview; + +import android.support.annotation.Nullable; + +import com.facebook.drawee.backends.pipeline.Fresco; +import com.facebook.react.ReactPackage; +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.Arguments; +import com.facebook.react.bridge.ReactContext; +import com.facebook.react.bridge.WritableMap; +import com.facebook.react.common.MapBuilder; +import com.facebook.react.uimanager.SimpleViewManager; +import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.annotations.ReactProp; + +import java.util.Map; + +import static java.security.AccessController.getContext; + +/** + * Created by mo on 9/20/17. + */ + +public class SNTextViewManager extends SimpleViewManager { + + public static final String REACT_CLASS = "SNTextView"; + + @Override + public String getName() { + return REACT_CLASS; + } + + @Override + public SNTextView createViewInstance(ThemedReactContext context) { + return new SNTextView(context); + } + + @ReactProp(name = "text") + public void setText(SNTextView view, String text) { + view.setText(text); + } + + + @Override + public @Nullable Map getExportedCustomDirectEventTypeConstants() { + return MapBuilder.of( + "onChangeTextValue", + MapBuilder.of("registrationName", "onChangeTextValue") + ); + } +} diff --git a/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewPackage.java b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewPackage.java new file mode 100644 index 00000000..bf4cf54e --- /dev/null +++ b/vendor/sn-textview/android/src/main/java/com/standardnotes/sntextview/SNTextViewPackage.java @@ -0,0 +1,37 @@ +package com.standardnotes.sntextview; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * Created by mo on 9/20/17. + */ + +public class SNTextViewPackage implements ReactPackage { + + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } + + public List> createJSModules() { + return Collections.emptyList(); + } + + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new SNTextViewManager()); + return modules; + } + +} diff --git a/vendor/sn-textview/index.js b/vendor/sn-textview/index.js new file mode 100644 index 00000000..839b56ae --- /dev/null +++ b/vendor/sn-textview/index.js @@ -0,0 +1,3 @@ +import TextView from './src/TextView'; + +export default TextView; diff --git a/vendor/sn-textview/package.json b/vendor/sn-textview/package.json new file mode 100644 index 00000000..158307f9 --- /dev/null +++ b/vendor/sn-textview/package.json @@ -0,0 +1,14 @@ +{ + "name": "sn-textview", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + + } +} diff --git a/vendor/sn-textview/src/TextView.js b/vendor/sn-textview/src/TextView.js new file mode 100644 index 00000000..5a89b0c1 --- /dev/null +++ b/vendor/sn-textview/src/TextView.js @@ -0,0 +1,27 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import {requireNativeComponent, View, TextInput} from 'react-native'; + +export default class TextView extends Component { + constructor(props) { + super(props); + } + + onChangeText = (event) => { + this.props.onChangeText(event.nativeEvent.message); + } + + render() { + return + } +} + +TextView.propTypes = { + onChangeText: PropTypes.func, + text: PropTypes.string, + ...View.propTypes +} + +var SNTextView = requireNativeComponent("SNTextView", TextView, { + +});