remove android
This commit is contained in:
@@ -1,94 +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["UiTextView_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 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["UiTextView_" + name]
|
|
||||||
}
|
|
||||||
|
|
||||||
def getExtOrIntegerDefault(name) {
|
|
||||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["UiTextView_" + 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.uitextview"
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
||||||
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lintOptions {
|
|
||||||
disable "GradleCompatible"
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
UiTextView_kotlinVersion=1.7.0
|
|
||||||
UiTextView_minSdkVersion=21
|
|
||||||
UiTextView_targetSdkVersion=31
|
|
||||||
UiTextView_compileSdkVersion=31
|
|
||||||
UiTextView_ndkversion=21.4.7075529
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.uitextview">
|
|
||||||
</manifest>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
</manifest>
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
package com.uitextview
|
|
||||||
|
|
||||||
import com.facebook.react.ReactPackage
|
|
||||||
import com.facebook.react.bridge.NativeModule
|
|
||||||
import com.facebook.react.bridge.ReactApplicationContext
|
|
||||||
import com.facebook.react.uimanager.ViewManager
|
|
||||||
|
|
||||||
|
|
||||||
class UiTextViewPackage : ReactPackage {
|
|
||||||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
||||||
return emptyList()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
||||||
return listOf(UiTextViewViewManager())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package com.uitextview
|
|
||||||
|
|
||||||
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 UiTextViewViewManager : SimpleViewManager<View>() {
|
|
||||||
override fun getName() = "UiTextViewView"
|
|
||||||
|
|
||||||
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
||||||
return View(reactContext)
|
|
||||||
}
|
|
||||||
|
|
||||||
@ReactProp(name = "color")
|
|
||||||
fun setColor(view: View, color: String) {
|
|
||||||
view.setBackgroundColor(Color.parseColor(color))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-ui-text-view",
|
"name": "react-native-ui-text-view",
|
||||||
"version": "0.0.0",
|
"version": "0.1.0",
|
||||||
"description": "UITextView in React Native on iOS",
|
"description": "UITextView in React Native on iOS",
|
||||||
"main": "src/index",
|
"main": "src/index",
|
||||||
"author": " <> ()",
|
"license": "MIT",
|
||||||
"license": "UNLICENSED",
|
"homepage": "https://github.com/bluesky-social/social-app/modules/react-native-ui-text-view"
|
||||||
"homepage": "#readme"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {StyleSheet, TextProps, ViewStyle} from 'react-native'
|
import {Platform, StyleSheet, TextProps, ViewStyle} from 'react-native'
|
||||||
import {RNUITextView, RNUITextViewChild} from './index'
|
import {RNUITextView, RNUITextViewChild} from './index'
|
||||||
|
|
||||||
const TextAncestorContext = React.createContext<[boolean, ViewStyle]>([
|
const TextAncestorContext = React.createContext<[boolean, ViewStyle]>([
|
||||||
@@ -22,6 +22,10 @@ export function UITextView({style, children, ...rest}: TextProps) {
|
|||||||
[rootStyle, style],
|
[rootStyle, style],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (Platform.OS !== 'ios') {
|
||||||
|
throw new Error('UITextView is only available on iOS')
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAncestor) {
|
if (!isAncestor) {
|
||||||
return (
|
return (
|
||||||
<TextAncestorContext.Provider value={[true, flattenedStyle]}>
|
<TextAncestorContext.Provider value={[true, flattenedStyle]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user