diff --git a/.github/workflows/rnvUnitTest.yml b/.github/workflows/rnvUnitTest.yml index ba545806bc..1c042fed5e 100644 --- a/.github/workflows/rnvUnitTest.yml +++ b/.github/workflows/rnvUnitTest.yml @@ -20,6 +20,7 @@ jobs: run: | yarn yarn bootstrap + yarn lint yarn test env: CI: true diff --git a/packages/app-harness/buildHooks/tsconfig.json b/packages/app-harness/buildHooks/tsconfig.json deleted file mode 100644 index 82dac4d899..0000000000 --- a/packages/app-harness/buildHooks/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@rnv/core/tsconfig.hooks.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - } -} diff --git a/packages/app-harness/renative.json b/packages/app-harness/renative.json index e16ab72834..57f4113220 100644 --- a/packages/app-harness/renative.json +++ b/packages/app-harness/renative.json @@ -12,7 +12,7 @@ "react-native-splash-screen": { "android": { "templateAndroid": { - "MainActivity_java": { + "MainActivity_kt": { "createMethods": ["SplashScreen.show(this)"], "imports": ["org.devio.rn.splashscreen.SplashScreen"] } @@ -40,7 +40,7 @@ "TestNativeModule": { "android": { "templateAndroid": { - "MainApplication_java": { + "MainApplication_kt": { "packages": ["MyAppPackage"] } }, @@ -100,6 +100,11 @@ "tag": "manifest", "android:name": "", "children": [ + { + "tag": "uses-permission ", + "android:name": "android.permission.WRITE_EXTERNAL_STORAGE", + "children": [] + }, { "tag": "application", "android:name": ".MainApplication", @@ -108,7 +113,8 @@ "tag": "activity", "android:name": "com.ahmedadeltito.photoeditor.PhotoEditorActivity", "children": [] - } + }, + { "tag": "activity", "android:name": "com.yalantis.ucrop.UCropActivity" } ] } ] diff --git a/packages/app-harness/src/app/index.tsx b/packages/app-harness/src/app/index.tsx index dc8019169f..7656e294cf 100644 --- a/packages/app-harness/src/app/index.tsx +++ b/packages/app-harness/src/app/index.tsx @@ -1,41 +1,65 @@ import React, { useEffect, useState } from 'react'; import { Button, Image, ScrollView, Text, View } from 'react-native'; +import { Api } from '@rnv/renative'; import { OrientationLocker, PORTRAIT, LANDSCAPE } from '../components/OrientationLocker'; import { NewModuleButton } from '../components/NewModuleButton'; -import { SplashScreen } from '../components/SplashScreen'; +import { useSplashScreen } from '../components/SplashScreen'; import { ICON_LOGO, testProps } from '../config'; import styles from '../styles'; import { addNotificationListeners, removeNotificationListeners } from '../components/Notifications'; import { requestPermissions } from '../components/Permissions'; import { TestCase } from '../components/TestCase'; -const App = () => { +import config from '../../package.json'; +import { LoggerProvider, useLoggerContext } from '../context'; +import { NotificationCallback } from '../components/types'; + +const App = () => ( + + + +); + +const AppContent = () => { const [showVideo, setShowVideo] = useState(false); + const { logDebug, logs } = useLoggerContext(); + const { SplashScreen } = useSplashScreen(); + useEffect(() => { SplashScreen.hide(); - addNotificationListeners(); + addNotificationListeners(handleNotification); return () => { - removeNotificationListeners(); + removeNotificationListeners(handleNotification); }; }, []); + const handleNotification: NotificationCallback = (message) => logDebug(message); + + const handleRequestPermissions = async () => { + try { + const permission = await requestPermissions(); + logDebug('Permissions:', permission); + } catch (error) { + logDebug(`${error}`); + } + }; + return ( - + - + ReNative Harness - v1.0.0-rc.12, platform: macos, formFactor: desktop + + {`v${config.version}, platform: ${Api.platform}, factor: ${Api.formFactor}, engine: ${Api.engine}`} + @@ -58,8 +82,8 @@ const App = () => { console.log('onChange', orientation)} - onDeviceChange={(orientation) => console.log('onDeviceChange', orientation)} + onChange={(orientation) => logDebug(`onChange ${orientation}`)} + onDeviceChange={(orientation) => logDebug(`onDeviceChange ${orientation}`)} />