Skip to content

Commit

Permalink
added pan/zoom on images
Browse files Browse the repository at this point in the history
  • Loading branch information
balzack committed Jun 29, 2023
1 parent 5bb3c85 commit 75519d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
4 changes: 2 additions & 2 deletions app/mobile/ios/Databag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.15;
MARKETING_VERSION = 1.17;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -656,7 +656,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.15;
MARKETING_VERSION = 1.17;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
1 change: 1 addition & 0 deletions app/mobile/src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "src",
"dependencies": {
"react-native-awesome-gallery": "^0.3.5",
"react-native-fs": "^2.20.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,22 @@ import { styles } from './ImageAsset.styled';
import Colors from 'constants/Colors';
import Ionicons from 'react-native-vector-icons/AntDesign';
import FastImage from 'react-native-fast-image'
import Gallery from 'react-native-awesome-gallery';

export function ImageAsset({ asset, dismiss }) {
const { state, actions } = useImageAsset(asset);

return (
<TouchableOpacity style={styles.container} activeOpacity={1} onPress={actions.showControls}>
<FastImage source={{ uri: asset.thumb }} onLoad={actions.setRatio}
style={{ ...styles.thumb, width: state.imageWidth, height: state.imageHeight }}
resizeMode={FastImage.resizeMode.contain} />
<TouchableOpacity activeOpacity={1} style={{ display: 'flex', width: '100%', height: '100%' }} onPress={actions.showControls}>
{ state.url && (
<FastImage source={{ uri: state.url }} onLoad={actions.loaded}
style={{ ...styles.main, width: state.imageWidth, height: state.imageHeight }}
resizeMode={FastImage.resizeMode.contain} />
<Gallery data={[ state.url ]} onIndexChange={actions.loaded}
style={{ ...styles.main }} />
)}

{ state.loaded && state.controls && (
{ state.controls && (
<TouchableOpacity style={styles.close} onPress={dismiss}>
<Ionicons name={'close'} size={32} color={Colors.white} />
</TouchableOpacity>
)}

{ state.failed && (
<TouchableOpacity style={styles.loading} onPress={dismiss}>
<ActivityIndicator color={Colors.alert} size="large" />
</TouchableOpacity>
)}
{ !state.loaded && !state.failed && (
<TouchableOpacity style={styles.loading} onPress={dismiss}>
<ActivityIndicator color={Colors.white} size="large" />
{ asset.total > 1 && (
<Text style={styles.decrypting}>{ asset.block } / { asset.total }</Text>
)}
</TouchableOpacity>
)}
</TouchableOpacity>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export function useConversation() {
const { logo, subject } = getChannelSubjectLogo(cardId, profileGuid, channel, cards, cardImageUrl);

if (channel?.topicRevision && channel.readRevision !== channel.topicRevision) {
console.log("READ:", channel.topicRevision);
conversation.actions.setChannelReadRevision(channel.topicRevision);
}

Expand Down

0 comments on commit 75519d0

Please sign in to comment.