Commit 2680ca1a authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

resolve issues

parent 4c946d7f
......@@ -11,7 +11,7 @@ import javax.inject.Inject
class DealInteractor @Inject constructor(
){
fun getDeal(id:Int) = Single.just(dealFlat)
fun getDeal(id:String) = Single.just(dealFlat)
fun getStatusList() = Single.just(statusList.sortedBy{ it.orderId })
companion object{
......
......@@ -21,7 +21,7 @@ import javax.inject.Inject
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
const val SELECTED_ESTATE_ID_KEY = "SELECTED_ESTATE_INDEX"
const val SELECTED_DEAL_ID_KEY = "SELECTED_DEAL_GUID"
class DealScreenController :
......@@ -32,7 +32,7 @@ class DealScreenController :
constructor(args: Bundle):super(args)
constructor(id: Int) : super(bundleOf(SELECTED_ESTATE_ID_KEY to id))
constructor(id: String) : super(bundleOf(SELECTED_DEAL_ID_KEY to id))
override fun injectDependencies() {
getComponent()
......@@ -94,12 +94,15 @@ class DealScreenController :
viewState.statusList.forEach {
val statusLayout = LayoutInflater.from(activity)
.inflate(R.layout.progress_deal_state_pattern_view_horizontal
.inflate(R.layout.progress_status_title_vertical
,progressLayout
,false)
as LinearLayout
Timber.d("layouted: $statusLayout")
val statusCeil = statusLayout.findViewById<StatusProgressCeil>(R.id.status)
Timber.d("layouted ceail : $statusCeil")
val position = it.orderId
val statusCount = viewState.statusList.size
val lastStatusPassed = viewState.estate.statusId
......@@ -113,6 +116,7 @@ class DealScreenController :
statusCeil.invalidate()
val statusTitle = statusLayout.findViewById<MaterialTextView>(R.id.title)
Timber.d("layouted statusTitle : $statusTitle")
statusTitle.text = it.title
progressLayout.addView(statusLayout)
}
......@@ -123,7 +127,7 @@ class DealScreenController :
private fun getComponent() = DaggerDealScreenComponent.factory()
.create(RoomParkApplication.component,activity as RoomParkMainActivity
,args.getInt(SELECTED_ESTATE_ID_KEY))
,args.getString(SELECTED_DEAL_ID_KEY)?: error("Deal Id is empty!"))
.inject(this)
override fun getLayoutId(): Int = R.layout.deal_screen
......
......@@ -22,7 +22,7 @@ interface DealScreenComponent {
fun create(
appComponent: AppComponent
,@BindsInstance activity: RoomParkMainActivity
,@BindsInstance @Named(SELECTED_ESTATE_ID_KEY) selectedDealId:Int
,@BindsInstance @Named(SELECTED_DEAL_ID_KEY) selectedDealId:String
): DealScreenComponent
}
......
......@@ -22,7 +22,7 @@ import javax.inject.Named
class DealScreenPresenter @Inject constructor(
private val interactor: DealInteractor,
private val context: Context,
@Named(SELECTED_ESTATE_ID_KEY) private val estateId:Int
@Named(SELECTED_DEAL_ID_KEY) private val dealId:String
)
: BigantoBasePresenter<DealScreen, DealScreenViewState>() {
......@@ -38,7 +38,7 @@ class DealScreenPresenter @Inject constructor(
override fun bindIntents() {
val fetchDeal = interactor.getDeal(estateId)
val fetchDeal = interactor.getDeal(dealId)
.flatMap { deal ->
interactor.getStatusList().map { DealScreenViewState.LoadDeal(deal,it) }
}
......
......@@ -68,11 +68,10 @@ class DealsScreenController :
detachDisposable.addAll(
(dealsRecyclerView.adapter as DealsListAdapter)
.onItemClicked
.map { it.id.toInt() }
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
Timber.d("got card clicked $it")
router.pushController(RouterTransaction.with(DealScreenController(it))
router.pushController(RouterTransaction.with(DealScreenController(it.id))
.pushChangeHandler(FadeChangeHandler())
.popChangeHandler(FadeChangeHandler())
)
......
......@@ -94,7 +94,7 @@ class EstateScreenController :
constructor(args: Bundle):super(args)
constructor(id: Int) : super(bundleOf(com.biganto.visual.roompark.presentation.screen.deal.SELECTED_ESTATE_ID_KEY to id))
constructor(id: Int) : super(bundleOf(SELECTED_ESTATE_ID_KEY to id))
override fun injectDependencies() {
getComponent()
......@@ -278,7 +278,7 @@ class EstateScreenController :
private fun getComponent() = DaggerEstateScreenComponent.factory()
.create(RoomParkApplication.component,activity as RoomParkMainActivity
,args.getInt(com.biganto.visual.roompark.presentation.screen.deal.SELECTED_ESTATE_ID_KEY))
,args.getInt(SELECTED_ESTATE_ID_KEY))
.inject(this)
override fun getLayoutId(): Int = R.layout.flat_full_card_screen
......
......@@ -22,7 +22,7 @@ interface EstateScreenComponent {
fun create(
appComponent: AppComponent
,@BindsInstance activity: RoomParkMainActivity
,@BindsInstance @Named(com.biganto.visual.roompark.presentation.screen.deal.SELECTED_ESTATE_ID_KEY) selectedEstateId:Int
,@BindsInstance @Named(SELECTED_ESTATE_ID_KEY) selectedEstateId:Int
): EstateScreenComponent
}
......
......@@ -24,7 +24,7 @@ import javax.inject.Named
class EstateScreenPresenter @Inject constructor(
private val interactor: EstateInteractor,
private val context: Context,
@Named(com.biganto.visual.roompark.presentation.screen.deal.SELECTED_ESTATE_ID_KEY) private val estateId:Int
@Named(SELECTED_ESTATE_ID_KEY) private val estateId:Int
)
: BigantoBasePresenter<EstateScreen, EstateScreenViewState>() {
......
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
app:cardElevation="6dp"
app:cardMaxElevation="8dp">
android:background="@color/colorPrimary"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
......@@ -126,7 +123,7 @@
android:layout_weight="1"
android:gravity="bottom"
android:includeFontPadding="true"
android:text="Сумма договора"/>
android:text="Сумма договора" />
<com.google.android.material.textview.MaterialTextView
......@@ -259,32 +256,32 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="@color/colorCommonBackground"
android:weightSum="3">
<com.google.android.material.textview.MaterialTextView
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorCommonBackground"
android:weightSum="3"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp">
<com.google.android.material.textview.MaterialTextView
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|center_vertical"
android:layout_weight="2"
android:gravity="start"
android:text="Открыть карточку квартиры"
android:textAlignment="gravity"/>
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end|center_vertical"
android:layout_weight="1"
android:tint="@color/colorAccent"
android:baselineAlignBottom="false"
android:src="@drawable/ic_flat" />
</LinearLayout>
android:layout_gravity="center|center_vertical"
android:layout_weight="2"
android:gravity="start"
android:text="Открыть карточку квартиры"
android:textAlignment="gravity" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="end|center_vertical"
android:layout_weight="1"
android:baselineAlignBottom="false"
android:src="@drawable/ic_flat"
android:tint="@color/colorAccent" />
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
\ No newline at end of file
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
......@@ -19,6 +19,9 @@
style="@style/Common_Text.Inverted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
android:text="Договор готовится для подачи на гос. регистрацию b,kf,kf,fk">
......
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