Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
756f4c7b
Commit
756f4c7b
authored
Oct 24, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust toolbar pipeline
parent
1e9e9d41
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
9 deletions
+114
-9
ScreenController.kt
...al/roompark/presentation/screen/deals/ScreenController.kt
+10
-0
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+12
-0
BottomNavigationRouterPagerAdapter.kt
...ntation/screen/home/BottomNavigationRouterPagerAdapter.kt
+51
-1
HomeController.kt
...isual/roompark/presentation/screen/home/HomeController.kt
+4
-3
ScreenController.kt
...roompark/presentation/screen/settings/ScreenController.kt
+19
-1
ScreenController.kt
.../roompark/presentation/screen/to_flat/ScreenController.kt
+12
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+2
-3
home_screen_viewpager.xml
app/src/main/res/layout/home_screen_viewpager.xml
+2
-1
settings_screen.xml
app/src/main/res/layout/settings_screen.xml
+2
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenController.kt
View file @
756f4c7b
...
...
@@ -44,12 +44,22 @@ class DealsScreenController :
)
}
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
true
)
toolBar
.
collapsingToolbarLayout
.
title
=
"МОИ СДЕЛКИ"
toolBar
.
appBar
.
liftOnScrollTargetViewId
=
R
.
id
.
favorites_cards_recycler_view
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBarScrollable
(
false
)
favoritesRecyclerView
.
isNestedScrollingEnabled
=
false
}
@Inject
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
bindRecycler
()
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
756f4c7b
...
...
@@ -33,6 +33,17 @@ class FavoritesScreenController :
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
lateinit
var
favoritesRecyclerView
:
RecyclerView
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
false
)
toolBar
.
collapsingToolbarLayout
.
title
=
"ИЗБРАННОЕ"
toolBar
.
appBar
.
liftOnScrollTargetViewId
=
R
.
id
.
favorites_cards_recycler_view
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBarScrollable
(
false
)
favoritesRecyclerView
.
isNestedScrollingEnabled
=
false
}
private
fun
bindRecycler
()
{
favoritesRecyclerView
.
isNestedScrollingEnabled
=
true
favoritesRecyclerView
.
layoutManager
=
...
...
@@ -49,6 +60,7 @@ class FavoritesScreenController :
}
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
bindRecycler
()
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/BottomNavigationRouterPagerAdapter.kt
View file @
756f4c7b
...
...
@@ -6,12 +6,15 @@ import android.util.SparseArray
import
android.view.Menu
import
android.view.View
import
android.view.ViewGroup
import
android.widget.Toolbar
import
androidx.annotation.NonNull
import
androidx.coordinatorlayout.widget.CoordinatorLayout
import
androidx.core.view.contains
import
androidx.core.view.forEach
import
androidx.core.view.get
import
androidx.viewpager.widget.PagerAdapter
import
androidx.viewpager.widget.ViewPager
import
com.biganto.visual.roompark.base.ICollapsingToolBar
import
com.biganto.visual.roompark.base.IConductorActivity
import
com.bluelinelabs.conductor.Controller
import
com.bluelinelabs.conductor.Router
import
com.bluelinelabs.conductor.RouterTransaction
...
...
@@ -108,6 +111,7 @@ class BNVRouterPagerAdapter(
visibleRouters
.
remove
(
position
)
}
override
fun
setPrimaryItem
(
container
:
ViewGroup
,
position
:
Int
,
router
:
Any
)
{
require
(
router
is
Router
)
{
"Non-router object in router stack!"
}
...
...
@@ -116,8 +120,54 @@ class BNVRouterPagerAdapter(
router
.
backstack
.
forEach
{
it
.
controller
().
setOptionsMenuHidden
(
false
)
}
currentPrimaryRouter
=
router
}
drawToolbar
(
position
)
}
fun
drawToolbar
(
position
:
Int
){
val
toolBar
=
currentPrimaryRouter
?.
activity
as
ICollapsingToolBar
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
true
)
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBar
.
setLifted
(
true
)
toolBar
.
appBarScrollable
(
false
)
toolBar
.
collapsingToolbarLayout
.
title
=
when
(
position
){
0
->
"dsfsdf"
1
->
"ИЗБРАННОЕ"
2
->
"МОИ СДЕЛКИ"
3
->
"СМОТРЕТЬ\nКВАРТИРУ"
4
->
"НАСТРОЙКИ"
else
->
""
}
toolBar
.
appBar
.
visibility
=
View
.
VISIBLE
val
cc
=
(
currentPrimaryRouter
?.
activity
as
IConductorActivity
)
Timber
.
d
(
" posicione $position"
)
when
(
position
){
0
->
{
Timber
.
d
(
" IN POSOIITION 0 "
)
toolBar
.
appBar
.
visibility
=
Toolbar
.
GONE
;
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
->{}
3
->
{
toolBar
.
appBar
.
setLifted
(
false
)
toolBar
.
appBar
.
setLiftable
(
false
)
}
4
->{}
else
->
{}
}
}
override
fun
isViewFromObject
(
view
:
View
,
router
:
Any
):
Boolean
{
require
(
router
is
Router
)
{
"Non-router object in router stack!"
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/HomeController.kt
View file @
756f4c7b
package
com.biganto.visual.roompark.presentation.screen.home
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.viewpager.widget.ViewPager
import
butterknife.BindView
import
com.biganto.visual.roompark.R
...
...
@@ -16,6 +14,7 @@ import com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreen
import
com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import
com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import
com.google.android.material.bottomnavigation.BottomNavigationView
import
javax.inject.Inject
/**
...
...
@@ -29,7 +28,8 @@ class HomeController :
,
HomeScreen
{
override
fun
onViewBound
(
v
:
View
)
{
tb
.
showAll
()
bottomNavigation
.
bottomNavigation
.
visibility
=
BottomNavigationView
.
VISIBLE
viewpager
.
offscreenPageLimit
=
0
pageAdapter
=
BNVRouterPagerAdapter
(
this
,
bottomNavigation
.
bottomNavigation
,
viewpager
,
mapOf
(
Pair
(
R
.
id
.
tab_feeds
,{
FeedsScreenController
()})
...
...
@@ -45,6 +45,7 @@ class HomeController :
getComponent
()
}
@BindView
(
R
.
id
.
home_router_host
)
lateinit
var
viewpager
:
ViewPager
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenController.kt
View file @
756f4c7b
...
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.settings
import
android.annotation.SuppressLint
import
android.view.View
import
android.widget.ImageView
import
androidx.core.widget.NestedScrollView
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
...
...
@@ -34,6 +35,10 @@ class SettingsScreenController :
@Inject
override
lateinit
var
injectedPresenter
:
SettingsScreenPresenter
@BindView
(
R
.
id
.
nestedScrollContainer
)
lateinit
var
scrollContainer
:
NestedScrollView
@BindView
(
R
.
id
.
pushRecyclerView
)
lateinit
var
pushRecycler
:
RecyclerView
...
...
@@ -53,9 +58,20 @@ class SettingsScreenController :
lateinit
var
flatDownloaderButton
:
ImageView
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
true
)
toolBar
.
collapsingToolbarLayout
.
title
=
"НАСТРОЙКИ"
toolBar
.
appBar
.
liftOnScrollTargetViewId
=
R
.
id
.
nestedScrollContainer
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBar
.
setLifted
(
true
)
toolBar
.
appBarScrollable
(
false
)
pushRecycler
.
isNestedScrollingEnabled
=
false
cachedRecycler
.
isNestedScrollingEnabled
=
false
}
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
pushRecycler
.
isNestedScrollingEnabled
=
true
pushRecycler
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
...
...
@@ -67,6 +83,8 @@ class SettingsScreenController :
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
cachedRecycler
.
adapter
=
CahcedListAdapter
()
cachedRecycler
.
itemAnimator
=
null
}
override
fun
render
(
viewState
:
SettingsScreenViewState
)
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/to_flat/ScreenController.kt
View file @
756f4c7b
...
...
@@ -46,6 +46,17 @@ class FindFlatScreenController :
getComponent
()
}
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
appBar
.
setExpanded
(
false
,
true
)
toolBar
.
collapsingToolbarLayout
.
title
=
"СМОТРЕТЬ\nКВАРТИРУ"
toolBar
.
appBar
.
liftOnScrollTargetViewId
=
R
.
id
.
favorites_cards_recycler_view
toolBar
.
appBar
.
setLiftable
(
true
)
toolBar
.
appBar
.
setLifted
(
true
)
toolBar
.
appBarScrollable
(
false
)
}
@BindView
(
R
.
id
.
flat_estate_tabs
)
lateinit
var
flatTabs
:
TabLayout
...
...
@@ -68,6 +79,7 @@ class FindFlatScreenController :
)
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
estateTabs
.
forEach
{
estate
->
val
tab
=
flatTabs
.
newTab
()
.
setCustomView
(
R
.
layout
.
to_flat_tab_view
)
...
...
app/src/main/res/layout/activity_main.xml
View file @
756f4c7b
...
...
@@ -23,8 +23,8 @@
android:background=
"@color/colorCommonBackground"
android:clipToPadding=
"true"
android:theme=
"@style/ThemeOverlay.AppCompat.Light"
app:elevation=
"0dp"
app:expanded=
"false"
app:liftOnScroll=
"true"
app:layout_behavior=
".util.view_utils.app_bar.DragControlAppBarLayoutBehaviour"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -41,14 +41,13 @@
app:expandedTitleMargin=
"16dp"
app:layout_scrollFlags=
"scroll|exitUntilCollapsed"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/top_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"?android:attr/actionBarSize"
android:visibility=
"invisible"
app:layout_collapseMode=
"pin"
app:titleTextAppearance=
"@style/Header_TextView.Main_Header"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:showAsAction=
"always"
tools:visibility=
"invisible"
>
...
...
app/src/main/res/layout/home_screen_viewpager.xml
View file @
756f4c7b
...
...
@@ -6,5 +6,6 @@
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/home_router_host"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/settings_screen.xml
View file @
756f4c7b
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/nestedScrollContainer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<LinearLayout
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment