Commit 1c4cc126 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

prove tourpreview via dealpreviewmodel

parent 2271b480
......@@ -17,6 +17,7 @@ data class DealPreviewModel(
val dealToPay : Int,
val dealTourIds : List<Int?>?,
val isViewed: Boolean = true,
val tourPreview: String?,
val statusList : List<StatusModel>
){
constructor(data:Pair<DealModel,List<StatusModel>>) : this(
......@@ -33,6 +34,7 @@ data class DealPreviewModel(
data.first.amount_pay_sum,
arrayListOf<Int?>(data.first.estate.multitourId),
false,
null,
data.second
)
}
......
......@@ -15,9 +15,11 @@ import com.biganto.visual.roompark.domain.model.typeDoubleString
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import com.biganto.visual.roompark.util.extensions.toRubly
import com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import com.google.android.material.textview.MaterialTextView
import com.squareup.picasso.Picasso
/**
* Created by Vladislav Bogdashkin on 16.10.2019.
......@@ -49,6 +51,8 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
@BindView(R.id.statusContainer) lateinit var statusLayout:LinearLayout
@BindView(R.id.start_tour_image_view) lateinit var tourScreen:RoundedImageView
private fun typeName(type:String) = when(type){
"flat" -> "КВАРТИРА"
......@@ -82,6 +86,12 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
currentStatusText.text = model.statusList[model.statusNo-1].title
statusLayout.addView(currentStatusText,0)
statusLayout.invalidate()
model.tourPreview?.let {
Picasso.get()
.load(it)
.into(tourScreen)
}
}
private fun renderCommonInfo(info: DealPreviewModel){
......
......@@ -15,7 +15,7 @@
android:orientation="vertical">
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
android:id="@+id/roundedImageView2"
android:id="@+id/start_tour_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@color/playTourCardOpacityBackground"
......@@ -32,9 +32,9 @@
android:scaleType="fitCenter"
android:tint="@color/colorCommonBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/roundedImageView2"
app:layout_constraintEnd_toEndOf="@+id/start_tour_image_view"
app:layout_constraintHorizontal_bias="0.22"
app:layout_constraintStart_toStartOf="@+id/roundedImageView2"
app:layout_constraintStart_toStartOf="@+id/start_tour_image_view"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_feeds" />
......
......@@ -3,17 +3,24 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="4dp">
android:layout_margin="16dp"
app:cardElevation="8dp"
app:cardMaxElevation="12dp"
android:padding="16dp"
app:cardCornerRadius="4dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="160dp"
android:orientation="vertical">
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
android:id="@+id/roundedImageView2"
android:id="@+id/start_tour_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@color/playTourCardOpacityLight"
android:foregroundTintMode="src_in"
android:scaleType="centerCrop"
android:src="@drawable/default_image_placeholder"
app:layout_constraintBottom_toBottomOf="parent"
......@@ -21,6 +28,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/roundedImageView"
android:layout_width="32dp"
......@@ -32,8 +40,8 @@
android:scaleType="fitCenter"
android:tint="@color/colorCommonBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/roundedImageView2"
app:layout_constraintStart_toStartOf="@+id/roundedImageView2"
app:layout_constraintEnd_toEndOf="@+id/start_tour_image_view"
app:layout_constraintStart_toStartOf="@+id/start_tour_image_view"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_feeds" />
......
......@@ -16,6 +16,7 @@
<color name="colorOpacityCardBackground">#5C000000</color>
<color name="colorDividerLightGray">#F2F2F2</color>
<color name="playTourCardOpacityBackground">#B2000000</color>
<color name="playTourCardOpacityLight">#20000000</color>
<color name="colorCheckListGradientStart">@color/colorAccent</color>
<color name="colorCheckListGradientEnd">@color/colorAccentSecondary</color>
//endregion
......
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