From 32f18d5af31bd67c2547fb070a77b502f20a097c Mon Sep 17 00:00:00 2001 From: Maxime Naturel Date: Thu, 17 Mar 2022 17:14:53 +0100 Subject: [PATCH 1/7] Adding changelog entry --- changelog.d/5571.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5571.feature diff --git a/changelog.d/5571.feature b/changelog.d/5571.feature new file mode 100644 index 0000000000..04b62b8940 --- /dev/null +++ b/changelog.d/5571.feature @@ -0,0 +1 @@ +Live location sharing: Adding indicator view when enabled From 70ab5354c37fe11bbf5e22c2d788502a8b6a2490 Mon Sep 17 00:00:00 2001 From: Maxime Naturel Date: Thu, 17 Mar 2022 17:15:04 +0100 Subject: [PATCH 2/7] Adding strings of the view --- vector/src/main/res/values/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 428be3209f..aae3d2bc36 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2946,6 +2946,9 @@ Once enabled you will be able to send your location to any room Render user locations in the timeline Failed to load map + Live location enabled + + Stop Show Message bubbles From 67297bbdef5caecdde38fe86e7199847b550396a Mon Sep 17 00:00:00 2001 From: Maxime Naturel Date: Fri, 18 Mar 2022 10:21:37 +0100 Subject: [PATCH 3/7] Custom View in timeline screen without stop button --- .../location/live/LocationLiveStatusView.kt | 33 +++++++++++++ .../src/main/res/layout/fragment_timeline.xml | 38 +++++++++----- .../res/layout/view_location_live_status.xml | 49 +++++++++++++++++++ 3 files changed, 107 insertions(+), 13 deletions(-) create mode 100644 vector/src/main/java/im/vector/app/features/location/live/LocationLiveStatusView.kt create mode 100644 vector/src/main/res/layout/view_location_live_status.xml diff --git a/vector/src/main/java/im/vector/app/features/location/live/LocationLiveStatusView.kt b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveStatusView.kt new file mode 100644 index 0000000000..9c724c9767 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveStatusView.kt @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.location.live + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import im.vector.app.databinding.ViewLocationLiveStatusBinding + +class LocationLiveStatusView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + private val binding = ViewLocationLiveStatusBinding.inflate( + LayoutInflater.from(context), + this + ) +} diff --git a/vector/src/main/res/layout/fragment_timeline.xml b/vector/src/main/res/layout/fragment_timeline.xml index 6ba326bcc4..14eac04db2 100644 --- a/vector/src/main/res/layout/fragment_timeline.xml +++ b/vector/src/main/res/layout/fragment_timeline.xml @@ -17,7 +17,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="48dp" - android:visibility="gone"/> + android:visibility="gone" /> + + + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@id/locationLiveStatusIndicator" /> + app:layout_constraintTop_toBottomOf="@id/removeJitsiWidgetView" /> + app:layout_constraintBottom_toTopOf="@id/composerLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/timelineRecyclerView" + tools:visibility="visible" /> + tools:visibility="visible" /> + app:layout_constraintStart_toStartOf="parent" /> + + + + + + + + +