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

resolve issues

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