mirror of
https://github.com/RSSNext/Folo.git
synced 2026-10-17 05:08:13 +08:00
fix(mobile): dim disabled switches on Android
Android kept the custom colors of a disabled switch, so a list's locked Private Follow and Hide from Timeline switches looked usable to free users and did nothing when tapped. A disabled switch is now dimmed on Android, as iOS already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,11 @@ export const Switch = ({
|
||||
ios_backgroundColor={gray4}
|
||||
onChange={onChange ?? undefined}
|
||||
onValueChange={onValueChange ?? undefined}
|
||||
style={size === "sm" ? styles.small : styles.default}
|
||||
style={[
|
||||
size === "sm" ? styles.small : styles.default,
|
||||
// iOS dims a disabled switch, but Android keeps the custom colors, so it would look enabled
|
||||
disabled && Platform.OS === "android" && styles.disabledAndroid,
|
||||
]}
|
||||
testID={testID}
|
||||
accessibilityLabel={accessibilityLabel ?? cellLabel}
|
||||
thumbColor={Platform.OS === "android" ? "#FFFFFF" : undefined}
|
||||
@@ -76,4 +80,7 @@ const styles = StyleSheet.create({
|
||||
small: {
|
||||
transform: [{ scaleX: 0.8 }, { scaleY: 0.8 }],
|
||||
},
|
||||
disabledAndroid: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user