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

provide estate and financinal info to deal screen

parent e70c00dd
......@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.util.extensions.toRubly
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
......@@ -52,6 +53,16 @@ class DealScreenController :
@BindView(R.id.progress_holder)
lateinit var progressLayout: LinearLayout
@BindView(R.id.info_ceil_1) lateinit var info1:View
@BindView(R.id.info_ceil_2) lateinit var info2:View
@BindView(R.id.info_ceil_3) lateinit var info3:View
@BindView(R.id.info_ceil_4) lateinit var info4:View
@BindView(R.id.deal_sum_value_text_view) lateinit var dealSum: MaterialTextView
@BindView(R.id.deal_payed_value_text_view) lateinit var dealPayed: MaterialTextView
@BindView(R.id.deal_to_pay_value_text_view) lateinit var dealSumToPay: MaterialTextView
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
......@@ -89,8 +100,31 @@ class DealScreenController :
showError(viewState.exception)
private val View.title
get() = this.findViewById<MaterialTextView>(R.id.info_ceil_header)
private val View.text
get() = this.findViewById<MaterialTextView>(R.id.info_ceil_content)
private fun render(viewState: DealScreenViewState.LoadDeal) {
info1.title.text = resources?.getString(R.string.building)
info1.text.text = viewState.estate.estate.commonInfo?.building.toString()
info2.title.text = resources?.getString(R.string.section_begin)
info2.text.text = viewState.estate.estate.commonInfo?.section_begin.toString()
info3.title.text = resources?.getString(R.string.floor)
info3.text.text = viewState.estate.estate.commonInfo?.floor.toString()
info4.title.text = resources?.getString(R.string.area)
info4.text.text =
resources?.getString(R.string.area_value,viewState.estate.estate.commonInfo?.area)
dealSum.text = viewState.estate.opportunitySum.toRubly()
dealPayed.text = viewState.estate.paymentSum.toRubly()
dealSumToPay.text = viewState.estate.amount_pay_sum.toRubly()
viewState.statusList.forEach {
val statusLayout = LayoutInflater.from(activity)
......@@ -117,7 +151,7 @@ class DealScreenController :
val statusTitle = statusLayout.findViewById<MaterialTextView>(R.id.title)
Timber.d("layouted statusTitle : $statusTitle")
statusTitle.text = it.title
statusTitle.text = it.shortTitle
progressLayout.addView(statusLayout)
}
progressLayout.invalidate()
......
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