From ed3bd871ea9c3bb7de600444baa62bba06944ddb Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 29 Aug 2022 17:30:59 +0200 Subject: [PATCH] Renaming header list view to be consistent --- .../stylable_devices_list_header_view.xml | 2 +- ...eaderView.kt => SessionsListHeaderView.kt} | 20 +++++++++---------- .../res/layout/fragment_settings_devices.xml | 6 +++--- ...ader.xml => view_sessions_list_header.xml} | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) rename vector/src/main/java/im/vector/app/features/settings/devices/v2/list/{DevicesListHeaderView.kt => SessionsListHeaderView.kt} (74%) rename vector/src/main/res/layout/{view_devices_list_header.xml => view_sessions_list_header.xml} (83%) diff --git a/library/ui-styles/src/main/res/values/stylable_devices_list_header_view.xml b/library/ui-styles/src/main/res/values/stylable_devices_list_header_view.xml index f0807f89c6..97e0290815 100644 --- a/library/ui-styles/src/main/res/values/stylable_devices_list_header_view.xml +++ b/library/ui-styles/src/main/res/values/stylable_devices_list_header_view.xml @@ -1,7 +1,7 @@ - + diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/list/DevicesListHeaderView.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/list/SessionsListHeaderView.kt similarity index 74% rename from vector/src/main/java/im/vector/app/features/settings/devices/v2/list/DevicesListHeaderView.kt rename to vector/src/main/java/im/vector/app/features/settings/devices/v2/list/SessionsListHeaderView.kt index d6c7dbe273..547ed93f24 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/list/DevicesListHeaderView.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/list/SessionsListHeaderView.kt @@ -25,15 +25,15 @@ import androidx.core.content.res.use import androidx.core.view.isVisible import im.vector.app.R import im.vector.app.core.extensions.setTextWithColoredPart -import im.vector.app.databinding.ViewDevicesListHeaderBinding +import im.vector.app.databinding.ViewSessionsListHeaderBinding -class DevicesListHeaderView @JvmOverloads constructor( +class SessionsListHeaderView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr) { - private val binding = ViewDevicesListHeaderBinding.inflate( + private val binding = ViewSessionsListHeaderBinding.inflate( LayoutInflater.from(context), this ) @@ -43,7 +43,7 @@ class DevicesListHeaderView @JvmOverloads constructor( init { context.obtainStyledAttributes( attrs, - R.styleable.DevicesListHeaderView, + R.styleable.SessionsListHeaderView, 0, 0 ).use { @@ -53,14 +53,14 @@ class DevicesListHeaderView @JvmOverloads constructor( } private fun setTitle(typedArray: TypedArray) { - val title = typedArray.getString(R.styleable.DevicesListHeaderView_devicesListHeaderTitle) - binding.devicesListHeaderTitle.text = title + val title = typedArray.getString(R.styleable.SessionsListHeaderView_devicesListHeaderTitle) + binding.sessionsListHeaderTitle.text = title } private fun setDescription(typedArray: TypedArray) { - val description = typedArray.getString(R.styleable.DevicesListHeaderView_devicesListHeaderDescription) + val description = typedArray.getString(R.styleable.SessionsListHeaderView_devicesListHeaderDescription) if (description.isNullOrEmpty()) { - binding.devicesListHeaderDescription.isVisible = false + binding.sessionsListHeaderDescription.isVisible = false return } @@ -70,8 +70,8 @@ class DevicesListHeaderView @JvmOverloads constructor( stringBuilder.append(" ") stringBuilder.append(learnMore) - binding.devicesListHeaderDescription.isVisible = true - binding.devicesListHeaderDescription.setTextWithColoredPart( + binding.sessionsListHeaderDescription.isVisible = true + binding.sessionsListHeaderDescription.setTextWithColoredPart( fullText = stringBuilder.toString(), coloredPart = learnMore, underline = false diff --git a/vector/src/main/res/layout/fragment_settings_devices.xml b/vector/src/main/res/layout/fragment_settings_devices.xml index 6710f345ce..a289bda735 100644 --- a/vector/src/main/res/layout/fragment_settings_devices.xml +++ b/vector/src/main/res/layout/fragment_settings_devices.xml @@ -56,7 +56,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/deviceListInactiveSessionsRecommendation" /> - - -