Merge pull request #6608 from vector-im/feature/mna/ux-review-fixes-22-07-11

[Location sharing] - Small improvements of UI for live (PSG-613)
This commit is contained in:
Maxime NATUREL 2022-07-25 16:42:48 +02:00 committed by GitHub
commit d4186af761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 30 additions and 12 deletions

1
changelog.d/6607.misc Normal file
View file

@ -0,0 +1 @@
[Location sharing] - Small improvements of UI for live

View file

@ -713,7 +713,7 @@ internal class LocalEchoEventFactory @Inject constructor(
MessageType.MSGTYPE_AUDIO -> return TextContent("sent an audio file.")
MessageType.MSGTYPE_IMAGE -> return TextContent("sent an image.")
MessageType.MSGTYPE_VIDEO -> return TextContent("sent a video.")
MessageType.MSGTYPE_BEACON_INFO -> return TextContent(content.body.ensureNotEmpty() ?: "shared live location.")
MessageType.MSGTYPE_BEACON_INFO -> return TextContent(content.body.ensureNotEmpty() ?: "Live location")
MessageType.MSGTYPE_POLL_START -> {
return TextContent((content as? MessagePollContent)?.getBestPollCreationInfo()?.question?.getBestQuestion() ?: "")
}

View file

@ -1257,7 +1257,7 @@ class TimelineFragment @Inject constructor(
val nonFormattedBody = when (messageContent) {
is MessageAudioContent -> getAudioContentBodyText(messageContent)
is MessagePollContent -> messageContent.getBestPollCreationInfo()?.question?.getBestQuestion()
is MessageBeaconInfoContent -> getString(R.string.sent_live_location)
is MessageBeaconInfoContent -> getString(R.string.live_location_description)
else -> messageContent?.body.orEmpty()
}
var formattedBody: CharSequence? = null

View file

@ -102,7 +102,6 @@ class LiveLocationShareMessageItemFactory @Inject constructor(
attributes: AbsMessageItem.Attributes,
runningState: LiveLocationShareViewState.Running,
): MessageLiveLocationItem {
// TODO only render location if enabled in preferences: to be handled in a next PR
val width = timelineMediaSizeProvider.getMaxSize().first
val height = dimensionConverter.dpToPx(MessageItemFactory.MESSAGE_LOCATION_ITEM_HEIGHT_IN_DP)

View file

@ -19,7 +19,10 @@ package im.vector.app.features.home.room.detail.timeline.item
import android.content.res.Resources
import android.graphics.drawable.ColorDrawable
import android.widget.ImageView
import androidx.core.content.ContextCompat
import androidx.core.view.updateLayoutParams
import com.bumptech.glide.load.MultiTransformation
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.GranularRoundedCorners
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import im.vector.app.R
@ -50,8 +53,8 @@ class DefaultLiveLocationShareStatusItem : LiveLocationShareStatusItem {
height = mapHeight
}
GlideApp.with(mapImageView)
.load(R.drawable.bg_no_location_map)
.transform(mapCornerTransformation)
.load(ContextCompat.getDrawable(mapImageView.context, R.drawable.bg_no_location_map))
.transform(MultiTransformation(CenterCrop(), mapCornerTransformation))
.into(mapImageView)
}

View file

@ -122,7 +122,7 @@ class LocationSharingAndroidService : VectorAndroidService(), LocationTracker.Ca
?.locationSharingService()
?.startLiveLocationShare(
timeoutMillis = roomArgs.durationMillis,
description = getString(R.string.sent_live_location)
description = getString(R.string.live_location_description)
)
updateLiveResult

View file

@ -56,13 +56,16 @@
<TextView
android:id="@+id/locationLiveInactiveTitle"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_margin="8dp"
android:lines="1"
android:text="@string/location_share_live_ended"
android:ellipsize="end"
android:textColor="?vctr_content_tertiary"
app:layout_constraintBottom_toBottomOf="@id/locationLiveInactiveBanner"
app:layout_constraintStart_toEndOf="@id/locationLiveInactiveBannerIcon"
app:layout_constraintEnd_toEndOf="@id/locationLiveInactiveBanner"
app:layout_constraintTop_toTopOf="@id/locationLiveInactiveBanner" />
<androidx.constraintlayout.widget.Guideline

View file

@ -45,12 +45,14 @@
<TextView
android:id="@+id/locationLiveStartTitle"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_margin="8dp"
android:lines="1"
android:text="@string/location_share_live_started"
android:textColor="?vctr_content_tertiary"
app:layout_constraintBottom_toBottomOf="@id/locationLiveStartBanner"
app:layout_constraintEnd_toEndOf="@id/locationLiveStartBanner"
app:layout_constraintStart_toEndOf="@id/locationLiveStartIcon"
app:layout_constraintTop_toTopOf="@id/locationLiveStartBanner" />

View file

@ -34,11 +34,15 @@
<TextView
android:id="@+id/locationLiveMessageBannerTitle"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:ellipsize="end"
android:lines="1"
android:textColor="?colorOnSurface"
app:layout_constraintBottom_toTopOf="@id/locationLiveMessageBannerSubTitle"
app:layout_constraintEnd_toStartOf="@id/locationLiveMessageBannerStop"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@id/locationLiveMessageBannerIcon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
@ -47,10 +51,14 @@
<TextView
android:id="@+id/locationLiveMessageBannerSubTitle"
style="@style/Widget.Vector.TextView.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:textColor="?vctr_content_secondary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/locationLiveMessageBannerTitle"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="@id/locationLiveMessageBannerTitle"
app:layout_constraintTop_toBottomOf="@id/locationLiveMessageBannerTitle"
tools:text="9min left" />

View file

@ -3126,6 +3126,8 @@
<string name="live_location_not_enough_permission_dialog_title">You dont have permission to share live location</string>
<string name="live_location_not_enough_permission_dialog_description">You need to have the right permissions in order to share live location in this room.</string>
<string name="live_location_share_location_item_share">Share location</string>
<!-- mostly used as a description when replying to a live location message -->
<string name="live_location_description">Live location</string>
<string name="message_bubbles">Show Message bubbles</string>