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
Show 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 :
...
@@ -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
@Inject
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
bindRecycler
()
bindRecycler
()
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
756f4c7b
...
@@ -33,6 +33,17 @@ class FavoritesScreenController :
...
@@ -33,6 +33,17 @@ class FavoritesScreenController :
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
lateinit
var
favoritesRecyclerView
:
RecyclerView
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
()
{
private
fun
bindRecycler
()
{
favoritesRecyclerView
.
isNestedScrollingEnabled
=
true
favoritesRecyclerView
.
isNestedScrollingEnabled
=
true
favoritesRecyclerView
.
layoutManager
=
favoritesRecyclerView
.
layoutManager
=
...
@@ -49,6 +60,7 @@ class FavoritesScreenController :
...
@@ -49,6 +60,7 @@ class FavoritesScreenController :
}
}
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
bindRecycler
()
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
...
@@ -6,12 +6,15 @@ import android.util.SparseArray
import
android.view.Menu
import
android.view.Menu
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.Toolbar
import
androidx.annotation.NonNull
import
androidx.annotation.NonNull
import
androidx.coordinatorlayout.widget.CoordinatorLayout
import
androidx.core.view.contains
import
androidx.core.view.contains
import
androidx.core.view.forEach
import
androidx.core.view.get
import
androidx.core.view.get
import
androidx.viewpager.widget.PagerAdapter
import
androidx.viewpager.widget.PagerAdapter
import
androidx.viewpager.widget.ViewPager
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.Controller
import
com.bluelinelabs.conductor.Router
import
com.bluelinelabs.conductor.Router
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.RouterTransaction
...
@@ -108,6 +111,7 @@ class BNVRouterPagerAdapter(
...
@@ -108,6 +111,7 @@ class BNVRouterPagerAdapter(
visibleRouters
.
remove
(
position
)
visibleRouters
.
remove
(
position
)
}
}
override
fun
setPrimaryItem
(
container
:
ViewGroup
,
position
:
Int
,
router
:
Any
)
{
override
fun
setPrimaryItem
(
container
:
ViewGroup
,
position
:
Int
,
router
:
Any
)
{
require
(
router
is
Router
)
{
"Non-router object in router stack!"
}
require
(
router
is
Router
)
{
"Non-router object in router stack!"
}
...
@@ -116,7 +120,53 @@ class BNVRouterPagerAdapter(
...
@@ -116,7 +120,53 @@ class BNVRouterPagerAdapter(
router
.
backstack
.
forEach
{
it
.
controller
().
setOptionsMenuHidden
(
false
)
}
router
.
backstack
.
forEach
{
it
.
controller
().
setOptionsMenuHidden
(
false
)
}
currentPrimaryRouter
=
router
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
{
override
fun
isViewFromObject
(
view
:
View
,
router
:
Any
):
Boolean
{
require
(
router
is
Router
)
{
"Non-router object in router stack!"
}
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
package
com.biganto.visual.roompark.presentation.screen.home
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
androidx.viewpager.widget.ViewPager
import
androidx.viewpager.widget.ViewPager
import
butterknife.BindView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
...
@@ -16,6 +14,7 @@ import com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreen
...
@@ -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.feeds.FeedsScreenController
import
com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import
com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import
com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import
com.google.android.material.bottomnavigation.BottomNavigationView
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -29,7 +28,8 @@ class HomeController :
...
@@ -29,7 +28,8 @@ class HomeController :
,
HomeScreen
{
,
HomeScreen
{
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
tb
.
showAll
()
bottomNavigation
.
bottomNavigation
.
visibility
=
BottomNavigationView
.
VISIBLE
viewpager
.
offscreenPageLimit
=
0
pageAdapter
=
BNVRouterPagerAdapter
(
this
,
bottomNavigation
.
bottomNavigation
,
viewpager
,
pageAdapter
=
BNVRouterPagerAdapter
(
this
,
bottomNavigation
.
bottomNavigation
,
viewpager
,
mapOf
(
mapOf
(
Pair
(
R
.
id
.
tab_feeds
,{
FeedsScreenController
()})
Pair
(
R
.
id
.
tab_feeds
,{
FeedsScreenController
()})
...
@@ -45,6 +45,7 @@ class HomeController :
...
@@ -45,6 +45,7 @@ class HomeController :
getComponent
()
getComponent
()
}
}
@BindView
(
R
.
id
.
home_router_host
)
@BindView
(
R
.
id
.
home_router_host
)
lateinit
var
viewpager
:
ViewPager
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
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.settings
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.view.View
import
android.view.View
import
android.widget.ImageView
import
android.widget.ImageView
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
...
@@ -34,6 +35,10 @@ class SettingsScreenController :
...
@@ -34,6 +35,10 @@ class SettingsScreenController :
@Inject
@Inject
override
lateinit
var
injectedPresenter
:
SettingsScreenPresenter
override
lateinit
var
injectedPresenter
:
SettingsScreenPresenter
@BindView
(
R
.
id
.
nestedScrollContainer
)
lateinit
var
scrollContainer
:
NestedScrollView
@BindView
(
R
.
id
.
pushRecyclerView
)
@BindView
(
R
.
id
.
pushRecyclerView
)
lateinit
var
pushRecycler
:
RecyclerView
lateinit
var
pushRecycler
:
RecyclerView
...
@@ -53,9 +58,20 @@ class SettingsScreenController :
...
@@ -53,9 +58,20 @@ class SettingsScreenController :
lateinit
var
flatDownloaderButton
:
ImageView
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
)
{
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
pushRecycler
.
isNestedScrollingEnabled
=
true
pushRecycler
.
isNestedScrollingEnabled
=
true
pushRecycler
.
layoutManager
=
pushRecycler
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
...
@@ -67,6 +83,8 @@ class SettingsScreenController :
...
@@ -67,6 +83,8 @@ class SettingsScreenController :
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
cachedRecycler
.
adapter
=
CahcedListAdapter
()
cachedRecycler
.
adapter
=
CahcedListAdapter
()
cachedRecycler
.
itemAnimator
=
null
cachedRecycler
.
itemAnimator
=
null
}
}
override
fun
render
(
viewState
:
SettingsScreenViewState
)
{
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 :
...
@@ -46,6 +46,17 @@ class FindFlatScreenController :
getComponent
()
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
)
@BindView
(
R
.
id
.
flat_estate_tabs
)
lateinit
var
flatTabs
:
TabLayout
lateinit
var
flatTabs
:
TabLayout
...
@@ -68,6 +79,7 @@ class FindFlatScreenController :
...
@@ -68,6 +79,7 @@ class FindFlatScreenController :
)
)
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
// setToolbar()
estateTabs
.
forEach
{
estate
->
estateTabs
.
forEach
{
estate
->
val
tab
=
flatTabs
.
newTab
()
val
tab
=
flatTabs
.
newTab
()
.
setCustomView
(
R
.
layout
.
to_flat_tab_view
)
.
setCustomView
(
R
.
layout
.
to_flat_tab_view
)
...
...
app/src/main/res/layout/activity_main.xml
View file @
756f4c7b
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
android:background=
"@color/colorCommonBackground"
android:background=
"@color/colorCommonBackground"
android:clipToPadding=
"true"
android:clipToPadding=
"true"
android:theme=
"@style/ThemeOverlay.AppCompat.Light"
android:theme=
"@style/ThemeOverlay.AppCompat.Light"
app:elevation=
"0dp"
app:expanded=
"false"
app:expanded=
"false"
app:liftOnScroll=
"true"
app:layout_behavior=
".util.view_utils.app_bar.DragControlAppBarLayoutBehaviour"
app:layout_behavior=
".util.view_utils.app_bar.DragControlAppBarLayoutBehaviour"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -41,14 +41,13 @@
...
@@ -41,14 +41,13 @@
app:expandedTitleMargin=
"16dp"
app:expandedTitleMargin=
"16dp"
app:layout_scrollFlags=
"scroll|exitUntilCollapsed"
>
app:layout_scrollFlags=
"scroll|exitUntilCollapsed"
>
<androidx.appcompat.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/top_toolbar"
android:id=
"@+id/top_toolbar"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"?android:attr/actionBarSize"
android:layout_height=
"?android:attr/actionBarSize"
android:visibility=
"invisible"
android:visibility=
"invisible"
app:layout_collapseMode=
"pin"
app:layout_collapseMode=
"pin"
app:titleTextAppearance=
"@style/Header_TextView.Main_Header"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:showAsAction=
"always"
app:showAsAction=
"always"
tools:visibility=
"invisible"
>
tools:visibility=
"invisible"
>
...
...
app/src/main/res/layout/home_screen_viewpager.xml
View file @
756f4c7b
...
@@ -6,5 +6,6 @@
...
@@ -6,5 +6,6 @@
<androidx.viewpager.widget.ViewPager
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/home_router_host"
android:id=
"@+id/home_router_host"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</LinearLayout>
</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"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:id=
"@+id/nestedScrollContainer"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<LinearLayout
xmlns:tools=
"http://schemas.android.com/tools"
<LinearLayout
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
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