Change animation speed

This commit is contained in:
Marcin Czachursk 2023-03-17 13:15:21 +01:00
parent ced3fbeb03
commit 04884b4cb0
4 changed files with 11 additions and 11 deletions

View File

@ -1269,7 +1269,7 @@
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1297,7 +1297,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1443,7 +1443,7 @@
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;
@ -1481,7 +1481,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;

View File

@ -42,7 +42,7 @@ struct ImageRow: View {
ImageRowItem(status: self.status, attachmentData: firstAttachment) { (imageWidth, imageHeight) in
// When we download image and calculate real size we have to change view size.
if imageWidth != self.imageWidth || imageHeight != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = imageWidth
self.imageHeight = imageHeight
}
@ -56,7 +56,7 @@ struct ImageRow: View {
// When we download image and calculate real size we have to change view size (only when image is now visible).
if attachmentData.id == self.selected {
if imageWidth != self.imageWidth || imageHeight != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = imageWidth
self.imageHeight = imageHeight
}
@ -72,7 +72,7 @@ struct ImageRow: View {
let doubleImageHeight = Double(attachment.metaImageHeight)
if doubleImageWidth != self.imageWidth || doubleImageHeight != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = doubleImageWidth
self.imageHeight = doubleImageHeight
}

View File

@ -42,7 +42,7 @@ struct ImageRowAsync: View {
ImageRowItemAsync(statusViewModel: self.statusViewModel, attachment: firstAttachment) { (imageWidth, imageHeight) in
// When we download image and calculate real size we have to change view size.
if imageWidth != self.imageWidth || imageHeight != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = imageWidth
self.imageHeight = imageHeight
}
@ -56,7 +56,7 @@ struct ImageRowAsync: View {
// When we download image and calculate real size we have to change view size (only when image is now visible).
if attachment.id == self.selected {
if imageWidth != self.imageWidth || imageHeight != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = imageWidth
self.imageHeight = imageHeight
}
@ -70,7 +70,7 @@ struct ImageRowAsync: View {
if let attachment = self.statusViewModel.mediaAttachments.first(where: { item in item.id == attachmentId }) {
if let size = ImageSizeService.shared.get(for: attachment.url) {
if size.width != self.imageWidth || size.height != self.imageHeight {
withAnimation(.linear) {
withAnimation(.linear(duration: 0.4)) {
self.imageWidth = size.width
self.imageHeight = size.height
}

View File

@ -126,7 +126,7 @@ struct ImageRowItem: View {
width: downloadedImage.size.width,
height: downloadedImage.size.height)
self.uiImage = UIImage(data: imageData)
self.uiImage = downloadedImage
self.onImageDownloaded(size.width, size.height)
HomeTimelineService.shared.update(attachment: attachmentData, withData: imageData, imageWidth: size.width, imageHeight: size.height)