Skip to content

Commit

Permalink
Image dismissal fix (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews authored Dec 24, 2024
1 parent 43cc9fe commit 6efd898
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Mlem/App/Views/Pages/ImageViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ struct ImageViewer: View {
}
}
.simultaneousGesture(DragGesture(minimumDistance: 1.0)
.updating($dragState) { value, state, _ in
state = true
.onChanged { value in
if !isZoomed, !isDismissing {
offset = value.translation.height
opacity = 1.0 - (abs(value.translation.height) / screenHeight)
}
}
.updating($dragState) { _, state, _ in
// this detects cancelled gestures (e.g., if you zoom while dragging)
state = true
}
)
.onAppear {
updateOpacity(1.0)
Expand Down
10 changes: 5 additions & 5 deletions Mlem/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@
"Hidden" : {

},
"Hidden by user filters" : {
"Hidden by keyword filters" : {

},
"Hide" : {
Expand Down Expand Up @@ -949,7 +949,7 @@
"New Comments" : {

},
"New keyword" : {
"New Keyword..." : {

},
"New Post" : {
Expand Down Expand Up @@ -1086,9 +1086,6 @@
},
"Posts" : {

},
"Posts containing these keywords will not be shown. If you are a moderator or administrator for a given post, it will be present in your feed but require a tap to display the content." : {

},
"Posts from %@ communities" : {

Expand All @@ -1104,6 +1101,9 @@
},
"Posts from your instance's communities" : {

},
"Posts with these keywords in their titles will be hidden. If you are a moderator or administrator of a matching post, it will appear in your feed but require you to tap to view its content." : {

},
"Pride" : {

Expand Down

0 comments on commit 6efd898

Please sign in to comment.