Commit 52167543 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix description and view sizes

parent d688ee87
......@@ -84,8 +84,7 @@ class PhotoScreenController :
fun getComponent() = DaggerPhotoScreenComponent.factory()
.create(RoomParkApplication.component
,activity as RoomParkMainActivity
,args.getInt(SELECTED_PHOTO_KEY))
.inject(this)
,args.getInt(SELECTED_PHOTO_KEY)).inject(this)
override fun render(viewState: PhotoScreenViewState) {
Timber.d("render: $viewState")
......
......@@ -9,6 +9,7 @@ import com.biganto.visual.roompark.domain.model.PhotoResolutionModel
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import com.github.chrisbanes.photoview.PhotoView
import com.google.android.material.textview.MaterialTextView
import timber.log.Timber
/**
......@@ -37,11 +38,17 @@ class PhotosViewHolder(itemView: View) : CommonViewHolder<PhotoModel>(itemView)
@BindView(R.id.photo_view) lateinit var photoPreview: PhotoView
@BindView(R.id.photo_description) lateinit var description: MaterialTextView
private val picassoAsync by lazy {
return@lazy RoomParkApplication.component.providePicassoAsync()
}
override fun onViewBound(model: PhotoModel) {
description.visibility = if (model.description != null) View.VISIBLE else View.GONE
model.description?.let{ description.text = it}
model.resolutionList.lowelest()?.let {
picassoAsync
.load(it.url)
......
......@@ -53,8 +53,10 @@
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/iic_full_view" />
<ImageView
......@@ -63,21 +65,26 @@
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/iic_full_view" />
<com.biganto.visual.roompark.presentation.screen.photo.util.PhotoPreviewSlider
android:id="@+id/photosPreviewSlider"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_height="32dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="horizontal"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/change_size_button"
app:layout_constraintStart_toEndOf="@+id/show_full_button"
app:layout_constraintTop_toTopOf="@+id/guideline2" />
app:layout_constraintTop_toTopOf="@+id/guideline2"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment