From 460f39176ccc13ac509f72f6df850fc676d85ba6 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 25 Jan 2022 14:36:32 +0100 Subject: [PATCH] Fix compilation issues after merge of develop --- .../detail/timeline/helper/LocationPinProvider.kt | 11 ++++++----- .../features/location/LocationSharingActivity.kt | 14 ++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/LocationPinProvider.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/LocationPinProvider.kt index 2820f07b34..fe3a7d9007 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/LocationPinProvider.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/LocationPinProvider.kt @@ -25,8 +25,8 @@ import com.bumptech.glide.request.transition.Transition import im.vector.app.R import im.vector.app.core.di.ActiveSessionHolder import im.vector.app.core.glide.GlideApp +import im.vector.app.core.utils.DimensionConverter import im.vector.app.features.home.AvatarRenderer -import org.billcarsonfr.jsonviewer.Utils import org.matrix.android.sdk.api.util.toMatrixItem import javax.inject.Inject import javax.inject.Singleton @@ -35,6 +35,7 @@ import javax.inject.Singleton class LocationPinProvider @Inject constructor( private val context: Context, private val activeSessionHolder: ActiveSessionHolder, + private val dimensionConverter: DimensionConverter, private val avatarRenderer: AvatarRenderer ) { private val cache = mutableMapOf() @@ -50,14 +51,14 @@ class LocationPinProvider @Inject constructor( } activeSessionHolder.getActiveSession().getUser(userId)?.toMatrixItem()?.let { - val size = Utils.dpToPx(44, context) + val size = dimensionConverter.dpToPx(44) avatarRenderer.render(glideRequests, it, object : CustomTarget(size, size) { override fun onResourceReady(resource: Drawable, transition: Transition?) { val bgUserPin = ContextCompat.getDrawable(context, R.drawable.bg_map_user_pin)!! val layerDrawable = LayerDrawable(arrayOf(bgUserPin, resource)) - val horizontalInset = Utils.dpToPx(4, context) - val topInset = Utils.dpToPx(4, context) - val bottomInset = Utils.dpToPx(8, context) + val horizontalInset = dimensionConverter.dpToPx(4) + val topInset = dimensionConverter.dpToPx(4) + val bottomInset = dimensionConverter.dpToPx(8) layerDrawable.setLayerInset(1, horizontalInset, topInset, horizontalInset, bottomInset) cache[userId] = layerDrawable diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingActivity.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingActivity.kt index 6a200435dc..67b36b8442 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingActivity.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingActivity.kt @@ -19,10 +19,8 @@ package im.vector.app.features.location import android.content.Context import android.content.Intent import android.os.Parcelable -import com.google.android.material.appbar.MaterialToolbar import dagger.hilt.android.AndroidEntryPoint import im.vector.app.core.extensions.addFragment -import im.vector.app.core.platform.ToolbarConfigurable import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityLocationSharingBinding import kotlinx.parcelize.Parcelize @@ -36,23 +34,19 @@ data class LocationSharingArgs( ) : Parcelable @AndroidEntryPoint -class LocationSharingActivity : VectorBaseActivity(), - ToolbarConfigurable { +class LocationSharingActivity : VectorBaseActivity() { override fun getBinding() = ActivityLocationSharingBinding.inflate(layoutInflater) - override fun configure(toolbar: MaterialToolbar) { - configureToolbar(toolbar) - } - override fun initUiAndData() { val locationSharingArgs: LocationSharingArgs? = intent?.extras?.getParcelable(EXTRA_LOCATION_SHARING_ARGS) if (locationSharingArgs == null) { finish() return } - configure(views.toolbar) - supportActionBar?.title = getString(locationSharingArgs.mode.titleRes) + setupToolbar(views.toolbar) + .setTitle(locationSharingArgs.mode.titleRes) + .allowBack() if (isFirstCreation()) { when (locationSharingArgs.mode) {