From 732582b6fe61574189ba2cb657437c196f9e3409 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 25 Jul 2022 09:49:18 +0200 Subject: [PATCH] Banner view for ended live --- .../item/MessageLiveLocationInactiveItem.kt | 2 +- .../live/LocationLiveEndedBannerView.kt | 37 +++++++++ ...line_event_live_location_inactive_stub.xml | 40 +--------- .../view_location_live_ended_banner.xml | 49 ++++++++++++ .../view_location_live_message_banner.xml | 75 ------------------- 5 files changed, 90 insertions(+), 113 deletions(-) create mode 100644 vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt create mode 100644 vector/src/main/res/layout/view_location_live_ended_banner.xml delete mode 100644 vector/src/main/res/layout/view_location_live_message_banner.xml diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt index bc6e96b0ee..fae8091f06 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageLiveLocationInactiveItem.kt @@ -42,7 +42,7 @@ abstract class MessageLiveLocationInactiveItem : override fun getViewStubId() = STUB_ID class Holder : AbsMessageItem.Holder(STUB_ID) { - val bannerImageView by bind(R.id.locationLiveInactiveBanner) + val bannerImageView by bind(R.id.locationLiveEndedBannerBackground) val noLocationMapImageView by bind(R.id.locationLiveInactiveMap) } diff --git a/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt new file mode 100644 index 0000000000..95b444aee5 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/location/live/LocationLiveEndedBannerView.kt @@ -0,0 +1,37 @@ +/* + * 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.ViewLocationLiveEndedBannerBinding + +class LocationLiveEndedBannerView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + init { + ViewLocationLiveEndedBannerBinding.inflate( + LayoutInflater.from(context), + this + ) + } +} diff --git a/vector/src/main/res/layout/item_timeline_event_live_location_inactive_stub.xml b/vector/src/main/res/layout/item_timeline_event_live_location_inactive_stub.xml index ba0ff33230..df8559f34b 100644 --- a/vector/src/main/res/layout/item_timeline_event_live_location_inactive_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_live_location_inactive_stub.xml @@ -15,16 +15,13 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + app:layout_constraintStart_toStartOf="@id/locationLiveInactiveMap" /> - - - - + + + + + + + + diff --git a/vector/src/main/res/layout/view_location_live_message_banner.xml b/vector/src/main/res/layout/view_location_live_message_banner.xml deleted file mode 100644 index f13696a5c7..0000000000 --- a/vector/src/main/res/layout/view_location_live_message_banner.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - -