diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 8f7efb46..00000000 --- a/android/build.gradle +++ /dev/null @@ -1,122 +0,0 @@ -buildscript { - // 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["IosContextMenu_kotlinVersion"] - - repositories { - google() - mavenCentral() - } - - dependencies { - classpath "com.android.tools.build:gradle:7.2.1" - // noinspection DifferentKotlinGradleVersion - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -def reactNativeArchitectures() { - def value = rootProject.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} - -def isNewArchitectureEnabled() { - return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" -} - -apply plugin: "com.android.library" -apply plugin: "kotlin-android" - -if (isNewArchitectureEnabled()) { - apply plugin: "com.facebook.react" -} - -def getExtOrDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["IosContextMenu_" + name] -} - -def getExtOrIntegerDefault(name) { - return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["IosContextMenu_" + name]).toInteger() -} - -def supportsNamespace() { - def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') - def major = parsed[0].toInteger() - def minor = parsed[1].toInteger() - - // Namespace support was added in 7.3.0 - return (major == 7 && minor >= 3) || major >= 8 -} - -android { - if (supportsNamespace()) { - namespace "com.ioscontextmenu" - - sourceSets { - main { - manifest.srcFile "src/main/AndroidManifestNew.xml" - } - } - } - - compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") - - defaultConfig { - minSdkVersion getExtOrIntegerDefault("minSdkVersion") - targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() - - } - - buildFeatures { - buildConfig true - } - - buildTypes { - release { - minifyEnabled false - } - } - - lintOptions { - disable "GradleCompatible" - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - sourceSets { - main { - if (isNewArchitectureEnabled()) { - java.srcDirs += [ - "generated/java", - "generated/jni" - ] - } - } - } -} - -repositories { - mavenCentral() - google() -} - -def kotlin_version = getExtOrDefault("kotlinVersion") - -dependencies { - // For < 0.71, this will be from the local maven repo - // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin - //noinspection GradleDynamicVersion - implementation "com.facebook.react:react-native:+" - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -} - -if (isNewArchitectureEnabled()) { - react { - jsRootDir = file("../src/") - libraryName = "IosContextMenuView" - codegenJavaPackageName = "com.ioscontextmenu" - } -} diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 48e17111..00000000 --- a/android/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -IosContextMenu_kotlinVersion=1.7.0 -IosContextMenu_minSdkVersion=21 -IosContextMenu_targetSdkVersion=31 -IosContextMenu_compileSdkVersion=31 -IosContextMenu_ndkversion=21.4.7075529 diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml deleted file mode 100644 index 3d1de1c7..00000000 --- a/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/android/src/main/AndroidManifestNew.xml b/android/src/main/AndroidManifestNew.xml deleted file mode 100644 index a2f47b60..00000000 --- a/android/src/main/AndroidManifestNew.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/android/src/main/java/com/ioscontextmenu/IosContextMenuPackage.kt b/android/src/main/java/com/ioscontextmenu/IosContextMenuPackage.kt deleted file mode 100644 index 52809137..00000000 --- a/android/src/main/java/com/ioscontextmenu/IosContextMenuPackage.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.ioscontextmenu - -import com.facebook.react.ReactPackage -import com.facebook.react.bridge.NativeModule -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.uimanager.ViewManager -import java.util.ArrayList - -class IosContextMenuViewPackage : ReactPackage { - override fun createViewManagers(reactContext: ReactApplicationContext): List> { - val viewManagers: MutableList> = ArrayList() - viewManagers.add(IosContextMenuViewManager()) - return viewManagers - } - - override fun createNativeModules(reactContext: ReactApplicationContext): List { - return emptyList() - } -} diff --git a/android/src/main/java/com/ioscontextmenu/IosContextMenuView.kt b/android/src/main/java/com/ioscontextmenu/IosContextMenuView.kt deleted file mode 100644 index aef2d9cd..00000000 --- a/android/src/main/java/com/ioscontextmenu/IosContextMenuView.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.ioscontextmenu - -import android.content.Context -import android.util.AttributeSet -import android.view.View - -class IosContextMenuView : View { - constructor(context: Context?) : super(context) - constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) - constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super( - context, - attrs, - defStyleAttr - ) -} diff --git a/android/src/main/java/com/ioscontextmenu/IosContextMenuViewManager.kt b/android/src/main/java/com/ioscontextmenu/IosContextMenuViewManager.kt deleted file mode 100644 index fe93fa56..00000000 --- a/android/src/main/java/com/ioscontextmenu/IosContextMenuViewManager.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.ioscontextmenu - -import android.graphics.Color -import com.facebook.react.module.annotations.ReactModule -import com.facebook.react.uimanager.SimpleViewManager -import com.facebook.react.uimanager.ThemedReactContext -import com.facebook.react.uimanager.ViewManagerDelegate -import com.facebook.react.uimanager.annotations.ReactProp -import com.facebook.react.viewmanagers.IosContextMenuViewManagerInterface -import com.facebook.react.viewmanagers.IosContextMenuViewManagerDelegate - -@ReactModule(name = IosContextMenuViewManager.NAME) -class IosContextMenuViewManager : SimpleViewManager(), - IosContextMenuViewManagerInterface { - private val mDelegate: ViewManagerDelegate - - init { - mDelegate = IosContextMenuViewManagerDelegate(this) - } - - override fun getDelegate(): ViewManagerDelegate? { - return mDelegate - } - - override fun getName(): String { - return NAME - } - - public override fun createViewInstance(context: ThemedReactContext): IosContextMenuView { - return IosContextMenuView(context) - } - - @ReactProp(name = "color") - override fun setColor(view: IosContextMenuView?, color: String?) { - view?.setBackgroundColor(Color.parseColor(color)) - } - - companion object { - const val NAME = "IosContextMenuView" - } -}