Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(android): Use MD3 loading spinners #14282

MergedPixPMusic(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/14282/headmerged by juliusmarminge View on GitHub

Showing 32 changed files with 55 additions and 2 deletions (loading 29).

x
0 of 32 viewed, 32 left
49 additions and 0 deletionsapps/mobile/src/components/AppActivityIndicator.android.tsxAdded
View file
@@ -0,0 +1,49 @@
+import { LoadingIndicator, Host } from "@expo/ui/jetpack-compose";
+import { size as composeSize } from "@expo/ui/jetpack-compose/modifiers";
+import { StyleSheet, View, type ActivityIndicatorProps } from "react-native";
+import { useResolveClassNames, withUniwind } from "uniwind";
+​
+function AndroidActivityIndicator({
+ animating = true,
+ color,
+ colorClassName: _colorClassName,
+ className: _className,
+ hidesWhenStopped: _hidesWhenStopped,
+ size = "small",
+ style,
+ ...viewProps
+}: ActivityIndicatorProps) {
+ const { color: primaryColor } = useResolveClassNames("text-primary");
+ const diameter = typeof size === "number" ? size : size === "large" ? 48 : 20;
+​
+ return (
+ <View
+ accessible={animating}
+ accessibilityRole="progressbar"
+ accessibilityState={{ busy: animating }}
+ {...viewProps}
+ style={[styles.container, style]}
+ >
+ <View
+ pointerEvents="none"
+ importantForAccessibility="no-hide-descendants"
+ style={{ width: diameter, height: diameter }}