Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Location sharing] Live location cell in timeline #6055

Merged
merged 7 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "Subtract.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2138,10 +2138,15 @@ Tap the + to start adding people.";

"location_sharing_live_share_title" = "Share live location";
"live_location_sharing_banner_title" = "Live location enabled";
"live_location_sharing_ended" = "Live location ended";
"live_location_sharing_banner_stop" = "Stop";
"location_sharing_static_share_title" = "Send my current location";
"location_sharing_pin_drop_share_title" = "Send this location";
"location_sharing_live_map_callout_title" = "Share location";
"location_sharing_live_timer_outgoing" = "%@ left";
"location_sharing_live_timer_incoming" = "Live until %@";
"location_sharing_live_loading" = "Loading Live location...";
"location_sharing_live_error" = "Live location error";

// MARK: - MatrixKit

Expand Down
3 changes: 3 additions & 0 deletions Riot/Generated/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ internal class Asset: NSObject {
internal static let voiceCallHangupIcon = ImageAsset(name: "voice_call_hangup_icon")
internal static let liveLocationIcon = ImageAsset(name: "live_location_icon")
internal static let locationCenterMapIcon = ImageAsset(name: "location_center_map_icon")
internal static let locationLiveCellEndedImage = ImageAsset(name: "location_live_cell_ended_image")
internal static let locationLiveCellIcon = ImageAsset(name: "location_live_cell_icon")
internal static let locationLiveCellLoadingImage = ImageAsset(name: "location_live_cell_loading_image")
internal static let locationLiveIcon = ImageAsset(name: "location_live_icon")
internal static let locationMarkerIcon = ImageAsset(name: "location_marker_icon")
internal static let locationPinIcon = ImageAsset(name: "location_pin_icon")
Expand Down
20 changes: 20 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,10 @@ public class VectorL10n: NSObject {
public static var liveLocationSharingBannerTitle: String {
return VectorL10n.tr("Vector", "live_location_sharing_banner_title")
}
/// Live location ended
public static var liveLocationSharingEnded: String {
return VectorL10n.tr("Vector", "live_location_sharing_ended")
}
/// Loading
public static var loading: String {
return VectorL10n.tr("Vector", "loading")
Expand Down Expand Up @@ -2759,6 +2763,14 @@ public class VectorL10n: NSObject {
public static var locationSharingInvalidAuthorizationSettings: String {
return VectorL10n.tr("Vector", "location_sharing_invalid_authorization_settings")
}
/// Live location error
public static var locationSharingLiveError: String {
return VectorL10n.tr("Vector", "location_sharing_live_error")
}
/// Loading Live location...
public static var locationSharingLiveLoading: String {
return VectorL10n.tr("Vector", "location_sharing_live_loading")
}
/// Share location
public static var locationSharingLiveMapCalloutTitle: String {
return VectorL10n.tr("Vector", "location_sharing_live_map_callout_title")
Expand All @@ -2767,6 +2779,14 @@ public class VectorL10n: NSObject {
public static var locationSharingLiveShareTitle: String {
return VectorL10n.tr("Vector", "location_sharing_live_share_title")
}
/// Live until %@
public static func locationSharingLiveTimerIncoming(_ p1: String) -> String {
return VectorL10n.tr("Vector", "location_sharing_live_timer_incoming", p1)
}
/// %@ left
public static func locationSharingLiveTimerOutgoing(_ p1: String) -> String {
return VectorL10n.tr("Vector", "location_sharing_live_timer_outgoing", p1)
}
/// %@ could not load the map. Please try again later.
public static func locationSharingLoadingMapErrorTitle(_ p1: String) -> String {
return VectorL10n.tr("Vector", "location_sharing_loading_map_error_title", p1)
Expand Down
10 changes: 10 additions & 0 deletions Riot/Managers/Theme/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ import DesignKit

var roomCellOutgoingBubbleBackgroundColor: UIColor { get }

// Localisation Cells

var roomCellLocalisationTextColor: UIColor { get }

var roomCellLocalisationStartedColor: UIColor { get }

var roomCellLocalisationEndedColor: UIColor { get }

var roomCellLocalisationErrorColor: UIColor { get }

// MARK: - Customisation methods


Expand Down
8 changes: 8 additions & 0 deletions Riot/Managers/Theme/Themes/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ class DarkTheme: NSObject, Theme {
}

var roomCellOutgoingBubbleBackgroundColor: UIColor = UIColor(rgb: 0x133A34)

var roomCellLocalisationTextColor: UIColor = UIColor(rgb: 0x17191C)

var roomCellLocalisationStartedColor: UIColor = UIColor(rgb: 0x5C56F5)

var roomCellLocalisationEndedColor: UIColor = UIColor(rgb: 0xC1C6CD)

var roomCellLocalisationErrorColor: UIColor = UIColor(rgb: 0xFF5B55)

func applyStyle(onTabBar tabBar: UITabBar) {
tabBar.unselectedItemTintColor = self.tabBarUnselectedItemTintColor
Expand Down
8 changes: 8 additions & 0 deletions Riot/Managers/Theme/Themes/DefaultTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ class DefaultTheme: NSObject, Theme {

var roomCellOutgoingBubbleBackgroundColor: UIColor = UIColor(rgb: 0xE7F8F3)

var roomCellLocalisationTextColor: UIColor = UIColor(rgb: 0x17191C)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This color seems redundant with primaryContent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is, "primaryContent" color is White on dark theme, so it didn't work on the white background of the cell.


var roomCellLocalisationStartedColor: UIColor = UIColor(rgb: 0x5C56F5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can maybe precise icon: roomCellLocalisationIconStartedColor or use a generic liveLocationSharingIconStartedColor


var roomCellLocalisationEndedColor: UIColor = UIColor(rgb: 0xC1C6CD)

var roomCellLocalisationErrorColor: UIColor = UIColor(rgb: 0xFF5B55)

func applyStyle(onTabBar tabBar: UITabBar) {
tabBar.unselectedItemTintColor = self.tabBarUnselectedItemTintColor
tabBar.tintColor = self.tintColor
Expand Down
2 changes: 2 additions & 0 deletions Riot/Modules/Room/CellData/RoomBubbleCellData.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ - (instancetype)initWithEvent:(MXEvent *)event andRoomState:(MXRoomState *)roomS
self.collapsable = NO;
self.collapsed = NO;
}

break;
}
default:
break;
Expand Down
Loading