Skip to content

Commit 5fcfe0d

Browse files
committed
feat(example-app): 🎨 integrate Inter font for android apk
1 parent 3412a7c commit 5fcfe0d

File tree

11 files changed

+32
-4
lines changed

11 files changed

+32
-4
lines changed
704 KB
Binary file not shown.
698 KB
Binary file not shown.
729 KB
Binary file not shown.
655 KB
Binary file not shown.
659 KB
Binary file not shown.
678 KB
Binary file not shown.
664 KB
Binary file not shown.
693 KB
Binary file not shown.
622 KB
Binary file not shown.

example/src/App.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1-
import React from "react";
1+
import React, { useCallback } from "react";
22
import { LogBox, StatusBar } from "react-native";
33
import { GestureHandlerRootView } from "react-native-gesture-handler";
44
import { SafeAreaProvider } from "react-native-safe-area-context";
55
import { AdaptUIProvider, Box } from "@adaptui/react-native-tailwind";
66
import { NavigationContainer } from "@react-navigation/native";
7+
import { useFonts } from "expo-font";
8+
import * as SplashScreen from "expo-splash-screen";
79
import tailwind from "twrnc";
810

911
import AppRoot from "./AppRoot";
1012

1113
LogBox.ignoreAllLogs();
1214

1315
const AdaptUIApp = () => {
16+
const [fontsLoaded] = useFonts({
17+
"Inter-Black": require("../assets/fonts/Inter-Black.ttf"),
18+
"Inter-Bold": require("../assets/fonts/Inter-Bold.ttf"),
19+
"Inter-ExtraBold": require("../assets/fonts/Inter-ExtraBold.ttf"),
20+
"Inter-ExtraLight": require("../assets/fonts/Inter-ExtraLight.ttf"),
21+
"Inter-Light": require("../assets/fonts/Inter-Light.ttf"),
22+
"Inter-Medium": require("../assets/fonts/Inter-Medium.ttf"),
23+
"Inter-Regular": require("../assets/fonts/Inter-Regular.ttf"),
24+
"Inter-SemiBold": require("../assets/fonts/Inter-SemiBold.ttf"),
25+
"Inter-Thin": require("../assets/fonts/Inter-Thin.ttf"),
26+
});
27+
28+
const onLayoutRootView = useCallback(async () => {
29+
if (fontsLoaded) {
30+
await SplashScreen.hideAsync();
31+
}
32+
}, [fontsLoaded]);
33+
if (!fontsLoaded) {
34+
return null;
35+
}
1436
return (
15-
<Box style={tailwind.style("flex-1")}>
37+
<Box onLayout={onLayoutRootView} style={tailwind.style("flex-1")}>
1638
<StatusBar
1739
translucent
1840
backgroundColor={"transparent"}

0 commit comments

Comments
 (0)