mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
RoomVC: Handle live location banner.
This commit is contained in:
@@ -223,6 +223,13 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||
// scroll state just before the layout change, and restore it after the layout.
|
||||
@property (nonatomic) BOOL shouldScrollToBottomAfterLayout;
|
||||
|
||||
/// Handles all banners that should be displayed at the top of the timeline but that should not scroll with the timeline
|
||||
@property (weak, nonatomic, nullable) IBOutlet UIStackView *topBannersStackView;
|
||||
|
||||
@property (nonatomic) BOOL shouldShowLiveLocationSharingBannerView;
|
||||
|
||||
@property (nonatomic, weak) LiveLocationSharingBannerView *liveLocationSharingBannerView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomViewController
|
||||
@@ -2380,6 +2387,18 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||
[suggestionsViewController didMoveToParentViewController:self];
|
||||
}
|
||||
|
||||
- (void)updateTopBanners
|
||||
{
|
||||
[self.view bringSubviewToFront:self.topBannersStackView];
|
||||
|
||||
[self.topBannersStackView vc_removeAllSubviews];
|
||||
|
||||
if (self.shouldShowLiveLocationSharingBannerView)
|
||||
{
|
||||
[self showLiveLocationBannerView];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Jitsi
|
||||
|
||||
- (void)showJitsiCallWithWidget:(Widget*)widget
|
||||
@@ -7323,5 +7342,34 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
|
||||
[self stopActivityIndicator];
|
||||
}
|
||||
|
||||
@end
|
||||
#pragma mark - Live location sharing
|
||||
|
||||
- (void)showLiveLocationBannerView
|
||||
{
|
||||
if (self.liveLocationSharingBannerView)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LiveLocationSharingBannerView *bannerView = [LiveLocationSharingBannerView instantiate];
|
||||
|
||||
[bannerView updateWithTheme:ThemeService.shared.theme];
|
||||
|
||||
MXWeakify(self);
|
||||
|
||||
bannerView.didTapBackground = ^{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self.delegate roomViewControllerDidTapLiveLocationSharingBanner:self];
|
||||
};
|
||||
|
||||
bannerView.didTapStopButton = ^{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self.delegate roomViewControllerDidStopLiveLocationSharing:self];
|
||||
};
|
||||
|
||||
[self.topBannersStackView addArrangedSubview:bannerView];
|
||||
|
||||
self.liveLocationSharingBannerView = bannerView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user