Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
wip android
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ committed Oct 10, 2023
1 parent ff322dd commit f8d2143
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
4 changes: 1 addition & 3 deletions android/src/main/java/com/pillarbox/PillarboxPackage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
import java.util.Collections
import java.util.HashMap

class PillarboxPackage : TurboReactPackage() {
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
Expand All @@ -21,7 +19,7 @@ class PillarboxPackage : TurboReactPackage() {
}

override fun createViewManagers(reactContext: ReactApplicationContext): MutableList<ViewManager<View, ReactShadowNode<*>>> {
return mutableListOf(PillarboxViewManager())
return super.createViewManagers(reactContext).toMutableList().apply { add(PillarboxViewManager()) }
}

override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
Expand Down
16 changes: 12 additions & 4 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import * as React from 'react';
import {requireNativeComponent} from 'react-native';

Check failure on line 2 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `requireNativeComponent` with `·requireNativeComponent·`

import { StyleSheet, View, Text } from 'react-native';
import { multiply } from 'react-native-pillarbox';
/**
* Composes `View`.
*
* - src: string
* - borderRadius: number
* - resizeMode: 'cover' | 'contain' | 'stretch'
*/
module.exports = requireNativeComponent('PillarboxReactView');

const result = multiply(3, 7);
import { StyleSheet, View, Text } from 'react-native';

Check failure on line 13 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

'Text' is defined but never used

export default function App() {
return (

Check failure on line 16 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎`

<View style={styles.container}>
<Text>Result: {result}</Text>
<PillarboxReactView />

Check failure on line 19 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

'PillarboxReactView' is not defined
</View>
);
}
Expand Down
10 changes: 10 additions & 0 deletions example/src/PillarboxView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {requireNativeComponent} from 'react-native';

Check failure on line 1 in example/src/PillarboxView.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `requireNativeComponent` with `·requireNativeComponent·`

/**
* Composes `View`.
*
* - src: string
* - borderRadius: number
* - resizeMode: 'cover' | 'contain' | 'stretch'
*/
module.exports = requireNativeComponent('PillarboxReactView');

0 comments on commit f8d2143

Please sign in to comment.