Skip to content

Commit

Permalink
Fix no open option for pdf files on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
robertying committed Jan 2, 2025
1 parent 0193af6 commit 8301056
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/screens/FileDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,13 @@ const FileDetail: React.FC<Props> = ({route, navigation}) => {
onPress={() => handleDownload(true)}
icon={props => <Icon {...props} name="refresh" />}
/>
{Platform.OS !== 'android' && (
<IconButton
style={styles.rightIcon}
disabled={error || !path}
onPress={handleShare}
icon={props => <Icon {...props} name="ios-share" />}
/>
)}
{DeviceInfo.isMac() && (
<IconButton
style={styles.rightIcon}
disabled={error || !path}
onPress={handleShare}
icon={props => <Icon {...props} name="ios-share" />}
/>
{(Platform.OS === 'android' || DeviceInfo.isMac()) && (
<IconButton
style={styles.rightIcon}
disabled={error || !path}
Expand Down Expand Up @@ -296,19 +294,19 @@ const FileDetail: React.FC<Props> = ({route, navigation}) => {
{file.description || t('noFileDescription')}
</Text>
</ScrollView>
{!canRender && !(Platform.OS === 'ios' && !DeviceInfo.isMac()) ? (
<View
style={[styles.actions, {backgroundColor: theme.colors.surface}]}>
<View style={styles.colCenter}>
<IconButton icon="share" size={48} onPress={handleShare} />
<Text>{t('share')}</Text>
</View>
<View
style={[styles.actions, {backgroundColor: theme.colors.surface}]}>
<View style={styles.colCenter}>
<IconButton icon="share" size={48} onPress={handleShare} />
<Text>{t('share')}</Text>
</View>
{(Platform.OS === 'android' || DeviceInfo.isMac()) && (
<View style={styles.colCenter}>
<IconButton icon="open-in-new" size={48} onPress={handleOpen} />
<Text>{t('open')}</Text>
</View>
</View>
) : null}
)}
</View>
</>
)}
{progress ? (
Expand Down

0 comments on commit 8301056

Please sign in to comment.