-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "📦 Package: Add `react-native-ios-utilities`" This reverts commit 8d8c104. Revert "⚙️ Chore: `expo-module.config.json`" This reverts commit 9a75128. Revert "❌ Remove: Expo-Module Generated Template" This reverts commit 3c7f180. Revert "📦 Package: Add `@types/react-native`" This reverts commit d2e9607. Revert "💄 Gloss: Add Comments" This reverts commit b00b396. Revert "🆕 Add: Init. Impl. for `RNIModalView`" This reverts commit 7eb0a9e. Revert "❌ Remove: All iOS Sources and Related Files" This reverts commit 8fce587. Revert "⚙️ Chore: Ex - Run `pod install`" This reverts commit a64819c. Revert "📦 Package: Ex - Add `react-native-ios-utilities`" This reverts commit 5992cda. Revert "🆕 Add: Re-Add iOS-Related Source Files" This reverts commit d38b8b5. Revert "📝 Docs: Update TODO" This reverts commit bd52878. Revert "🆕 Add: Expo Modules Template" This reverts commit 1da688b. Revert "📝 Docs: Update TODO" This reverts commit f60d27b. Revert "❌ Remove: All Sources and Related Files" This reverts commit 9533ae9.
- Loading branch information
1 parent
8d8c104
commit e62ec7e
Showing
367 changed files
with
33,621 additions
and
41,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
indent_style = space | ||
indent_size = 2 | ||
|
||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
src/temp | ||
lib | ||
example |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pbxproj -text | ||
# specific for windows script files | ||
*.bat text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Override Yarn command so we can automatically setup the repo on running `yarn` | ||
|
||
yarn-path "scripts/bootstrap.js" |
18 changes: 18 additions & 0 deletions
18
Extensions+RNIDictionaryRepresentable/CGPoint+RNIDictionaryRepresentable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// CGPoint+RNIDictionaryRepresentable.swift | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 5/3/23. | ||
// | ||
|
||
import Foundation | ||
|
||
extension CGPoint: RNIDictionaryRepresentable { | ||
public var asDictionary: [String: Any] { | ||
var dict: [String: Any] = [:]; | ||
dict["x"] = self.x; | ||
dict["y"] = self.y; | ||
|
||
return dict; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,146 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'maven-publish' | ||
|
||
group = 'expo.modules.iosmodal' | ||
version = '0.1.0' | ||
|
||
buildscript { | ||
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") | ||
if (expoModulesCorePlugin.exists()) { | ||
apply from: expoModulesCorePlugin | ||
applyKotlinExpoModulesCorePlugin() | ||
} | ||
|
||
// Simple helper that allows the root project to override versions declared by this library. | ||
ext.safeExtGet = { prop, fallback -> | ||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
} | ||
|
||
// Ensures backward compatibility | ||
ext.getKotlinVersion = { | ||
if (ext.has("kotlinVersion")) { | ||
ext.kotlinVersion() | ||
} else { | ||
ext.safeExtGet("kotlinVersion", "1.8.10") | ||
} | ||
} | ||
// Buildscript is evaluated before everything else so we can't use getExtOrDefault | ||
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['IosModal_kotlinVersion'] | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}") | ||
classpath 'com.android.tools.build:gradle:3.5.3' | ||
// noinspection DifferentKotlinGradleVersion | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
from components.release | ||
} | ||
} | ||
repositories { | ||
maven { | ||
url = mavenLocal().url | ||
} | ||
} | ||
} | ||
def isNewArchitectureEnabled() { | ||
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" | ||
} | ||
|
||
android { | ||
compileSdkVersion safeExtGet("compileSdkVersion", 33) | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_11 | ||
targetCompatibility JavaVersion.VERSION_11 | ||
} | ||
if (isNewArchitectureEnabled()) { | ||
apply plugin: 'com.facebook.react' | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_11.majorVersion | ||
} | ||
def getExtOrDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['IosModal_' + name] | ||
} | ||
|
||
def getExtOrIntegerDefault(name) { | ||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['IosModal_' + name]).toInteger() | ||
} | ||
|
||
android { | ||
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') | ||
|
||
namespace "expo.modules.iosmodal" | ||
defaultConfig { | ||
minSdkVersion safeExtGet("minSdkVersion", 21) | ||
targetSdkVersion safeExtGet("targetSdkVersion", 33) | ||
versionCode 1 | ||
versionName "0.1.0" | ||
minSdkVersion getExtOrIntegerDefault('minSdkVersion') | ||
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') | ||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
disable 'GradleCompatible' | ||
} | ||
publishing { | ||
singleVariant("release") { | ||
withSourcesJar() | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
|
||
def found = false | ||
def defaultDir = null | ||
def androidSourcesName = 'React Native sources' | ||
|
||
if (rootProject.ext.has('reactNativeAndroidRoot')) { | ||
defaultDir = rootProject.ext.get('reactNativeAndroidRoot') | ||
} else { | ||
defaultDir = new File( | ||
projectDir, | ||
'/../../../node_modules/react-native/android' | ||
) | ||
} | ||
|
||
if (defaultDir.exists()) { | ||
maven { | ||
url defaultDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") | ||
found = true | ||
} else { | ||
def parentDir = rootProject.projectDir | ||
|
||
1.upto(5, { | ||
if (found) return true | ||
parentDir = parentDir.parentFile | ||
|
||
def androidSourcesDir = new File( | ||
parentDir, | ||
'node_modules/react-native' | ||
) | ||
|
||
def androidPrebuiltBinaryDir = new File( | ||
parentDir, | ||
'node_modules/react-native/android' | ||
) | ||
|
||
if (androidPrebuiltBinaryDir.exists()) { | ||
maven { | ||
url androidPrebuiltBinaryDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") | ||
found = true | ||
} else if (androidSourcesDir.exists()) { | ||
maven { | ||
url androidSourcesDir.toString() | ||
name androidSourcesName | ||
} | ||
|
||
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") | ||
found = true | ||
} | ||
}) | ||
} | ||
|
||
if (!found) { | ||
throw new GradleException( | ||
"${project.name}: unable to locate React Native android sources. " + | ||
"Ensure you have you installed React Native as a dependency in your project and try again." | ||
) | ||
} | ||
} | ||
|
||
def kotlin_version = getExtOrDefault('kotlinVersion') | ||
|
||
dependencies { | ||
implementation project(':expo-modules-core') | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}" | ||
//noinspection GradleDynamicVersion | ||
implementation "com.facebook.react:react-native:+" | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
// From node_modules | ||
} | ||
|
||
if (isNewArchitectureEnabled()) { | ||
react { | ||
jsRootDir = file("../src/") | ||
libraryName = "IosModal" | ||
codegenJavaPackageName = "com.reactnativeiosmodal" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
IosModal_kotlinVersion=1.7.0 | ||
IosModal_minSdkVersion=21 | ||
IosModal_targetSdkVersion=31 | ||
IosModal_compileSdkVersion=31 | ||
IosModal_ndkversion=21.4.7075529 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
<manifest> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.reactnativeiosmodal"> | ||
|
||
</manifest> |
16 changes: 16 additions & 0 deletions
16
android/src/main/java/com/reactnativeiosmodal/IosModalPackage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.reactnativeiosmodal | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.bridge.NativeModule | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.uimanager.ViewManager | ||
|
||
|
||
class IosModalPackage : ReactPackage { | ||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> { | ||
return emptyList() | ||
} | ||
|
||
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> { | ||
return listOf(IosModalViewManager()) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
android/src/main/java/com/reactnativeiosmodal/IosModalViewManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.reactnativeiosmodal | ||
import android.graphics.Color | ||
import android.view.View | ||
import com.facebook.react.uimanager.SimpleViewManager | ||
import com.facebook.react.uimanager.ThemedReactContext | ||
import com.facebook.react.uimanager.annotations.ReactProp | ||
|
||
class IosModalViewManager : SimpleViewManager<View>() { | ||
override fun getName() = "IosModalView" | ||
|
||
override fun createViewInstance(reactContext: ThemedReactContext): View { | ||
return View(reactContext) | ||
} | ||
|
||
@ReactProp(name = "color") | ||
fun setColor(view: View, color: String) { | ||
view.setBackgroundColor(Color.parseColor(color)) | ||
} | ||
} |
Oops, something went wrong.