-
Notifications
You must be signed in to change notification settings - Fork 676
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] - Message for live sharing in timeline (PSF-884) #5989
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some remarks, otherwise good work!
@@ -60,22 +60,27 @@ internal class DefaultLiveLocationAggregationProcessor @Inject constructor() : L | |||
aggregatedSummary.isActive = content.isLive | |||
} | |||
|
|||
override fun handleBeaconLocationData(realm: Realm, event: Event, content: MessageBeaconLocationDataContent, roomId: String, isLocalEcho: Boolean) { | |||
override fun handleBeaconLocationData( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we should have an interface for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, see 4a23109
zoneId.rules.getOffset(now) | ||
} | ||
// recompute the zoneId each time we access it to handle change of timezones | ||
private val defaultZoneId: ZoneId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be too costly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done this change to handle the case of a change of timezone when the app is running. If we don't recompute the ZoneId
, in some cases, we don't use the same as the one defined in the system and dates and times are not correct in the app. Do you have another solution in mind to fix this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably listen to android.intent.action.TIMEZONE_CHANGED intent if we really want this to be updated. But thats really not a common case, so I don't know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a dedicated issue to improve it: #6076
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the change waiting for the improvement? What do you think @bmarty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be handled later and this can stay like that for now I think.
// Calls | ||
EventType.CALL_INVITE, | ||
EventType.CALL_HANGUP, | ||
EventType.CALL_REJECT, | ||
EventType.CALL_ANSWER -> callItemFactory.create(params) | ||
EventType.CALL_ANSWER -> callItemFactory.create(params) | ||
in EventType.BEACON_LOCATION_DATA -> noticeItemFactory.create(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be grouped with other NoticeItem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed see 2aeee79
@@ -119,7 +119,8 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses | |||
isFirstFromThisSender = isFirstFromThisSender, | |||
isLastFromThisSender = isLastFromThisSender, | |||
e2eDecoration = e2eDecoration, | |||
sendStateDecoration = sendStateDecoration | |||
sendStateDecoration = sendStateDecoration, | |||
liveLocationShareSummaryData = getLiveLocationShareSummaryData(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it should be part of this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to follow the same practice as for other extra information of events. Do you think I should extract it into its own LiveLocationShareSummaryData
and associated LiveLocationShareSummaryDataFactory
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just add this as attribute of needed items. MessageInformationData should be used for data used by all items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the data class from MessageInformationData
and encapsulated it into the live location item factory since this is the only area where it is used. See cbf8306
import android.widget.ImageView | ||
import im.vector.app.features.home.room.detail.timeline.style.TimelineMessageLayout | ||
|
||
interface LiveLocationShareStatusItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see other implementations happening, so would remove the interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this interface was to be able to use delegation pattern to mutualize code in MessageLiveLocationInactiveItem
and MessageLiveLocationStartItem
. If I remove it, I will not be able to use it. Do you have another solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I hadn't seen the delegation, sorry
import im.vector.app.features.themes.ThemeUtils | ||
import org.threeten.bp.Duration | ||
|
||
sealed class LocationLiveMessageBannerViewState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract in a separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks for the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just small remarks about the strings.
@@ -322,6 +322,14 @@ | |||
<string name="start_chatting">Start Chatting</string> | |||
<string name="spaces">Spaces</string> | |||
|
|||
<!-- Time units --> | |||
<plurals name="time_unit_hour_short"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment for translator that if a short version exists in their language, it has to be used. For English there is no short version, so it can confuse the translators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done see e9d9319
<item quantity="other">hours</item> | ||
</plurals> | ||
<string name="time_unit_minute_short">min</string> | ||
<string name="time_unit_second_short">sec</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird to have a plural for hours, but not for minutes and seconds. It can be better to have only plurals to give more flexibility to the translators.
All plural items for English can be identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I decided to remove the plural and use "h" instead of "hour" to be consistent with other platforms. See e9d9319
@@ -3014,7 +3022,11 @@ | |||
<string name="location_timeline_failed_to_load_map">Failed to load map</string> | |||
<string name="location_share_live_enabled">Live location enabled</string> | |||
<string name="location_share_live_started">Loading live location…</string> | |||
<string name="location_share_live_ended">Live location ended</string> | |||
<string name="location_share_live_view">View live location</string> | |||
<string name="location_share_live_until">Live until %1$s</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment to explain what will replace the template, with an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e9d9319.
<string name="location_share_live_stop">Stop</string> | ||
<string name="location_share_live_remaining_time">%1$s left</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment to explain what will replace the template, with an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in e9d9319.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
Matrix SDKIntegration Tests Results:
|
Type of change
Content
Handling of the UI for the message associated to a live location share in the timeline. The message stays at the same position (at the timestamp of the start of the live). The message has 3 states:
The UI will also change depending if the user is the creator of the live or not.
Known issues that will be fixed later:
Motivation and context
Closes #5689
Screenshots / GIFs
Note: in the running state on emitter side, the live locatiion sharing top bar is not visible is some of the captures due to missing handling when restarting the app (like when toggling dark mode)
Tests
Tested devices
Checklist