-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Button gestures; clean up settings UX; cleanup lfos on unmount; Rende…
…r lights so they fade out when a connection goes away
- Loading branch information
Showing
34 changed files
with
1,159 additions
and
838 deletions.
There are no files selected for viewing
Binary file modified
BIN
+60.7 KB
(880%)
android/app/src/main/res/drawable-hdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60.7 KB
(880%)
android/app/src/main/res/drawable-mdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60.7 KB
(880%)
android/app/src/main/res/drawable-xhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60.7 KB
(880%)
android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60.7 KB
(880%)
android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// NOTE: this whole file is copied from @shopify/react-native-skia, see TODO | ||
import { useEffect } from "react"; | ||
|
||
import { | ||
DataSourceParam, | ||
SkImage, | ||
useAnimatedImage, | ||
} from "@shopify/react-native-skia"; | ||
const DEFAULT_FRAME_DURATION = 60; | ||
|
||
import { | ||
FrameInfo, | ||
SharedValue, | ||
useFrameCallback, | ||
useSharedValue, | ||
} from "react-native-reanimated"; | ||
|
||
export const useAnimatedImageValue = ( | ||
source: DataSourceParam, | ||
paused?: SharedValue<boolean>, | ||
) => { | ||
const defaultPaused = useSharedValue(false); | ||
const isPaused = paused ?? defaultPaused; | ||
const currentFrame = useSharedValue<null | SkImage>(null); | ||
const lastTimestamp = useSharedValue(-1); | ||
const animatedImage = useAnimatedImage( | ||
source, | ||
(err) => { | ||
console.error(err); | ||
throw new Error( | ||
`Could not load animated image - got '${err.message}'`, | ||
); | ||
}, | ||
false, | ||
); | ||
const frameDuration = | ||
animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION; | ||
|
||
useFrameCallback((frameInfo: FrameInfo) => { | ||
if (!animatedImage) { | ||
currentFrame.value = null; | ||
return; | ||
} | ||
if (isPaused.value && lastTimestamp.value !== -1) { | ||
return; | ||
} | ||
const { timestamp } = frameInfo; | ||
const elapsed = timestamp - lastTimestamp.value; | ||
|
||
// Check if it's time to switch frames based on GIF frame duration | ||
if (elapsed < frameDuration) { | ||
return; | ||
} | ||
|
||
// Update the current frame | ||
animatedImage.decodeNextFrame(); | ||
// TODO: this whole file is copied from @shopify/react-native-skia because | ||
// the following dispose call seems to be causing flickering in the animated | ||
// image. Will try address upstream at some point, then delete this file. | ||
//if (currentFrame.value) { | ||
// currentFrame.value.dispose(); | ||
//} | ||
currentFrame.value = animatedImage.getCurrentFrame(); | ||
|
||
// Update the last timestamp | ||
lastTimestamp.value = timestamp; | ||
}); | ||
useEffect(() => { | ||
return () => { | ||
animatedImage?.dispose(); | ||
}; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
return currentFrame; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
import { Redirect, Stack } from "expo-router"; | ||
import { Stack } from "expo-router"; | ||
import React from "react"; | ||
|
||
import { AccountProvider } from "@/src/account/context"; | ||
import { useAuthContext } from "@/src/auth/context"; | ||
import { timedLog } from "@/src/common/utils"; | ||
import { InProxyProvider } from "@/src/inproxy/context"; | ||
|
||
export default function AppLayout() { | ||
const { mnemonic, deviceNonce } = useAuthContext(); | ||
|
||
if (!mnemonic || !deviceNonce) { | ||
// We are not authenticated | ||
return <Redirect href="/" />; | ||
} | ||
timedLog("AppLayout"); | ||
return ( | ||
<AccountProvider mnemonic={mnemonic} deviceNonce={deviceNonce}> | ||
<InProxyProvider> | ||
<Stack | ||
screenOptions={{ | ||
headerShown: false, | ||
}} | ||
> | ||
<Stack.Screen name="index" /> | ||
</Stack> | ||
</InProxyProvider> | ||
</AccountProvider> | ||
<InProxyProvider> | ||
<Stack | ||
screenOptions={{ | ||
headerShown: false, | ||
}} | ||
> | ||
<Stack.Screen name="index" /> | ||
</Stack> | ||
</InProxyProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.