Skip to content

Commit c8d52d2

Browse files
committed
feat: emailPlaceholder and passwordPlaceholder
1 parent e48dfce commit c8d52d2

59 files changed

Lines changed: 2875 additions & 1731 deletions

Some content is hidden

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

example/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/.editorconfig

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ buck-out/
5656
# Bundle artifact
5757
*.jsbundle
5858

59-
# CocoaPods
59+
# Ruby / CocoaPods
6060
/ios/Pods/
61+
/vendor/bundle/

example/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

example/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.4

example/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React, { useState } from "react";
2-
import { View, StatusBar } from "react-native";
3-
import LoginScreen, { SocialButton } from "react-native-login-screen";
1+
import React, {useState} from 'react';
2+
import {View, StatusBar} from 'react-native';
3+
import {LoginScreen, SocialButton} from 'react-native-login-screen';
44

55
const App = () => {
66
const [username, setUsername] = useState(null);
77
const [switchValue, setSwitchValue] = useState(false);
88
const [spinnerVisibility, setSpinnerVisibility] = useState(false);
99

1010
return (
11-
<View style={{ flex: 1 }}>
11+
<View style={{flex: 1}}>
1212
<StatusBar barStyle="light-content" />
1313
<LoginScreen
14-
logoImageSource={require("./assets/logo-example.png")}
14+
logoImageSource={require('./assets/logo-example.png')}
1515
onLoginPress={() => {}}
1616
onHaveAccountPress={() => {}}
1717
onEmailChange={(email: string) => {}}

example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby '2.7.4'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

example/android/app/build.gradle

Lines changed: 102 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: "com.android.application"
22

33
import com.android.build.OutputFile
4+
import org.apache.tools.ant.taskdefs.condition.Os
45

56
/**
67
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -114,16 +115,19 @@ def jscFlavor = 'org.webkit:android-jsc:+'
114115
/**
115116
* Whether to enable the Hermes VM.
116117
*
117-
* This should be set on project.ext.react and mirrored here. If it is not set
118+
* This should be set on project.ext.react and that value will be read here. If it is not set
118119
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119120
* and the benefits of using Hermes will therefore be sharply reduced.
120121
*/
121122
def enableHermes = project.ext.react.get("enableHermes", false);
122123

123124
/**
124-
* Architectures to build native code for in debug.
125+
* Architectures to build native code for.
125126
*/
126-
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
127+
def reactNativeArchitectures() {
128+
def value = project.getProperties().get("reactNativeArchitectures")
129+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
130+
}
127131

128132
android {
129133
ndkVersion rootProject.ext.ndkVersion
@@ -136,13 +140,86 @@ android {
136140
targetSdkVersion rootProject.ext.targetSdkVersion
137141
versionCode 1
138142
versionName "1.0"
143+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144+
145+
if (isNewArchitectureEnabled()) {
146+
// We configure the NDK build only if you decide to opt-in for the New Architecture.
147+
externalNativeBuild {
148+
ndkBuild {
149+
arguments "APP_PLATFORM=android-21",
150+
"APP_STL=c++_shared",
151+
"NDK_TOOLCHAIN_VERSION=clang",
152+
"GENERATED_SRC_DIR=$buildDir/generated/source",
153+
"PROJECT_BUILD_DIR=$buildDir",
154+
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155+
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
156+
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157+
cppFlags "-std=c++17"
158+
// Make sure this target name is the same you specify inside the
159+
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160+
targets "example_appmodules"
161+
162+
// Fix for windows limit on number of character in file paths and in command lines
163+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
164+
arguments "NDK_APP_SHORT_COMMANDS=true"
165+
}
166+
}
167+
}
168+
if (!enableSeparateBuildPerCPUArchitecture) {
169+
ndk {
170+
abiFilters (*reactNativeArchitectures())
171+
}
172+
}
173+
}
139174
}
175+
176+
if (isNewArchitectureEnabled()) {
177+
// We configure the NDK build only if you decide to opt-in for the New Architecture.
178+
externalNativeBuild {
179+
ndkBuild {
180+
path "$projectDir/src/main/jni/Android.mk"
181+
}
182+
}
183+
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
184+
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
185+
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
186+
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
187+
into("$buildDir/react-ndk/exported")
188+
}
189+
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
190+
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
191+
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
192+
into("$buildDir/react-ndk/exported")
193+
}
194+
afterEvaluate {
195+
// If you wish to add a custom TurboModule or component locally,
196+
// you should uncomment this line.
197+
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
198+
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
199+
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
200+
201+
// Due to a bug inside AGP, we have to explicitly set a dependency
202+
// between configureNdkBuild* tasks and the preBuild tasks.
203+
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
204+
configureNdkBuildRelease.dependsOn(preReleaseBuild)
205+
configureNdkBuildDebug.dependsOn(preDebugBuild)
206+
reactNativeArchitectures().each { architecture ->
207+
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
208+
dependsOn("preDebugBuild")
209+
}
210+
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
211+
dependsOn("preReleaseBuild")
212+
}
213+
}
214+
}
215+
}
216+
140217
splits {
141218
abi {
142219
reset()
143220
enable enableSeparateBuildPerCPUArchitecture
144221
universalApk false // If true, also generate a universal APK
145-
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
222+
include (*reactNativeArchitectures())
146223
}
147224
}
148225
signingConfigs {
@@ -156,11 +233,6 @@ android {
156233
buildTypes {
157234
debug {
158235
signingConfig signingConfigs.debug
159-
if (nativeArchitectures) {
160-
ndk {
161-
abiFilters nativeArchitectures.split(',')
162-
}
163-
}
164236
}
165237
release {
166238
// Caution! In production, you need to generate your own keystore file.
@@ -190,6 +262,7 @@ android {
190262

191263
dependencies {
192264
implementation fileTree(dir: "libs", include: ["*.jar"])
265+
193266
//noinspection GradleDynamicVersion
194267
implementation "com.facebook.react:react-native:+" // From node_modules
195268

@@ -217,6 +290,18 @@ dependencies {
217290
}
218291
}
219292

293+
if (isNewArchitectureEnabled()) {
294+
// If new architecture is enabled, we let you build RN from source
295+
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
296+
// This will be applied to all the imported transtitive dependency.
297+
configurations.all {
298+
resolutionStrategy.dependencySubstitution {
299+
substitute(module("com.facebook.react:react-native"))
300+
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
301+
}
302+
}
303+
}
304+
220305
// Run this once to be able to run the application with BUCK
221306
// puts all compile dependencies into folder libs for BUCK to use
222307
task copyDownloadableDepsToLibs(type: Copy) {
@@ -225,3 +310,11 @@ task copyDownloadableDepsToLibs(type: Copy) {
225310
}
226311

227312
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
313+
314+
def isNewArchitectureEnabled() {
315+
// To opt-in for the New Architecture, you can either:
316+
// - Set `newArchEnabled` to true inside the `gradle.properties` file
317+
// - Invoke gradle with `-newArchEnabled=true`
318+
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
319+
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
320+
}

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
android:usesCleartextTraffic="true"
99
tools:targetApi="28"
1010
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
1212
</application>
1313
</manifest>

0 commit comments

Comments
 (0)