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

new toolbar style

parent 0864bdf8
......@@ -16,7 +16,6 @@ import com.bluelinelabs.conductor.Router
import com.bluelinelabs.conductor.RouterTransaction
import com.crashlytics.android.Crashlytics
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.CollapsingToolbarLayout
import com.google.android.material.bottomnavigation.BottomNavigationView
import io.fabric.sdk.android.Fabric
import kotlinx.android.synthetic.main.activity_main.*
......@@ -28,8 +27,6 @@ class RoomParkMainActivity(
,IConductorActivity
,IBottomNavigation{
// @Inject
// lateinit var snackbarProvider: ISnackBarProvider
......@@ -38,7 +35,6 @@ class RoomParkMainActivity(
@BindView(R.id.top_toolbar) override lateinit var topAppBar: Toolbar
@BindView(R.id.app_bar) override lateinit var appBar: AppBarLayout
@BindView(R.id.topToolbarHolder) override lateinit var coordinatorLayout: CoordinatorLayout
@BindView(R.id.collapsingToolbarLayout) override lateinit var collapsingToolbarLayout: CollapsingToolbarLayout
@BindView(R.id.conductor_container) override lateinit var conductorContainer: ViewGroup
@BindView(R.id.bottom_navigation_view) override lateinit var bottomNavigation: BottomNavigationView
......@@ -75,6 +71,14 @@ class RoomParkMainActivity(
conductor_container.requestLayout()
}
override val statusToolbar: ViewGroup
get() = topAppBar.findViewById<ViewGroup>(R.id.status_toolbar_container)
override val headerToolbar: ViewGroup
get() = topAppBar.findViewById<ViewGroup>(R.id.switch_toolbar_container)
override fun hide() {
bottomNavigation.visibility = BottomNavigationView.GONE
bottomShadow.visibility = View.GONE
......@@ -89,7 +93,6 @@ class RoomParkMainActivity(
override fun showAll() {
appBar.setExpanded(true,false)
collapsingToolbarLayout.visibility= View.VISIBLE
appBar.visibility= View.VISIBLE
topAppBar.visibility = View.VISIBLE
......
......@@ -4,7 +4,6 @@ import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar
import androidx.coordinatorlayout.widget.CoordinatorLayout
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.CollapsingToolbarLayout
import com.google.android.material.bottomnavigation.BottomNavigationView
/**
......@@ -21,8 +20,9 @@ interface ISupportActionBar{
interface ICollapsingToolBar : ISupportActionBar{
val appBar : AppBarLayout
val coordinatorLayout: CoordinatorLayout
val collapsingToolbarLayout : CollapsingToolbarLayout
fun appBarScrollable(allow:Boolean)
val statusToolbar:ViewGroup
val headerToolbar:ViewGroup
}
interface IConductorActivity{
......
......@@ -73,10 +73,8 @@ class AlbumsContractModule @Inject constructor(
Observable.mergeDelayError(
arrayListOf(fetchTopLevelAlbumsApi,fetchTopLevelAlbumsDb)
).doOnNext { Timber.d("got entity $it") }.map { fromEntity(it,::fromEntity) }
//endregion allAlbums
//region concrete Albums
private fun fetchAlbumsApi(parentAlbumId:Int) =
api.getAlbums(parentAlbumId)
......@@ -105,7 +103,6 @@ class AlbumsContractModule @Inject constructor(
Observable.mergeDelayError(
arrayListOf(fetchAlbumsApi(parentId),fetchAlbumsDb(parentId))
).map { fromEntity(it,::fromEntity) }
//endregion concrete Albums
......@@ -119,8 +116,6 @@ class AlbumsContractModule @Inject constructor(
private fun fetchWebCams(): Observable<WebCamListModel> = fetchWebCamsApi
//endregion
//region concrete Albums
private fun fetchAlbumPhotosApi(albumId:Int) =
api.getPhotos(albumId)
......@@ -141,7 +136,6 @@ class AlbumsContractModule @Inject constructor(
Observable.mergeDelayError(
arrayListOf(fetchAlbumPhotosApi(albumId),fetchAlbumsPhotosDb(albumId))
).map { fromEntity(it,::fromEntity) }
//endregion concrete Albums
}
......
......@@ -27,7 +27,7 @@ import javax.inject.Inject
const val SELECTED_DEAL_ID_KEY = "SELECTED_DEAL_GUID"
class DealScreenController :
class DealScreenController :
BigantoBaseController<DealScreenViewState
, DealScreen
, DealScreenPresenter>
......@@ -68,22 +68,18 @@ class DealScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.collapsingToolbarLayout.title = "lalka"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
// toolBar.collapsingToolbarLayout.viewTreeObserver
Timber.d("content insets : ${toolBar.topAppBar.contentInsetEnd}")
toolBar.statusToolbar.visibility=View.GONE
toolBar.headerToolbar.findViewById<MaterialTextView>(R.id.toolbar_title).text = "Azzzzaa"
toolBar.collapsingToolbarLayout.alpha = 0.4f
activity?.actionBar?.setDisplayShowTitleEnabled(true)
val mInflater = LayoutInflater.from(activity)
val mCustomView = mInflater.inflate(R.layout.switch_toolbar, null)
toolBar.topAppBar.addView(mCustomView)
// toolBar.topAppBar.addView(mCustomView)
// planTypesTabLayout.
}
private fun bindRecycler() {
......
......@@ -49,9 +49,11 @@ class DealsScreenController :
}
private fun setToolbar(){
toolBar.topAppBar.removeAllViews()
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "МОИ СДЕЛКИ"
toolBar.topAppBar.title = "МОИ СДЕЛКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
......
......@@ -152,7 +152,7 @@ class EstateScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.collapsingToolbarLayout.title = "ИЗБРАННОЕ"
toolBar.topAppBar.title = "ИЗБРАННОЕ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
......
......@@ -41,7 +41,7 @@ class FavoritesScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.collapsingToolbarLayout.title = "ИЗБРАННОЕ"
toolBar.topAppBar.title = "ИЗБРАННОЕ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
......
......@@ -50,7 +50,7 @@ class ArticlesScreenController :
toolBar.appBar.visibility= Toolbar.VISIBLE
toolBar.appBar.setExpanded(false,false)
toolBar.collapsingToolbarLayout.title = "НОВОСТь"
toolBar.topAppBar.title = "НОВОСТь"
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
articlesRecyclerView.isNestedScrollingEnabled = false
......
......@@ -131,7 +131,7 @@ class BNVRouterPagerAdapter(
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
toolBar.collapsingToolbarLayout.title = when(position){
toolBar.topAppBar.title = when(position){
0 -> "dsfsdf"
1 -> "ИЗБРАННОЕ"
2 -> "МОИ СДЕЛКИ"
......@@ -151,7 +151,6 @@ Timber.d(" IN POSOIITION 0 ")
toolBar.topAppBar.visibility = View.GONE;
val params: CoordinatorLayout.LayoutParams = cc.conductorContainer.layoutParams as CoordinatorLayout.LayoutParams
params.behavior = null
toolBar.collapsingToolbarLayout.visibility = View.GONE
}
1 ->{}
2 ->{}
......
......@@ -75,7 +75,7 @@ class SettingsScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "НАСТРОЙКИ"
toolBar.topAppBar.title = "НАСТРОЙКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.nestedScrollContainer
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
......
......@@ -62,7 +62,7 @@ class FindFlatScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "СМОТРЕТЬ\nКВАРТИРУ"
toolBar.topAppBar.title = "СМОТРЕТЬ\nКВАРТИРУ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
......
......@@ -13,14 +13,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="56dp"
android:padding="0dp"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="144dp"
android:layout_height="wrap_content"
android:background="@color/colorCommonBackground"
android:clipToPadding="true"
android:padding="0dp"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:expanded="false"
app:layout_behavior=".util.view_utils.app_bar.DragControlAppBarLayoutBehaviour"
......@@ -28,47 +30,71 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:liftOnScroll="true"
android:contentInsetStart="0dp"
android:contentInsetLeft="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:minHeight="24dp"
android:visibility="visible"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
tools:visibility="visible">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
<androidx.appcompat.widget.Toolbar
android:id="@+id/top_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:visibility="invisible"
app:expandedTitleGravity="bottom"
app:expandedTitleMargin="16dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.Toolbar
android:id="@+id/top_toolbar"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:contentInsetStart="0dp"
android:contentInsetLeft="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:minHeight="24dp"
android:padding="0dp"
android:visibility="visible"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextAppearance="@style/Header_TextView.Main_Header">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:visibility="invisible"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:showAsAction="always"
app:titleTextAppearance="@style/Header_TextView.Main_Header"
tools:visibility="invisible">
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:orientation="vertical">
</androidx.appcompat.widget.Toolbar>
<include
layout="@layout/status_layout_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible" />
<include
layout="@layout/switch_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible" />
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/conductor_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<include
layout="@layout/test_progress_status"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>
<!-- <com.bluelinelabs.conductor.ChangeHandlerFrameLayout-->
<!-- android:id="@+id/conductor_container"-->
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/status_toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/status_icon"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/new_feed_icon"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/status_title"
style="@style/Accent_Minor_TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="СВОБОДНА"
app:layout_constraintBottom_toBottomOf="@+id/status_icon"
app:layout_constraintStart_toEndOf="@+id/status_icon"
app:layout_constraintTop_toTopOf="@+id/status_icon" />
<ImageView
android:id="@+id/back_cross"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:scaleType="centerCrop"
android:tint="@color/colorGray"
app:layout_constraintBottom_toBottomOf="@+id/status_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/status_icon"
app:srcCompat="@drawable/ic_close" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -2,17 +2,18 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout13"
android:id="@+id/switch_toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccentSecondary">
android:layout_height="?attr/actionBarSize"
android:background="@color/colorAccentSecondary"
android:fitsSystemWindows="true">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/back_button_chevron"
style="@style/Accent_Minor_TextView.Default"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginStart="8dp"
android:drawableStart="@drawable/ic_chevron_left"
android:gravity="start|center_vertical"
android:text="МОИ \nСДЕЛКИ"
......@@ -32,6 +33,8 @@
android:text="НОВОСТИ"
android:textAlignment="gravity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/back_button_chevron"
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