Skip to content
Source
Sign inSign up
Open History to see the last commit

RadioIndicator.android.tsx

28 lines1.0 KB

1import { RadioButton } from "@expo/ui/jetpack-compose";
2import { size } from "@expo/ui/jetpack-compose/modifiers";
3import { View } from "react-native";
4import { NativeThemeHost } from "./NativeThemeHost.android";
5import { useControlTheme } from "./useControlTheme";
6​
7/** The enclosing radio row owns selection, touch and accessibility. */
8export function RadioIndicator({ selected }: { readonly selected: boolean }) {
9 const { colors, systemColorsActive } = useControlTheme();
10 return (
11 <View pointerEvents="none" importantForAccessibility="no-hide-descendants">
12 <NativeThemeHost ignoreSafeAreaKeyboardInsets style={{ width: 24, height: 24 }}>
13 <RadioButton
14 selected={selected}
15 modifiers={[size(24, 24)]}
16 colors={
17 systemColorsActive
18 ? {}
19 : {
20 selectedColor: colors["--color-primary-text"],
21 unselectedColor: colors["--color-foreground-muted"],
22 }
23 }
24 />
25 </NativeThemeHost>
26 </View>
27 );