From 0f50b51a1b8a94ccc12ea81c685789614c7d42b6 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 19 Feb 2021 19:51:59 +0100 Subject: [PATCH] Add cool splashscreen --- example/index.tsx | 43 ++++++++++---- .../Images.xcassets/Contents.json | 4 +- .../shutter.imageset/Contents.json | 23 +++++++ .../shutter.imageset/IMG_7966-1.jpg | Bin 0 -> 6322 bytes .../shutter.imageset/IMG_7966-2.jpg | Bin 0 -> 6322 bytes .../shutter.imageset/IMG_7966.jpg | Bin 0 -> 6322 bytes .../LaunchScreen.storyboard | 51 ++++++---------- example/src/App.tsx | 1 - example/src/views/CaptureButton.tsx | 56 ++++++++++-------- 9 files changed, 104 insertions(+), 74 deletions(-) create mode 100644 example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/Contents.json create mode 100644 example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-1.jpg create mode 100644 example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-2.jpg create mode 100644 example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966.jpg diff --git a/example/index.tsx b/example/index.tsx index f4c507e..823a9f4 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -5,11 +5,19 @@ import { App } from './src/App'; import { Settings } from './src/Settings'; import { Splash } from './src/Splash'; import { Media } from './src/Media'; +import { Camera } from 'react-native-vision-camera'; Navigation.setDefaultOptions({ topBar: { visible: false, }, + window: { + backgroundColor: 'black', + }, + layout: { + backgroundColor: 'black', + componentBackgroundColor: 'black' + }, }); Navigation.registerComponent('Splash', () => gestureHandlerRootHOC(Splash), () => Splash); @@ -17,18 +25,27 @@ Navigation.registerComponent('Home', () => gestureHandlerRootHOC(App), () => App Navigation.registerComponent('Media', () => gestureHandlerRootHOC(Media), () => Media); Navigation.registerComponent('Settings', () => gestureHandlerRootHOC(Settings), () => Settings); -Navigation.events().registerAppLaunchedListener(() => { - Navigation.setRoot({ - root: { - stack: { - children: [ - { - component: { - name: 'Splash' - } - } - ] - } - } +Navigation.events().registerAppLaunchedListener(async () => { + const [cameraPermission, microphonePermission] = await Promise.all([ + Camera.getCameraPermissionStatus(), + Camera.getMicrophonePermissionStatus(), + ]); + let rootName = "Splash"; + if (cameraPermission === "authorized" && microphonePermission === "authorized") { + rootName = "Home"; + } + + Navigation.setRoot({ + root: { + stack: { + children: [ + { + component: { + name: rootName + } + } + ] + } + } }); }); diff --git a/example/ios/VisionCameraExample/Images.xcassets/Contents.json b/example/ios/VisionCameraExample/Images.xcassets/Contents.json index 2d92bd5..73c0059 100644 --- a/example/ios/VisionCameraExample/Images.xcassets/Contents.json +++ b/example/ios/VisionCameraExample/Images.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } } diff --git a/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/Contents.json b/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/Contents.json new file mode 100644 index 0000000..1ccfa79 --- /dev/null +++ b/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "IMG_7966.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "IMG_7966-1.jpg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "IMG_7966-2.jpg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-1.jpg b/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95609daa468ee871940047f8dbe8cd8dcf5481d6 GIT binary patch literal 6322 zcmb_g2UJtdwmzX3Q99C#0g)yIL=fqMl%J}C5)f%ZkkG4CL3&fTfbc6-M5%%Sq#5ZV z2I)xey#_%d1oBS6zuf!oTkEZN-<*{*UuO2~bN0;a+21~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 diff --git a/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-2.jpg b/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966-2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95609daa468ee871940047f8dbe8cd8dcf5481d6 GIT binary patch literal 6322 zcmb_g2UJtdwmzX3Q99C#0g)yIL=fqMl%J}C5)f%ZkkG4CL3&fTfbc6-M5%%Sq#5ZV z2I)xey#_%d1oBS6zuf!oTkEZN-<*{*UuO2~bN0;a+21~dZ-gm;UPn_~6M#Sf;0bsE zglQl|!xwQM0QB?#5dZ+F0CET;KnfxVcmWU&fczK(fDVN7Pizbk{v|^K0FelQ?3aug zSQ87VnK=4aO_ELWr-W}d>0g*AN>~Tv3>{oNT|69IT=}FWBmp@!Z9OugMz9=X!DC3@ z&mA|M2vm?QhfqIT!>I)kW=LeT)zvKxjSV!lf73WNiUexq>gq%sjCA&NH@>dMcl(YR zALTSa30`ynE5K)EJ9yVYX9{kzaxVn3S6JZPDb3UG~L>vWTW_R$VK>VDD?N9JqBDOxkEypr9 zjnzS!Zy@Hgaj*h)KyV-yv;JGV{onAf=Yk>t?KOmltCN)=75@LKXNvX>KK%DcFr+zm&o=XVpm%rM=CILVZO&}2J{%X@f z13)=AlBVXbHeopcV4wwnPc^Pq?pDY8i2IV{KDb-A3jl!b4gfH9gJa+x_oZRS{g6{? z06;!LAbb}B0Lo+lIDA4N9OM!Rhj{=%ItBnAoe3WS1}eZ8@Fj&X03-|$QU(a21>gmz zmmG3jPF@`RPeMvYPC-dUO+yO`RMG<^5K>YSGE#DK;^u?|g8cv)134qVlqv<2krkzY z8#C0dTY8qCyv+Nv#Lg$4qh{#-$y(}kxMg5wF=5;M?of|iA znV5p++SuCNw|77|dU$$y`}q1j40{|N5g8R7la&0Al+?6m=^43sFY{j&yna(y@eWm4 zRsFuEwyC+LwXOYA$LHR@{(-@vZ^I+gGqZE^3yVw3E7By>^DO#zkX#=h z+g`%NkMFPa@U$tf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zKI%LO9wAkMJLF<_yWSw3NDi|s`ecyzxeO zOY+&^4ZUyaS@*!4(Iv{QP^9IwZife)0O+7+K0JJWzwQ7L5IkrpJ0a8;pg?_!t}1+b zo!@W~omDit%J$imSE3WOnshegCa>&Z+%5F_>i&0+i!~ROo}-m~^V)f&uq8bWSf7|n zlMG`n67fYVK0f6i;mYDDCY^3GO_*9MlG%t)PQy^^p1$7FL|Q{tOpx}Si%ACwW{-}) R=|I3l;e^co&!5VM{|oiX4Z{Ec literal 0 HcmV?d00001 diff --git a/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966.jpg b/example/ios/VisionCameraExample/Images.xcassets/shutter.imageset/IMG_7966.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95609daa468ee871940047f8dbe8cd8dcf5481d6 GIT binary patch literal 6322 zcmb_g2UJtdwmzX3Q99C#0g)yIL=fqMl%J}C5)f%ZkkG4CL3&fTfbc6-M5%%Sq#5ZV z2I)xey#_%d1oBS6zuf!oTkEZN-<*{*UuO2~bN0;a+21~dZ-gm;UPn_~6M#Sf;0bsE zglQl|!xwQM0QB?#5dZ+F0CET;KnfxVcmWU&fczK(fDVN7Pizbk{v|^K0FelQ?3aug zSQ87VnK=4aO_ELWr-W}d>0g*AN>~Tv3>{oNT|69IT=}FWBmp@!Z9OugMz9=X!DC3@ z&mA|M2vm?QhfqIT!>I)kW=LeT)zvKxjSV!lf73WNiUexq>gq%sjCA&NH@>dMcl(YR zALTSa30`ynE5K)EJ9yVYX9{kzaxVn3S6JZPDb3UG~L>vWTW_R$VK>VDD?N9JqBDOxkEypr9 zjnzS!Zy@Hgaj*h)KyV-yv;JGV{onAf=Yk>t?KOmltCN)=75@LKXNvX>KK%DcFr+zm&o=XVpm%rM=CILVZO&}2J{%X@f z13)=AlBVXbHeopcV4wwnPc^Pq?pDY8i2IV{KDb-A3jl!b4gfH9gJa+x_oZRS{g6{? z06;!LAbb}B0Lo+lIDA4N9OM!Rhj{=%ItBnAoe3WS1}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WpvWCm{4=fypZoL7MQ-2lgDOzON(nHM}=f^2wxBHxSg>Po& zTQ@{_8vCc1A3A`^X=89$*XZQ*^=A8kMSox3=2OGFW1jV3ayl+dOit;h%IG>5aXyVl zY~A*amI|8PG9@sJg2JCwCaIgKJz#3@s|J{ydIgHA^=(ulU5wxM$`qZ&uVQp>)P=US z4T^<-myjs6jiEApClb0XEcQ8j#I+9-z6mIU5SQ0U_PgXe!RfB4%=R6+CKNh zgB$bmEr$IQrO51)GfuB%Mh0XvM`Y2zKI%LO9wAkMJLF<_yWSw3NDi|s`ecyzxeO zOY+&^4ZUyaS@*!4(Iv{QP^9IwZife)0O+7+K0JJWzwQ7L5IkrpJ0a8;pg?_!t}1+b zo!@W~omDit%J$imSE3WOnshegCa>&Z+%5F_>i&0+i!~ROo}-m~^V)f&uq8bWSf7|n zlMG`n67fYVK0f6i;mYDDCY^3GO_*9MlG%t)PQy^^p1$7FL|Q{tOpx}Si%ACwW{-}) R=|I3l;e^co&!5VM{|oiX4Z{Ec literal 0 HcmV?d00001 diff --git a/example/ios/VisionCameraExample/LaunchScreen.storyboard b/example/ios/VisionCameraExample/LaunchScreen.storyboard index fe917be..249e507 100644 --- a/example/ios/VisionCameraExample/LaunchScreen.storyboard +++ b/example/ios/VisionCameraExample/LaunchScreen.storyboard @@ -1,9 +1,9 @@ - + - + @@ -16,43 +16,28 @@ - - - + + + + + + + - - - - - - - - - - - - + + + + + - + + + + diff --git a/example/src/App.tsx b/example/src/App.tsx index cf2044a..f2c6fd5 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -282,7 +282,6 @@ export const App: NavigationFunctionComponent = ({ componentId }) => { style={styles.captureButton} camera={camera} onMediaCaptured={onMediaCaptured} - maximumVideoDuration={15} cameraZoom={zoom} flash={supportsFlash ? flash : "off"} enabled={isCameraInitialized && isActive} diff --git a/example/src/views/CaptureButton.tsx b/example/src/views/CaptureButton.tsx index 17843aa..da19e7b 100644 --- a/example/src/views/CaptureButton.tsx +++ b/example/src/views/CaptureButton.tsx @@ -24,9 +24,10 @@ import { CAPTURE_BUTTON_SIZE, SCREEN_HEIGHT, SCREEN_WIDTH, USE_SNAPSHOT_ON_ANDRO const PAN_GESTURE_HANDLER_FAIL_X = [-SCREEN_WIDTH, SCREEN_WIDTH]; const PAN_GESTURE_HANDLER_ACTIVE_Y = [-2, 2]; -const IS_ANDROID = Platform.OS === "android" +const IS_ANDROID = Platform.OS === "android"; const START_RECORDING_DELAY = 200; +const BORDER_WIDTH = CAPTURE_BUTTON_SIZE * 0.1; interface Props extends ViewProps { camera: React.RefObject; @@ -79,8 +80,8 @@ const _CaptureButton: React.FC = ({ // capture rate at the cost of greatly reduced quality. const photoMethod = USE_SNAPSHOT_ON_ANDROID && - IS_ANDROID && - takePhotoOptions.flash === "off" + IS_ANDROID && + takePhotoOptions.flash === "off" ? "snapshot" : "photo"; console.log(`Taking ${photoMethod}...`); @@ -251,8 +252,8 @@ const _CaptureButton: React.FC = ({ () => ({ transform: [ { - scale: withSpring(isPressingButton.value ? 1.1 : 1, { - mass: 0.5, + scale: withSpring(isPressingButton.value ? 1 : 0, { + mass: 1, damping: 35, stiffness: 300, }), @@ -262,23 +263,29 @@ const _CaptureButton: React.FC = ({ [isPressingButton] ); const buttonStyle = useAnimatedStyle( - () => ({ - opacity: withTiming(enabled ? 1 : 0.3, { - duration: 100, - easing: Easing.linear, - }), - transform: [ - { - scale: withSpring( - enabled ? (isPressingButton.value ? 1 : 0.9) : 0.6, - { - stiffness: 500, - damping: 300, - } - ), - }, - ], - }), + () => { + return ({ + opacity: withTiming(enabled ? 1 : 0.3, { + duration: 100, + easing: Easing.linear, + }), + transform: [ + { + scale: withSpring( + enabled + ? isPressingButton.value + ? 1 + : 0.9 + : 0.6, + { + stiffness: 500, + damping: 300, + } + ), + }, + ], + }) + }, [enabled, isPressingButton] ); @@ -319,14 +326,13 @@ const styles = StyleSheet.create({ width: CAPTURE_BUTTON_SIZE, height: CAPTURE_BUTTON_SIZE, borderRadius: CAPTURE_BUTTON_SIZE / 2, - borderWidth: 3, - borderColor: "rgba(225, 48, 108, 0.7)", + backgroundColor: "#e34077", }, button: { width: CAPTURE_BUTTON_SIZE, height: CAPTURE_BUTTON_SIZE, borderRadius: CAPTURE_BUTTON_SIZE / 2, - borderWidth: CAPTURE_BUTTON_SIZE * 0.1, + borderWidth: BORDER_WIDTH, borderColor: "white", }, });