From 56bffb265708692f9f59716e4520fcb6ae2136b0 Mon Sep 17 00:00:00 2001
From: Maxime Naturel <maxime.naturel@niji.fr>
Date: Fri, 18 Mar 2022 12:11:07 +0100
Subject: [PATCH] Adding stop button

---
 .../location/live/LocationLiveStatusView.kt        |  4 ++++
 .../main/res/layout/view_location_live_status.xml  | 14 +++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

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
index 9c724c9767..c2de2d9d13 100644
--- 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
@@ -19,6 +19,7 @@ package im.vector.app.features.location.live
 import android.content.Context
 import android.util.AttributeSet
 import android.view.LayoutInflater
+import android.widget.Button
 import androidx.constraintlayout.widget.ConstraintLayout
 import im.vector.app.databinding.ViewLocationLiveStatusBinding
 
@@ -30,4 +31,7 @@ class LocationLiveStatusView @JvmOverloads constructor(
             LayoutInflater.from(context),
             this
     )
+
+    val stopButton: Button
+        get() = binding.locationLiveStatusStop
 }
diff --git a/vector/src/main/res/layout/view_location_live_status.xml b/vector/src/main/res/layout/view_location_live_status.xml
index fec9f58eaa..c104f3dc3b 100644
--- a/vector/src/main/res/layout/view_location_live_status.xml
+++ b/vector/src/main/res/layout/view_location_live_status.xml
@@ -39,11 +39,15 @@
 
     <Button
         android:id="@+id/locationLiveStatusStop"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        style="Widget.Vector.Button.Text.OnPrimary"
+        android:layout_width="60dp"
+        android:layout_height="0dp"
+        android:background="?selectableItemBackground"
+        android:gravity="center"
+        android:padding="0dp"
         android:text="@string/location_share_live_stop"
-        android:visibility="gone"
+        android:textSize="12sp"
+        app:layout_constraintBottom_toBottomOf="@id/locationLiveStatusContainer"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintHorizontal_bias="0.5"
-        app:layout_constraintStart_toEndOf="@+id/locationLiveStatusTitle" />
+        app:layout_constraintTop_toTopOf="@id/locationLiveStatusContainer" />
 </merge>