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

prove tourpreview via dealpreviewmodel

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