Commit e560e3bb authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

deal card toolbar dynamic header

parent b9a650c5
...@@ -111,6 +111,7 @@ dependencies { ...@@ -111,6 +111,7 @@ dependencies {
//Rx Relay //Rx Relay
implementation "com.jakewharton.rxrelay2:rxrelay:$rxRelayVersion" implementation "com.jakewharton.rxrelay2:rxrelay:$rxRelayVersion"
implementation "com.jakewharton.rxrelay2:rxrelay:$rxRelayVersion"
//Assist Injected //Assist Injected
compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.5.0' compileOnly 'com.squareup.inject:assisted-inject-annotations-dagger2:0.5.0'
......
...@@ -102,17 +102,17 @@ class RoomParkMainActivity( ...@@ -102,17 +102,17 @@ class RoomParkMainActivity(
statusToolbar.status_title.setGone(it.state == null) statusToolbar.status_title.setGone(it.state == null)
it.state?.let { state -> it.state?.let { state ->
statusToolbar.status_icon.isEnabled = when(state){ statusToolbar.status_icon.isEnabled = when(state){
StatusState.AVALIABLE -> true StatusState.AVAILABLE -> true
else -> false else -> false
} }
statusToolbar.status_title.text = when(state){ statusToolbar.status_title.text = when(state){
StatusState.AVALIABLE -> resources.getString(R.string.estate_avalibale) StatusState.AVAILABLE -> resources.getString(R.string.estate_avalibale)
StatusState.SOLD_OUT -> resources.getString(R.string.estate_sold_out) StatusState.SOLD_OUT -> resources.getString(R.string.estate_sold_out)
} }
} }
statusToolbar.status_title.setGone(it.title == null) statusToolbar.mean_title.setGone(it.meanTitle == null)
it.title?.let {title -> statusToolbar.status_title.text = title} it.meanTitle?.let { title -> statusToolbar.mean_title.text = title}
} }
headerToolbar.requestLayout() headerToolbar.requestLayout()
statusToolbar.requestLayout() statusToolbar.requestLayout()
......
...@@ -45,6 +45,8 @@ data class HeaderToolbarModel( ...@@ -45,6 +45,8 @@ data class HeaderToolbarModel(
,val title:String? ,val title:String?
,val switcher:Boolean? = null) ,val switcher:Boolean? = null)
data class StatusToolbarModel(val state:StatusState?,val title:String?) data class StatusToolbarModel(val state:StatusState? = null
,val stateTitle:String? = null
,val meanTitle:String? = null)
enum class StatusState{AVALIABLE,SOLD_OUT} enum class StatusState{AVAILABLE,SOLD_OUT}
\ No newline at end of file \ No newline at end of file
...@@ -116,35 +116,35 @@ class DealInteractor @Inject constructor( ...@@ -116,35 +116,35 @@ class DealInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 16.9f, // area = 16.9f,
// living = true, // living = true,
// title = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f" // stateTitle = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.6f, // area = 14.6f,
// living = true, // living = true,
// title = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f" // stateTitle = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 10.8f, // area = 10.8f,
// living = false, // living = false,
// title = "\u041a\u0443\u0445\u043d\u044f" // stateTitle = "\u041a\u0443\u0445\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 3.6f, // area = 3.6f,
// living = false, // living = false,
// title = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440" // stateTitle = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440"
// ),ExplicationModel( // ),ExplicationModel(
// area = 3.4f, // area = 3.4f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 2.8f, // area = 2.8f,
// living = false, // living = false,
// title = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f" // stateTitle = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.9f, // area = 1.9f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.4f, // area = 1.4f,
// living = false, // living = false,
// title = "\u041b\u043e\u0434\u0436\u0438\u044f" // stateTitle = "\u041b\u043e\u0434\u0436\u0438\u044f"
// ) // )
// ), // ),
// planId = 0 // planId = 0
...@@ -154,35 +154,35 @@ class DealInteractor @Inject constructor( ...@@ -154,35 +154,35 @@ class DealInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 16.2f, // area = 16.2f,
// living = true, // living = true,
// title = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f" // stateTitle = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 13.7f, // area = 13.7f,
// living = true, // living = true,
// title = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f" // stateTitle = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 10.2f, // area = 10.2f,
// living = false, // living = false,
// title = "\u041a\u0443\u0445\u043d\u044f" // stateTitle = "\u041a\u0443\u0445\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.3f, // area = 4.3f,
// living = false, // living = false,
// title = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440" // stateTitle = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.2f, // area = 4.2f,
// living = false, // living = false,
// title = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f" // stateTitle = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.4f, // area = 1.4f,
// living = false, // living = false,
// title = "\u041b\u043e\u0434\u0436\u0438\u044f" // stateTitle = "\u041b\u043e\u0434\u0436\u0438\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.3f, // area = 1.3f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ) // )
// ), // ),
// planId = 1 // planId = 1
...@@ -241,27 +241,27 @@ class DealInteractor @Inject constructor( ...@@ -241,27 +241,27 @@ class DealInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 15.8f, // area = 15.8f,
// living = true, // living = true,
// title = "Гостиная" // stateTitle = "Гостиная"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.5f, // area = 14.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 20.2f, // area = 20.2f,
// living = false, // living = false,
// title = "Кухня" // stateTitle = "Кухня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 5.0f, // area = 5.0f,
// living = false, // living = false,
// title = "Прихожая" // stateTitle = "Прихожая"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "Санузел" // stateTitle = "Санузел"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.6f, // area = 1.6f,
// living = false, // living = false,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ), // ),
// planId = 0 // planId = 0
...@@ -271,27 +271,27 @@ class DealInteractor @Inject constructor( ...@@ -271,27 +271,27 @@ class DealInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 15.5f, // area = 15.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.5f, // area = 14.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 20.2f, // area = 20.2f,
// living = false, // living = false,
// title = "Кухня-гостиная" // stateTitle = "Кухня-гостиная"
// ),ExplicationModel( // ),ExplicationModel(
// area = 5.3f, // area = 5.3f,
// living = false, // living = false,
// title = "Прихожая" // stateTitle = "Прихожая"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "Санузел" // stateTitle = "Санузел"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.6f, // area = 1.6f,
// living = false, // living = false,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ), // ),
// planId = 1 // planId = 1
......
...@@ -107,35 +107,35 @@ class DealsInteractor @Inject constructor( ...@@ -107,35 +107,35 @@ class DealsInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 16.9f, // area = 16.9f,
// living = true, // living = true,
// title = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f" // stateTitle = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.6f, // area = 14.6f,
// living = true, // living = true,
// title = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f" // stateTitle = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 10.8f, // area = 10.8f,
// living = false, // living = false,
// title = "\u041a\u0443\u0445\u043d\u044f" // stateTitle = "\u041a\u0443\u0445\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 3.6f, // area = 3.6f,
// living = false, // living = false,
// title = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440" // stateTitle = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440"
// ),ExplicationModel( // ),ExplicationModel(
// area = 3.4f, // area = 3.4f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 2.8f, // area = 2.8f,
// living = false, // living = false,
// title = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f" // stateTitle = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.9f, // area = 1.9f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.4f, // area = 1.4f,
// living = false, // living = false,
// title = "\u041b\u043e\u0434\u0436\u0438\u044f" // stateTitle = "\u041b\u043e\u0434\u0436\u0438\u044f"
// ) // )
// ), // ),
// planId = 0 // planId = 0
...@@ -145,35 +145,35 @@ class DealsInteractor @Inject constructor( ...@@ -145,35 +145,35 @@ class DealsInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 16.2f, // area = 16.2f,
// living = true, // living = true,
// title = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f" // stateTitle = "\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 13.7f, // area = 13.7f,
// living = true, // living = true,
// title = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f" // stateTitle = "\u0421\u043f\u0430\u043b\u044c\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 10.2f, // area = 10.2f,
// living = false, // living = false,
// title = "\u041a\u0443\u0445\u043d\u044f" // stateTitle = "\u041a\u0443\u0445\u043d\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.3f, // area = 4.3f,
// living = false, // living = false,
// title = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440" // stateTitle = "\u041a\u043e\u0440\u0438\u0434\u043e\u0440"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.2f, // area = 4.2f,
// living = false, // living = false,
// title = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f" // stateTitle = "\u041f\u0440\u0438\u0445\u043e\u0436\u0430\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.4f, // area = 1.4f,
// living = false, // living = false,
// title = "\u041b\u043e\u0434\u0436\u0438\u044f" // stateTitle = "\u041b\u043e\u0434\u0436\u0438\u044f"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.3f, // area = 1.3f,
// living = false, // living = false,
// title = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b" // stateTitle = "\u0421\u0430\u043d\u0443\u0437\u0435\u043b"
// ) // )
// ), // ),
// planId = 1 // planId = 1
...@@ -232,27 +232,27 @@ class DealsInteractor @Inject constructor( ...@@ -232,27 +232,27 @@ class DealsInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 15.8f, // area = 15.8f,
// living = true, // living = true,
// title = "Гостиная" // stateTitle = "Гостиная"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.5f, // area = 14.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 20.2f, // area = 20.2f,
// living = false, // living = false,
// title = "Кухня" // stateTitle = "Кухня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 5.0f, // area = 5.0f,
// living = false, // living = false,
// title = "Прихожая" // stateTitle = "Прихожая"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "Санузел" // stateTitle = "Санузел"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.6f, // area = 1.6f,
// living = false, // living = false,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ), // ),
// planId = 0 // planId = 0
...@@ -262,27 +262,27 @@ class DealsInteractor @Inject constructor( ...@@ -262,27 +262,27 @@ class DealsInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// area = 15.5f, // area = 15.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 14.5f, // area = 14.5f,
// living = true, // living = true,
// title = "Спальня" // stateTitle = "Спальня"
// ),ExplicationModel( // ),ExplicationModel(
// area = 20.2f, // area = 20.2f,
// living = false, // living = false,
// title = "Кухня-гостиная" // stateTitle = "Кухня-гостиная"
// ),ExplicationModel( // ),ExplicationModel(
// area = 5.3f, // area = 5.3f,
// living = false, // living = false,
// title = "Прихожая" // stateTitle = "Прихожая"
// ),ExplicationModel( // ),ExplicationModel(
// area = 4.1f, // area = 4.1f,
// living = false, // living = false,
// title = "Санузел" // stateTitle = "Санузел"
// ),ExplicationModel( // ),ExplicationModel(
// area = 1.6f, // area = 1.6f,
// living = false, // living = false,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ), // ),
// planId = 1 // planId = 1
......
...@@ -124,32 +124,32 @@ class FavoritesInteractor @Inject constructor( ...@@ -124,32 +124,32 @@ class FavoritesInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// living = true, // living = true,
// area = 16.30f, // area = 16.30f,
// title = "Спальня" // stateTitle = "Спальня"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 11.40f, // area = 11.40f,
// title = "Кухня" // stateTitle = "Кухня"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 1.90f, // area = 1.90f,
// title = "Прихожая" // stateTitle = "Прихожая"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 5.20f, // area = 5.20f,
// title = "Коридор" // stateTitle = "Коридор"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 1.70f, // area = 1.70f,
// title = "Лоджия" // stateTitle = "Лоджия"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 3.50f, // area = 3.50f,
// title = "Санузел" // stateTitle = "Санузел"
// ) // )
// ) // )
// ), ExplicationListModel( // ), ExplicationListModel(
...@@ -158,32 +158,32 @@ class FavoritesInteractor @Inject constructor( ...@@ -158,32 +158,32 @@ class FavoritesInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// living = true, // living = true,
// area = 16.30f, // area = 16.30f,
// title = "Спальня" // stateTitle = "Спальня"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 11.40f, // area = 11.40f,
// title = "Кухня" // stateTitle = "Кухня"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 5.20f, // area = 5.20f,
// title = "Коридор" // stateTitle = "Коридор"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 1.90f, // area = 1.90f,
// title = "Прихожая" // stateTitle = "Прихожая"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 3.50f, // area = 3.50f,
// title = "Санузел" // stateTitle = "Санузел"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 1.70f, // area = 1.70f,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ) // )
// ), ExplicationListModel( // ), ExplicationListModel(
...@@ -192,27 +192,27 @@ class FavoritesInteractor @Inject constructor( ...@@ -192,27 +192,27 @@ class FavoritesInteractor @Inject constructor(
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 1.00f, // area = 1.00f,
// title = "Кухня-гостиная" // stateTitle = "Кухня-гостиная"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 2.00f, // area = 2.00f,
// title = "Коридор" // stateTitle = "Коридор"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 3.00f, // area = 3.00f,
// title = "Прихожая" // stateTitle = "Прихожая"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 4.00f, // area = 4.00f,
// title = "Санузел" // stateTitle = "Санузел"
// ), // ),
// ExplicationModel( // ExplicationModel(
// living = false, // living = false,
// area = 5.00f, // area = 5.00f,
// title = "Лоджия" // stateTitle = "Лоджия"
// ) // )
// ) // )
// ) // )
......
...@@ -86,7 +86,7 @@ class ArticleScreenController : ...@@ -86,7 +86,7 @@ class ArticleScreenController :
private fun setToolbar(){ private fun setToolbar(){
toolBar.hideAll() toolBar.hideAll()
toolBar.appBar.setExpanded(false,false) toolBar.appBar.setExpanded(false,false)
// toolBar.collapsingToolbarLayout.title = "ИЗБРАННОЕ" // toolBar.collapsingToolbarLayout.stateTitle = "ИЗБРАННОЕ"
// toolBar.appBar.liftOnScrollTargetViewId = R.id.Article_cards_recycler_view // toolBar.appBar.liftOnScrollTargetViewId = R.id.Article_cards_recycler_view
toolBar.appBar.setLiftable(false) toolBar.appBar.setLiftable(false)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
......
...@@ -5,16 +5,21 @@ import android.view.LayoutInflater ...@@ -5,16 +5,21 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.core.widget.NestedScrollView
import butterknife.BindView import butterknife.BindView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.HeaderToolbarModel import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.typeShortString
import com.biganto.visual.roompark.util.extensions.toRubly 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.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.jakewharton.rxbinding3.view.scrollChangeEvents
import io.reactivex.android.schedulers.AndroidSchedulers
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
...@@ -47,6 +52,10 @@ class DealScreenController : ...@@ -47,6 +52,10 @@ class DealScreenController :
lateinit var dealTitle: MaterialTextView lateinit var dealTitle: MaterialTextView
@BindView(R.id.deal_nestedScrollView)
lateinit var dealContainer: NestedScrollView
@BindView(R.id.statusContainer) @BindView(R.id.statusContainer)
lateinit var statusContainer: LinearLayout lateinit var statusContainer: LinearLayout
...@@ -81,6 +90,39 @@ class DealScreenController : ...@@ -81,6 +90,39 @@ class DealScreenController :
,null ,null
,null) ,null)
) )
detachDisposable.add(
dealContainer.scrollChangeEvents()
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe {
if (it.scrollY > dealTitle.measuredHeight)
dealModel?.let { deal ->
toolBar.setToolbar(
HeaderToolbarModel(
true
, resources?.getString(R.string.deal_back_chevron_title)
, resources?.getString(deal.estate.typeShortString()
,deal.estate.number)
, true
)
)
}
else
toolBar.setToolbar(
HeaderToolbarModel(
true
, resources?.getString(R.string.deal_back_chevron_title)
, null
, true
)
)
}
)
} }
private fun bindRecycler() { private fun bindRecycler() {
...@@ -114,6 +156,8 @@ class DealScreenController : ...@@ -114,6 +156,8 @@ class DealScreenController :
private val View.text private val View.text
get() = this.findViewById<MaterialTextView>(R.id.info_ceil_content) get() = this.findViewById<MaterialTextView>(R.id.info_ceil_content)
private var dealModel:DealModel? = null
private fun render(viewState: DealScreenViewState.LoadDeal) { private fun render(viewState: DealScreenViewState.LoadDeal) {
info1.title.text = resources?.getString(R.string.building) info1.title.text = resources?.getString(R.string.building)
...@@ -134,6 +178,8 @@ class DealScreenController : ...@@ -134,6 +178,8 @@ class DealScreenController :
dealPayed.text = viewState.estate.paymentSum.toRubly() dealPayed.text = viewState.estate.paymentSum.toRubly()
dealSumToPay.text = viewState.estate.amount_pay_sum.toRubly() dealSumToPay.text = viewState.estate.amount_pay_sum.toRubly()
dealModel = viewState.estate
toolBar.setToolbar(HeaderToolbarModel( toolBar.setToolbar(HeaderToolbarModel(
true true
,resources?.getString(R.string.deal_back_chevron_title) ,resources?.getString(R.string.deal_back_chevron_title)
......
...@@ -8,14 +8,17 @@ import android.webkit.WebView ...@@ -8,14 +8,17 @@ import android.webkit.WebView
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.core.view.isNotEmpty import androidx.core.view.isNotEmpty
import androidx.core.widget.NestedScrollView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView import butterknife.BindView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.base.StatusState
import com.biganto.visual.roompark.base.StatusToolbarModel
import com.biganto.visual.roompark.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.domain.model.FeatureModel import com.biganto.visual.roompark.domain.model.FeatureModel
import com.biganto.visual.roompark.domain.model.PlanPresetModel import com.biganto.visual.roompark.domain.model.PlanPresetModel
import com.biganto.visual.roompark.domain.model.typeShortString import com.biganto.visual.roompark.domain.model.typeShortString
...@@ -25,6 +28,7 @@ import com.google.android.material.tabs.TabLayout ...@@ -25,6 +28,7 @@ import com.google.android.material.tabs.TabLayout
import com.google.android.material.textview.MaterialTextView import com.google.android.material.textview.MaterialTextView
import com.jakewharton.rxbinding3.material.selections import com.jakewharton.rxbinding3.material.selections
import com.jakewharton.rxbinding3.view.clicks import com.jakewharton.rxbinding3.view.clicks
import com.jakewharton.rxbinding3.view.scrollChangeEvents
import com.jakewharton.rxbinding3.widget.checkedChanges import com.jakewharton.rxbinding3.widget.checkedChanges
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -111,9 +115,14 @@ class EstateScreenController : ...@@ -111,9 +115,14 @@ class EstateScreenController :
@BindView(R.id.flat_plan_webview) @BindView(R.id.flat_plan_webview)
lateinit var planWebView: WebView lateinit var planWebView: WebView
@BindView(R.id.flat_nested_scroll)
lateinit var flatScroll: NestedScrollView
@BindView(R.id.flat_content_recycler_view) @BindView(R.id.flat_content_recycler_view)
lateinit var flatInfoRecyclerView: RecyclerView lateinit var flatInfoRecyclerView: RecyclerView
@BindView(R.id.flat_title)
lateinit var flatTitle: MaterialTextView
@BindView(R.id.sizes_switch_container) @BindView(R.id.sizes_switch_container)
lateinit var sizesContainer: LinearLayout lateinit var sizesContainer: LinearLayout
...@@ -159,9 +168,46 @@ class EstateScreenController : ...@@ -159,9 +168,46 @@ class EstateScreenController :
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
toolBar.setToolbar( toolBar.setToolbar(
HeaderToolbarModel( null, StatusToolbarModel()
true,null )
,null,null)
detachDisposable.add(
flatScroll.scrollChangeEvents()
// .debounce (25,TimeUnit.MILLISECONDS)
.doOnNext {
Timber.d("Scrolling.. ${it.scrollY}")
Timber.d("Scrolling.. ${flatTitle.isShown}")
}
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe {
Timber.d("clicked slf;jzalk")
activity?.runOnUiThread {
if (it.scrollY > flatTitle.measuredHeight) {
val status = estateModel?.to(
StatusToolbarModel(
StatusState.AVAILABLE
, null
, resources?.getString(
estateModel?.typeShortString() ?: -1
, estateModel?.number
)
)
)
toolBar.setToolbar(
null, status = status?.second
)
} else toolBar.setToolbar(
null,
StatusToolbarModel(
StatusState.AVAILABLE, null, null
)
)
}
}
) )
...@@ -203,16 +249,15 @@ class EstateScreenController : ...@@ -203,16 +249,15 @@ class EstateScreenController :
private fun render(viewState: EstateScreenViewState.SomeError) = private fun render(viewState: EstateScreenViewState.SomeError) =
showError(viewState.exception) showError(viewState.exception)
private var estateModel : EstateModel? = null
private fun render(viewState: EstateScreenViewState.LoadEstate) { private fun render(viewState: EstateScreenViewState.LoadEstate) {
estateModel = viewState.estate
toolBar.setToolbar( toolBar.setToolbar(
HeaderToolbarModel( null, StatusToolbarModel(StatusState.AVAILABLE,null, null)
true,null
,resources?.getString(viewState.estate.typeShortString(),viewState.estate.number)
,null)
) )
flatTitle.text = resources?.getString(viewState.estate.typeShortString()
,viewState.estate.number)
} }
private fun render(viewState: EstateScreenViewState.ShowEstateInfo) { private fun render(viewState: EstateScreenViewState.ShowEstateInfo) {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/deal_nestedScrollView"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:orientation="vertical"> android:orientation="vertical">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:app="http://schemas.android.com/apk/res-auto" <androidx.core.widget.NestedScrollView xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/flat_nested_scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fillViewport="true" android:fillViewport="true"
...@@ -12,15 +13,30 @@ ...@@ -12,15 +13,30 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/flat_title"
style="@style/Header_TextView.Main_Header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:text="Кв..."
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/planTypesTabs" android:id="@+id/planTypesTabs"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32dp" android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toBottomOf="@+id/flat_title"
app:tabMaxWidth="@dimen/tab_max_width" app:tabMaxWidth="@dimen/tab_max_width"
app:tabMode="scrollable" /> app:tabMode="scrollable" />
......
...@@ -37,14 +37,17 @@ ...@@ -37,14 +37,17 @@
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/mean_title" android:id="@+id/mean_title"
android:fitsSystemWindows="true"
style="@style/Accent_Minor_TextView" style="@style/Accent_Minor_TextView"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:ellipsize="end"
android:fitsSystemWindows="true"
android:text="СВОБОДНА" android:text="СВОБОДНА"
app:layout_constraintBottom_toBottomOf="@+id/status_icon" app:layout_constraintBottom_toBottomOf="@+id/status_icon"
app:layout_constraintStart_toEndOf="@+id/status_icon" app:layout_constraintEnd_toStartOf="@+id/back_cross"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/status_title"
app:layout_constraintTop_toTopOf="@+id/status_icon" /> app:layout_constraintTop_toTopOf="@+id/status_icon" />
<ImageView <ImageView
......
...@@ -26,16 +26,16 @@ ...@@ -26,16 +26,16 @@
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
style="@style/Header_TextView.Main_Header" style="@style/Header_TextView.Main_Header"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:ellipsize="end"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:text="НОВОСТИ\nИРКУТСКА" android:text="НОВОСТИ\nИРКУТСКА"
android:textAlignment="gravity" android:textAlignment="gravity"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/include13"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/back_button_chevron" app:layout_constraintStart_toEndOf="@id/back_button_chevron"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="@+id/toolbar_title"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
......
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