Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Work around a startup stall caused by expo-image on low-end Android (#1801)

* Use plain RN image for startup-blocking UI

* Add comments

authored by

dan and committed by
GitHub
8747c215 5e2025e6

+39 -11
+21 -8
src/view/com/util/UserAvatar.tsx
··· 1 1 import React, {useMemo} from 'react' 2 - import {StyleSheet, View} from 'react-native' 2 + import {Image, StyleSheet, View} from 'react-native' 3 3 import Svg, {Circle, Rect, Path} from 'react-native-svg' 4 4 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' 5 5 import {HighPriorityImage} from 'view/com/util/images/Image' ··· 27 27 28 28 interface UserAvatarProps extends BaseUserAvatarProps { 29 29 moderation?: ModerationUI 30 + usePlainRNImage?: boolean 30 31 } 31 32 32 33 interface EditableUserAvatarProps extends BaseUserAvatarProps { ··· 110 111 size, 111 112 avatar, 112 113 moderation, 114 + usePlainRNImage = false, 113 115 }: UserAvatarProps) { 114 116 const pal = usePalette('default') 115 117 ··· 146 148 return avatar && 147 149 !((moderation?.blur && isAndroid) /* android crashes with blur */) ? ( 148 150 <View style={{width: size, height: size}}> 149 - <HighPriorityImage 150 - testID="userAvatarImage" 151 - style={aviStyle} 152 - contentFit="cover" 153 - source={{uri: avatar}} 154 - blurRadius={moderation?.blur ? BLUR_AMOUNT : 0} 155 - /> 151 + {usePlainRNImage ? ( 152 + <Image 153 + accessibilityIgnoresInvertColors 154 + testID="userAvatarImage" 155 + style={aviStyle} 156 + resizeMode="cover" 157 + source={{uri: avatar}} 158 + blurRadius={moderation?.blur ? BLUR_AMOUNT : 0} 159 + /> 160 + ) : ( 161 + <HighPriorityImage 162 + testID="userAvatarImage" 163 + style={aviStyle} 164 + contentFit="cover" 165 + source={{uri: avatar}} 166 + blurRadius={moderation?.blur ? BLUR_AMOUNT : 0} 167 + /> 168 + )} 156 169 {alert} 157 170 </View> 158 171 ) : (
+6 -1
src/view/shell/Drawer.tsx
··· 158 158 accessibilityLabel="Profile" 159 159 accessibilityHint="Navigates to your profile" 160 160 onPress={onPressProfile}> 161 - <UserAvatar size={80} avatar={store.me.avatar} /> 161 + <UserAvatar 162 + size={80} 163 + avatar={store.me.avatar} 164 + // See https://github.com/bluesky-social/social-app/pull/1801: 165 + usePlainRNImage={true} 166 + /> 162 167 <Text 163 168 type="title-lg" 164 169 style={[pal.text, s.bold, styles.profileCardDisplayName]}
+12 -2
src/view/shell/bottom-bar/BottomBar.tsx
··· 192 192 styles.onProfile, 193 193 {borderColor: pal.text.color}, 194 194 ]}> 195 - <UserAvatar avatar={store.me.avatar} size={27} /> 195 + <UserAvatar 196 + avatar={store.me.avatar} 197 + size={27} 198 + // See https://github.com/bluesky-social/social-app/pull/1801: 199 + usePlainRNImage={true} 200 + /> 196 201 </View> 197 202 ) : ( 198 203 <View style={[styles.ctrlIcon, pal.text, styles.profileIcon]}> 199 - <UserAvatar avatar={store.me.avatar} size={28} /> 204 + <UserAvatar 205 + avatar={store.me.avatar} 206 + size={28} 207 + // See https://github.com/bluesky-social/social-app/pull/1801: 208 + usePlainRNImage={true} 209 + /> 200 210 </View> 201 211 )} 202 212 </View>