mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 13:16:58 +02:00
6029: Modify color for dark mode
This commit is contained in:
@@ -108,6 +108,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
||||
private var mapView: MGLMapView!
|
||||
private var annotationView: LocationMarkerView?
|
||||
private static var usernameColorGenerator = UserNameColorGenerator()
|
||||
private static var theme = ThemeService.shared().theme
|
||||
|
||||
private lazy var incomingTimerFormatter: DateFormatter = {
|
||||
let dateFormatter = DateFormatter()
|
||||
@@ -189,6 +190,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
||||
}
|
||||
|
||||
liveLocationContainerView.isHidden = false
|
||||
liveLocationContainerView.backgroundColor = Self.theme.colors.background.withAlphaComponent(0.85)
|
||||
|
||||
liveLocationImageView.image = Asset.Images.locationLiveCellIcon.image
|
||||
liveLocationImageView.tintColor = bannerViewData.iconTint
|
||||
@@ -197,6 +199,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
||||
liveLocationStatusLabel.textColor = bannerViewData.titleColor
|
||||
|
||||
liveLocationTimerLabel.text = bannerViewData.timeLeftString
|
||||
liveLocationTimerLabel.textColor = Self.theme.colors.tertiaryContent
|
||||
liveLocationTimerLabel.isHidden = !bannerViewData.showTimer
|
||||
|
||||
rightButton.setTitle(bannerViewData.rightButtonTitle, for: .normal)
|
||||
@@ -209,11 +212,10 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
||||
}
|
||||
|
||||
private func liveLocationBannerViewData(from viewState: TimelineLiveLocationViewState) -> LiveLocationBannerViewData {
|
||||
let theme = ThemeService.shared().theme
|
||||
|
||||
let iconTint: UIColor
|
||||
let title: String
|
||||
var titleColor: UIColor = theme.roomCellLocalisationTextColor
|
||||
var titleColor: UIColor = Self.theme.colors.primaryContent
|
||||
var placeholderImage: UIImage?
|
||||
var timeLeftString: String?
|
||||
var rightButtonTitle: String?
|
||||
@@ -223,42 +225,42 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat
|
||||
case .incoming(let liveLocationSharingStatus):
|
||||
switch liveLocationSharingStatus {
|
||||
case .starting:
|
||||
iconTint = theme.roomCellLocalisationEndedColor
|
||||
iconTint = Self.theme.roomCellLocalisationEndedColor
|
||||
title = VectorL10n.locationSharingLiveLoading
|
||||
titleColor = theme.roomCellLocalisationEndedColor
|
||||
titleColor = Self.theme.roomCellLocalisationEndedColor
|
||||
placeholderImage = Asset.Images.locationLiveCellLoadingImage.image
|
||||
case .started(let timeLeft):
|
||||
iconTint = theme.roomCellLocalisationIconStartedColor
|
||||
iconTint = Self.theme.roomCellLocalisationIconStartedColor
|
||||
title = VectorL10n.liveLocationSharingBannerTitle
|
||||
timeLeftString = generateTimerString(for: timeLeft, isIncomingLocation: true)
|
||||
case .stopped:
|
||||
iconTint = theme.roomCellLocalisationEndedColor
|
||||
iconTint = Self.theme.roomCellLocalisationEndedColor
|
||||
title = VectorL10n.liveLocationSharingEnded
|
||||
titleColor = theme.roomCellLocalisationEndedColor
|
||||
titleColor = Self.theme.roomCellLocalisationEndedColor
|
||||
placeholderImage = Asset.Images.locationLiveCellEndedImage.image
|
||||
}
|
||||
case .outgoing(let liveLocationSharingStatus):
|
||||
switch liveLocationSharingStatus {
|
||||
case .starting:
|
||||
iconTint = theme.roomCellLocalisationEndedColor
|
||||
iconTint = Self.theme.roomCellLocalisationEndedColor
|
||||
title = VectorL10n.locationSharingLiveLoading
|
||||
titleColor = theme.roomCellLocalisationEndedColor
|
||||
titleColor = Self.theme.roomCellLocalisationEndedColor
|
||||
placeholderImage = Asset.Images.locationLiveCellLoadingImage.image
|
||||
case .started(let timeLeft):
|
||||
iconTint = theme.roomCellLocalisationIconStartedColor
|
||||
iconTint = Self.theme.roomCellLocalisationIconStartedColor
|
||||
title = VectorL10n.liveLocationSharingBannerTitle
|
||||
timeLeftString = generateTimerString(for: timeLeft, isIncomingLocation: false)
|
||||
rightButtonTitle = VectorL10n.stop
|
||||
case .failure:
|
||||
iconTint = theme.roomCellLocalisationErrorColor
|
||||
iconTint = Self.theme.roomCellLocalisationErrorColor
|
||||
title = VectorL10n.locationSharingLiveError
|
||||
titleColor = theme.roomCellLocalisationEndedColor
|
||||
titleColor = Self.theme.roomCellLocalisationEndedColor
|
||||
rightButtonTitle = VectorL10n.retry
|
||||
rightButtonTag = .retrySharing
|
||||
case .stopped:
|
||||
iconTint = theme.roomCellLocalisationEndedColor
|
||||
iconTint = Self.theme.roomCellLocalisationEndedColor
|
||||
title = VectorL10n.liveLocationSharingEnded
|
||||
titleColor = theme.roomCellLocalisationEndedColor
|
||||
titleColor = Self.theme.roomCellLocalisationEndedColor
|
||||
placeholderImage = Asset.Images.locationLiveCellEndedImage.image
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,13 @@
|
||||
<constraint firstAttribute="bottom" secondItem="jWW-0w-1YM" secondAttribute="bottom" id="t8L-m8-q4c"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view alpha="0.84999999999999998" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Hpx-8P-nCb" userLabel="Live Location Container View">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Hpx-8P-nCb" userLabel="Live Location Container View">
|
||||
<rect key="frame" x="0.0" y="20" width="395" height="48"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="72o-VM-Ls7" userLabel="Icon Background View">
|
||||
<rect key="frame" x="11" y="15" width="26" height="18"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="location_live_cell_icon" translatesAutoresizingMaskIntoConstraints="NO" id="pgy-lK-ehN">
|
||||
<rect key="frame" x="8" y="8" width="32" height="32"/>
|
||||
<constraints>
|
||||
@@ -90,12 +94,18 @@
|
||||
<constraint firstItem="k5H-UE-ygH" firstAttribute="top" secondItem="Hpx-8P-nCb" secondAttribute="top" id="3lY-kF-sbf"/>
|
||||
<constraint firstAttribute="bottom" secondItem="pgy-lK-ehN" secondAttribute="bottom" constant="8" id="627-HR-qTF"/>
|
||||
<constraint firstAttribute="trailing" secondItem="k5H-UE-ygH" secondAttribute="trailing" constant="8" id="7tR-A3-1wz"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="trailing" secondItem="pgy-lK-ehN" secondAttribute="trailing" constant="-3" id="GzI-KY-kl5"/>
|
||||
<constraint firstItem="k5H-UE-ygH" firstAttribute="centerY" secondItem="Hpx-8P-nCb" secondAttribute="centerY" id="UZb-Pi-ehQ"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="centerY" secondItem="pgy-lK-ehN" secondAttribute="centerY" id="VSj-Of-cMQ"/>
|
||||
<constraint firstItem="JPw-HF-QCt" firstAttribute="centerY" secondItem="Hpx-8P-nCb" secondAttribute="centerY" id="Z6p-7l-ACV"/>
|
||||
<constraint firstItem="JPw-HF-QCt" firstAttribute="leading" secondItem="pgy-lK-ehN" secondAttribute="trailing" constant="8" id="f4u-0a-3Gt"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="top" secondItem="pgy-lK-ehN" secondAttribute="top" constant="7" id="jJ1-WV-ihb"/>
|
||||
<constraint firstItem="k5H-UE-ygH" firstAttribute="leading" secondItem="JPw-HF-QCt" secondAttribute="trailing" constant="10" id="kEW-C8-xxU"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="leading" secondItem="pgy-lK-ehN" secondAttribute="leading" constant="3" id="mm0-gW-auW"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="bottom" secondItem="pgy-lK-ehN" secondAttribute="bottom" constant="-7" id="okg-2g-Xw4"/>
|
||||
<constraint firstItem="pgy-lK-ehN" firstAttribute="top" secondItem="Hpx-8P-nCb" secondAttribute="top" constant="8" id="p9w-O9-Dnr"/>
|
||||
<constraint firstItem="pgy-lK-ehN" firstAttribute="centerY" secondItem="Hpx-8P-nCb" secondAttribute="centerY" id="svd-Ec-FWD"/>
|
||||
<constraint firstItem="72o-VM-Ls7" firstAttribute="centerX" secondItem="pgy-lK-ehN" secondAttribute="centerX" id="w2R-lD-Ded"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oVd-gS-Rmb">
|
||||
|
||||
Reference in New Issue
Block a user