Commit 59ed84a4 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

impl toolbar into screens

parent ea5ca6cf
...@@ -91,13 +91,18 @@ class RoomParkMainActivity( ...@@ -91,13 +91,18 @@ class RoomParkMainActivity(
headerToolbar.setGone(header==null) headerToolbar.setGone(header==null)
statusToolbar.setGone(status==null) statusToolbar.setGone(status==null)
header?.let { header?.let {
headerToolbarBack.setGone(it.backButton) Timber.d("bb: ${it.backButton}")
Timber.d("bt: ${it.backTitle}")
Timber.d("itTitle: ${it.title}")
Timber.d("switcher: ${it.switcher} - ${it.switcher?:false}")
headerToolbarBack.setGone(!it.backButton)
headerToolbarBack.text = it.backTitle?:"" headerToolbarBack.text = it.backTitle?:""
headerToolbar.findViewById<MaterialTextView>(R.id.toolbar_title).text = it.title?:"" headerToolbar.findViewById<MaterialTextView>(R.id.toolbar_title).text = it.title?:""
headerToolbar.findViewById<ViewGroup>(R.id.bell_container).setGone(it.switcher?:false) headerToolbar.findViewById<ViewGroup>(R.id.include13).setGone(!(it.switcher?:false))
} }
status?.let { status?.let {
Timber.d(" inda status")
statusToolbar.status_icon.setGone(it.state == null) statusToolbar.status_icon.setGone(it.state == null)
statusToolbar.status_title.setGone(it.state == null) statusToolbar.status_title.setGone(it.state == null)
it.state?.let { state -> it.state?.let { state ->
......
...@@ -76,11 +76,11 @@ class DealScreenController : ...@@ -76,11 +76,11 @@ class DealScreenController :
activity?.actionBar?.setDisplayShowTitleEnabled(false) activity?.actionBar?.setDisplayShowTitleEnabled(false)
toolBar.setToolbar(HeaderToolbarModel( toolBar.setToolbar(HeaderToolbarModel(
true,"МОИ\nСДЕЛКИ",null,null)) true
,resources?.getString(R.string.deal_back_chevron_title)
,null
,null)
)
} }
private fun bindRecycler() { private fun bindRecycler() {
...@@ -134,6 +134,13 @@ class DealScreenController : ...@@ -134,6 +134,13 @@ 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()
toolBar.setToolbar(HeaderToolbarModel(
true
,resources?.getString(R.string.deal_back_chevron_title)
,null
,true)
)
progressLayout.removeAllViews() progressLayout.removeAllViews()
viewState.statusList.forEach { viewState.statusList.forEach {
...@@ -168,6 +175,8 @@ class DealScreenController : ...@@ -168,6 +175,8 @@ class DealScreenController :
progressLayout.invalidate() progressLayout.invalidate()
} }
private fun getComponent() = DaggerDealScreenComponent.factory() private fun getComponent() = DaggerDealScreenComponent.factory()
......
...@@ -53,7 +53,6 @@ class DealsScreenController : ...@@ -53,7 +53,6 @@ class DealsScreenController :
toolBar.showAll() toolBar.showAll()
toolBar.appBar.setExpanded(false,false) toolBar.appBar.setExpanded(false,false)
toolBar.topAppBar.title = "МОИ СДЕЛКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
...@@ -61,7 +60,8 @@ class DealsScreenController : ...@@ -61,7 +60,8 @@ class DealsScreenController :
toolBar.setToolbar( toolBar.setToolbar(
HeaderToolbarModel( HeaderToolbarModel(
false,null,"ИЗБРАННОЕ",null) false,null
,resources?.getString(R.string.my_deals),null)
) )
} }
......
...@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.LinearLayoutManager ...@@ -12,6 +12,7 @@ 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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
...@@ -156,6 +157,12 @@ class EstateScreenController : ...@@ -156,6 +157,12 @@ class EstateScreenController :
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
toolBar.setToolbar(
HeaderToolbarModel(
true,null
,null,null)
)
// planTypesTabLayout. // planTypesTabLayout.
} }
......
...@@ -5,6 +5,7 @@ import androidx.recyclerview.widget.LinearLayoutManager ...@@ -5,6 +5,7 @@ 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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
...@@ -41,11 +42,16 @@ class FavoritesScreenController : ...@@ -41,11 +42,16 @@ class FavoritesScreenController :
private fun setToolbar(){ private fun setToolbar(){
toolBar.showAll() toolBar.showAll()
toolBar.appBar.setExpanded(false,false) toolBar.appBar.setExpanded(false,false)
toolBar.topAppBar.title = "ИЗБРАННОЕ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
favoritesRecyclerView.isNestedScrollingEnabled = false favoritesRecyclerView.isNestedScrollingEnabled = false
toolBar.setToolbar(
HeaderToolbarModel(
false,null
,resources?.getString(R.string.favorites),null)
)
} }
private fun bindRecycler() { private fun bindRecycler() {
......
...@@ -7,6 +7,7 @@ import androidx.recyclerview.widget.LinearLayoutManager ...@@ -7,6 +7,7 @@ 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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
...@@ -45,15 +46,27 @@ class ArticlesScreenController : ...@@ -45,15 +46,27 @@ class ArticlesScreenController :
lateinit var articlesRecyclerView: RecyclerView lateinit var articlesRecyclerView: RecyclerView
private fun setToolbar(){ private fun setToolbar() {
toolBar.showAll() toolBar.showAll()
toolBar.appBar.visibility= Toolbar.VISIBLE toolBar.appBar.visibility = Toolbar.VISIBLE
toolBar.appBar.setExpanded(false,false) toolBar.appBar.setExpanded(false, false)
toolBar.topAppBar.title = "НОВОСТь"
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
articlesRecyclerView.isNestedScrollingEnabled = false articlesRecyclerView.isNestedScrollingEnabled = false
toolBar.setToolbar(
HeaderToolbarModel(
true, null
, resources?.getString(
when (args.getString(FEED_ALIAS)) {
"news" -> R.string.news_header
else -> R.string.blog_header
}
), true
)
, null
)
} }
private fun bindRecycler() { private fun bindRecycler() {
......
...@@ -48,7 +48,7 @@ class PhotoScreenController : ...@@ -48,7 +48,7 @@ class PhotoScreenController :
} }
override fun onViewBound(v: View) { override fun onViewBound(v: View) {
toolBar.hideAll() toolBar.setToolbar()
bottomNavigation.hide() bottomNavigation.hide()
bindRecycler() bindRecycler()
} }
......
...@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager ...@@ -8,6 +8,7 @@ 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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
...@@ -75,13 +76,18 @@ class SettingsScreenController : ...@@ -75,13 +76,18 @@ class SettingsScreenController :
private fun setToolbar(){ private fun setToolbar(){
toolBar.showAll() toolBar.showAll()
toolBar.appBar.setExpanded(false,true) toolBar.appBar.setExpanded(false,true)
toolBar.topAppBar.title = "НАСТРОЙКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.nestedScrollContainer toolBar.appBar.liftOnScrollTargetViewId = R.id.nestedScrollContainer
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true) toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
pushRecycler.isNestedScrollingEnabled = false pushRecycler.isNestedScrollingEnabled = false
cachedRecycler.isNestedScrollingEnabled = false cachedRecycler.isNestedScrollingEnabled = false
toolBar.setToolbar(
HeaderToolbarModel(
false,null
,resources?.getString(R.string.settings),null)
)
} }
override fun onViewBound(v: View) { override fun onViewBound(v: View) {
......
...@@ -6,6 +6,7 @@ import android.widget.EditText ...@@ -6,6 +6,7 @@ import android.widget.EditText
import android.widget.TextView import android.widget.TextView
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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
...@@ -62,11 +63,16 @@ class FindFlatScreenController : ...@@ -62,11 +63,16 @@ class FindFlatScreenController :
private fun setToolbar(){ private fun setToolbar(){
toolBar.showAll() toolBar.showAll()
toolBar.appBar.setExpanded(false,true) toolBar.appBar.setExpanded(false,true)
toolBar.topAppBar.title = "СМОТРЕТЬ\nКВАРТИРУ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true) toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true) toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false) toolBar.appBarScrollable(false)
toolBar.setToolbar(
HeaderToolbarModel(
false,null
,resources?.getString(R.string.flats),null)
)
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/switch_toolbar_container" android:id="@+id/switch_toolbar_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="wrap_content"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorSecondary">@color/colorAccent</item>
<item name="colorSecondaryVariant">@color/colorAccentSecondary</item>
<item name="colorPrimaryDark">@color/colorAccentSecondary</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="materialCardViewStyle">@style/Widget.Biganto.MaterialCardView</item>
<item name="switchStyle">
@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle
</item>
<item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Room Park</string> <string name="app_name">Room Park</string>
<string name="feeds">Новости</string> <string name="feeds">Новости</string>
<string name="favorites">МОИ КВАРТИРЫ</string> <string name="favorites">ИЗБРАННОЕ</string>
<string name="my_deals">МОИ СДЕЛКИ</string> <string name="my_deals">МОИ СДЕЛКИ</string>
<string name="flats">СМОТРЕТЬ КВАРТИРУ</string> <string name="flats">СМОТРЕТЬ\nКВАРТИРУ</string>
<string name="settings">Настройки</string> <string name="settings">Настройки</string>
<string name="snackbar_dismiss_button_default">ПОНЯТНО</string> <string name="snackbar_dismiss_button_default">ПОНЯТНО</string>
<string name="snackbar_dismiss_button_error">ОШИБКА</string> <string name="snackbar_dismiss_button_error">ОШИБКА</string>
...@@ -78,6 +78,9 @@ ...@@ -78,6 +78,9 @@
<string name="overall_cache">Всего скачано</string> <string name="overall_cache">Всего скачано</string>
<string name="estate_avalibale">СВОБОДНА</string> <string name="estate_avalibale">СВОБОДНА</string>
<string name="estate_sold_out">ПРОДАНА</string> <string name="estate_sold_out">ПРОДАНА</string>
<string name="deal_back_chevron_title">МОИ\nСДЕЛКИ</string>
<string name="news_header">НОВОСТИ</string>
<string name="blog_header">БЛОГ</string>
<!--endregion--> <!--endregion-->
</resources> </resources>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<item name="colorControlActivated">@color/colorAccent</item> <item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item> <item name="colorControlHighlight">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorAccent</item> <item name="colorControlNormal">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimary</item>
</style> </style>
<style name="Widget.MainTextInputStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox"> <style name="Widget.MainTextInputStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
......
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