Skip to content

Commit

Permalink
removed DBSheet library
Browse files Browse the repository at this point in the history
and improved location sharing viewer to support the same behaviour but only from iOS 16.4
  • Loading branch information
Velin92 committed Jan 23, 2025
1 parent 767f9f9 commit 6b443e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 43 deletions.
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ end

def import_SwiftUI_pods
pod 'Introspect', '~> 0.1'
pod 'DSBottomSheet', '~> 0.3'
pod 'ZXingObjC', '~> 3.6.9'
end

Expand Down
10 changes: 3 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ PODS:
- BlueECC (1.2.5)
- BlueRSA (1.0.200)
- Down (0.11.0)
- DSBottomSheet (0.3.0)
- DSWaveformImage (6.1.1)
- FLEX (5.22.10)
- FlowCommoniOS (1.12.2)
Expand Down Expand Up @@ -86,7 +85,6 @@ PODS:

DEPENDENCIES:
- Down (~> 0.11.0)
- DSBottomSheet (~> 0.3)
- DSWaveformImage (~> 6.1.1)
- FLEX (~> 5.22.10)
- FlowCommoniOS (~> 1.12.0)
Expand Down Expand Up @@ -119,7 +117,6 @@ SPEC REPOS:
- BlueECC
- BlueRSA
- Down
- DSBottomSheet
- DSWaveformImage
- FLEX
- FlowCommoniOS
Expand Down Expand Up @@ -163,7 +160,6 @@ SPEC CHECKSUMS:
BlueECC: 0d18e93347d3ec6d41416de21c1ffa4d4cd3c2cc
BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
DSBottomSheet: ca0ac37eb5af2dd54663f86b84382ed90a59be2a
DSWaveformImage: 3c718a0cf99291887ee70d1d0c18d80101d3d9ce
FLEX: f21ee4f498eed3f8a1eded66b21939fd3b7a22ce
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
Expand All @@ -179,7 +175,7 @@ SPEC CHECKSUMS:
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: e3096b0b47f8a0bde6ae3f614f9c49e7e92b03ea
MatrixSDK: 33d348122df228efa234d7b353c33620fc420a59
MatrixSDKCrypto: 27bee960e0e8b3a3039f3f3e93dd2ec88299c77e
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
Realm: 9ca328bd7e700cc19703799785e37f77d1a130f2
Expand All @@ -198,6 +194,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5

PODFILE CHECKSUM: 9148246fffa2c32e3c9b29a51cae4bb037497056
PODFILE CHECKSUM: 50ea16fe614e202ee198f2378d85dca5b2cf21a8

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Please see LICENSE files in the repository root for full details.
//

import DSBottomSheet
import SwiftUI

struct LiveLocationSharingViewer: View {
Expand All @@ -16,9 +15,7 @@ struct LiveLocationSharingViewer: View {
@Environment(\.theme) private var theme: ThemeSwiftUI

@Environment(\.openURL) var openURL

@State private var isBottomSheetExpanded = false


var bottomSheetCollapsedHeight: CGFloat = 150.0

// MARK: Public
Expand Down Expand Up @@ -111,7 +108,19 @@ struct LiveLocationSharingViewer: View {
}
.accentColor(theme.colors.accent)
.background(theme.colors.system.ignoresSafeArea())
.bottomSheet(sheet, if: viewModel.viewState.isBottomSheetVisible)
.sheet(isPresented: .constant(viewModel.viewState.isBottomSheetVisible)) {
if #available(iOS 16.4, *) {
userLocationList
.presentationBackgroundInteraction(.enabled)
.presentationBackground(theme.colors.background)
.presentationDragIndicator(.visible)
.presentationDetents([.height(bottomSheetCollapsedHeight), .large])
.interactiveDismissDisabled()
} else {
userLocationList
.interactiveDismissDisabled()
}
}
.actionSheet(isPresented: $viewModel.showMapCreditsSheet) {
MapCreditsActionSheet(openURL: { url in
openURL(url)
Expand All @@ -130,8 +139,6 @@ struct LiveLocationSharingViewer: View {
LiveLocationListItem(viewData: viewData, onStopSharingAction: {
viewModel.send(viewAction: .stopSharing)
}, onBackgroundTap: { userId in
// Push bottom sheet down on item tap
isBottomSheetExpanded = false
viewModel.send(viewAction: .tapListItem(userId))
})
}
Expand All @@ -142,34 +149,6 @@ struct LiveLocationSharingViewer: View {
}
}

// MARK: - Bottom sheet

extension LiveLocationSharingViewer {
var sheetStyle: BottomSheetStyle {
var bottomSheetStyle = BottomSheetStyle.standard

bottomSheetStyle.snapRatio = 0.16

let backgroundColor = theme.colors.background

let handleStyle = BottomSheetHandleStyle(backgroundColor: backgroundColor, dividerColor: backgroundColor)
bottomSheetStyle.handleStyle = handleStyle

return bottomSheetStyle
}

var sheet: some BottomSheetView {
BottomSheet(
isExpanded: $isBottomSheetExpanded,
minHeight: .points(bottomSheetCollapsedHeight),
maxHeight: .available,
style: sheetStyle
) {
userLocationList
}
}
}

// MARK: - Previews

struct LiveLocationSharingViewer_Previews: PreviewProvider {
Expand Down

0 comments on commit 6b443e5

Please sign in to comment.