add android ripple effect to images in feed (#9273)

This commit is contained in:
Samuel Newman
2025-11-03 19:13:22 +02:00
committed by GitHub
parent 9070fa9a8d
commit b1f1b2050c
2 changed files with 14 additions and 0 deletions
@@ -6,6 +6,7 @@ import Animated, {
} from 'react-native-reanimated' } from 'react-native-reanimated'
import {Image} from 'expo-image' import {Image} from 'expo-image'
import {type AppBskyEmbedImages} from '@atproto/api' import {type AppBskyEmbedImages} from '@atproto/api'
import {utils} from '@bsky.app/alf'
import {msg} from '@lingui/macro' import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@@ -205,6 +206,10 @@ export function AutoSizedImage({
accessibilityLabel={image.alt} accessibilityLabel={image.alt}
accessibilityHint={_(msg`Views full image`)} accessibilityHint={_(msg`Views full image`)}
accessibilityRole="button" accessibilityRole="button"
android_ripple={{
color: utils.alpha(t.atoms.bg.backgroundColor, 0.2),
foreground: true,
}}
style={[ style={[
a.w_full, a.w_full,
a.rounded_md, a.rounded_md,
@@ -228,6 +233,10 @@ export function AutoSizedImage({
accessibilityLabel={image.alt} accessibilityLabel={image.alt}
accessibilityHint={_(msg`Views full image`)} accessibilityHint={_(msg`Views full image`)}
accessibilityRole="button" accessibilityRole="button"
android_ripple={{
color: utils.alpha(t.atoms.bg.backgroundColor, 0.2),
foreground: true,
}}
style={[a.h_full]}> style={[a.h_full]}>
{contents} {contents}
</Pressable> </Pressable>
+5
View File
@@ -2,6 +2,7 @@ import {Pressable, type StyleProp, View, type ViewStyle} from 'react-native'
import {type AnimatedRef} from 'react-native-reanimated' import {type AnimatedRef} from 'react-native-reanimated'
import {Image, type ImageStyle} from 'expo-image' import {Image, type ImageStyle} from 'expo-image'
import {type AppBskyEmbedImages} from '@atproto/api' import {type AppBskyEmbedImages} from '@atproto/api'
import {utils} from '@bsky.app/alf'
import {msg} from '@lingui/macro' import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@@ -60,6 +61,10 @@ export function GalleryItem({
} }
onPressIn={onPressIn ? () => onPressIn(index) : undefined} onPressIn={onPressIn ? () => onPressIn(index) : undefined}
onLongPress={onLongPress ? () => onLongPress(index) : undefined} onLongPress={onLongPress ? () => onLongPress(index) : undefined}
android_ripple={{
color: utils.alpha(t.atoms.bg.backgroundColor, 0.2),
foreground: true,
}}
style={[ style={[
a.flex_1, a.flex_1,
a.overflow_hidden, a.overflow_hidden,