This file contains hidden or 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
import { useEffect, useRef } from "react"; | |
import { View } from "react-native"; | |
import Animated, { | |
useAnimatedStyle, | |
useSharedValue, | |
} from "react-native-reanimated"; | |
// Example | |
export default function App() { |
This file contains hidden or 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
import Networking from "react-native/Libraries/Network/RCTNetworking.ios"; | |
// Same import from .android | |
// import Networking from "react-native/Libraries/Network/RCTNetworking.android"; | |
let streamingServer = "Streaming Server URL"; | |
let requestId = null; |
This file contains hidden or 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
import {Dimensions, FlatList, View} from 'react-native'; | |
const screenWidth = Dimensions.get('window').width; | |
const numColumns = 2; | |
const gap = 5; | |
const availableSpace = screenWidth - (numColumns - 1) * gap; | |
const itemSize = availableSpace / numColumns; | |
const renderItem = ({item}) => { |
This file contains hidden or 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
import React from "react"; | |
import { Dimensions, TextInput, ScrollView } from "react-native"; | |
import Animated, { | |
useAnimatedKeyboard, | |
useAnimatedReaction, | |
runOnJS, | |
KeyboardState, | |
useAnimatedProps, | |
useAnimatedScrollHandler, |
This file contains hidden or 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
import { useEffect, useRef } from "react"; | |
import { AppState, AppStateStatus } from "react-native"; | |
export const useFetchOnAppForeground = () => { | |
const listener = useRef(null); | |
function fetchOnAppForeground(params) { | |
if (AppState.currentState === "active") { | |
return fetch(params); | |
} else { |
This file contains hidden or 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
import { createContext, forwardRef, useCallback, useMemo } from "react"; | |
import { FlatList, FlatListProps, ViewToken } from "react-native"; | |
import Animated, { useSharedValue } from "react-native-reanimated"; | |
const MAX_VIEWABLE_ITEMS = 4; | |
type ViewabilityItemsContextType = string[]; | |
export const ViewabilityItemsContext = createContext< | |
Animated.SharedValue<ViewabilityItemsContextType> |
This file contains hidden or 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
diff --git a/node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js b/node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js | |
index 4d6f0dd..e120116 100644 | |
--- a/node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js | |
+++ b/node_modules/react-native/Libraries/Components/View/ReactNativeViewViewConfig.js | |
@@ -13,104 +13,104 @@ import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid | |
import {Platform} from 'react-native'; | |
const ReactNativeViewConfig = { | |
- uiViewClassName: 'RCTView', | |
+ uiViewClassName: "RCTView", |
This file contains hidden or 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
function App() { | |
const data = Array(10).fill(0); | |
const GAP = 5; | |
const numColumns = 3; | |
const { width } = Dimensions.get("window"); | |
// Reduce the size to accomodate margin space by items | |
const ITEM_SIZE = width / numColumns - ((numColumns - 1) * GAP) / numColumns; | |
const renderItem = ({ index }) => { |
This file contains hidden or 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
import React, { useMemo, useState } from "react"; | |
import { LayoutChangeEvent, StyleSheet } from "react-native"; | |
import { | |
PinchGestureHandler, | |
PinchGestureHandlerGestureEvent, | |
} from "react-native-gesture-handler"; | |
import Animated, { | |
useAnimatedGestureHandler, | |
useAnimatedStyle, | |
useSharedValue, |
This file contains hidden or 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
#include <iostream> | |
#include <chrono> | |
class Timer | |
{ | |
public: | |
Timer() { | |
startTimePoint = std::chrono::high_resolution_clock::now(); | |
} | |
~Timer() { |
NewerOlder