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
62322aa7
Commit
62322aa7
authored
Jan 27, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix backstack behaviour
parent
72b52335
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
46 deletions
+57
-46
RoomParkMainActivity.kt
.../com/biganto/visual/roompark/base/RoomParkMainActivity.kt
+0
-6
BigantoBaseController.kt
...iganto/visual/roompark/conductor/BigantoBaseController.kt
+3
-1
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+7
-7
ScreenController.kt
...al/roompark/presentation/screen/deals/ScreenController.kt
+13
-8
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+13
-9
HomeBottomNavigationController.kt
...creen/home/home_routing/HomeBottomNavigationController.kt
+14
-8
deal_card_viewholder.xml
app/src/main/res/layout/deal_card_viewholder.xml
+7
-7
No files found.
app/src/main/java/com/biganto/visual/roompark/base/RoomParkMainActivity.kt
View file @
62322aa7
...
@@ -90,12 +90,6 @@ class RoomParkMainActivity(
...
@@ -90,12 +90,6 @@ class RoomParkMainActivity(
get
()
=
headerToolbar
.
findViewById
<
MaterialTextView
>(
R
.
id
.
back_button_chevron
)
get
()
=
headerToolbar
.
findViewById
<
MaterialTextView
>(
R
.
id
.
back_button_chevron
)
override
fun
setToolbar
(
header
:
HeaderToolbarModel
?,
status
:
StatusToolbarModel
?){
override
fun
setToolbar
(
header
:
HeaderToolbarModel
?,
status
:
StatusToolbarModel
?){
Timber
.
d
(
"pffff appbr: ${appBar.height}"
)
Timber
.
d
(
"pffff toolbar: ${topAppBar.height}"
)
Timber
.
d
(
"pffff tbContainer: ${tbContainer.height}"
)
Timber
.
d
(
"pffff headerToolbar: ${headerToolbar.height}"
)
Timber
.
d
(
"pffff statusToolbar: ${statusToolbar.height}"
)
appBar
.
setExpanded
(
false
,
false
)
appBar
.
setExpanded
(
false
,
false
)
if
(
header
==
null
&&
status
==
null
){
if
(
header
==
null
&&
status
==
null
){
hideAll
()
hideAll
()
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/BigantoBaseController.kt
View file @
62322aa7
...
@@ -74,6 +74,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
...
@@ -74,6 +74,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
// instantiate the view
// instantiate the view
retainViewMode
=
RetainViewMode
.
RELEASE_DETACH
ButterKnife
.
bind
(
this
,
view
)
ButterKnife
.
bind
(
this
,
view
)
(
activity
as
RoomParkMainActivity
).
let
{
(
activity
as
RoomParkMainActivity
).
let
{
snackbar
=
ActivityModule
.
provideSnackBar
(
it
)
snackbar
=
ActivityModule
.
provideSnackBar
(
it
)
...
@@ -102,7 +103,8 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
...
@@ -102,7 +103,8 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
override
fun
handleBack
():
Boolean
{
override
fun
handleBack
():
Boolean
{
router
.
popController
(
this
)
router
.
popController
(
this
)
return
super
.
handleBack
()
return
true
// return super.handleBack()
}
}
fun
showError
(
e
:
ExceptionString
)
=
fun
showError
(
e
:
ExceptionString
)
=
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
62322aa7
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication
...
@@ -13,6 +13,7 @@ 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.DealModel
import
com.biganto.visual.roompark.domain.model.typeDoubleString
import
com.biganto.visual.roompark.domain.model.typeShortString
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
...
@@ -91,12 +92,10 @@ class DealScreenController :
...
@@ -91,12 +92,10 @@ class DealScreenController :
)
)
}
}
detachDisposable
.
add
(
detachDisposable
.
add
(
dealContainer
.
scrollChangeEvents
()
dealContainer
.
scrollChangeEvents
()
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
.
subscribe
{
if
(
it
.
scrollY
>
dealTitle
.
measuredHeight
)
if
(
it
.
scrollY
>
dealTitle
.
measuredHeight
)
dealModel
?.
let
{
deal
->
dealModel
?.
let
{
deal
->
toolBar
.
setToolbar
(
toolBar
.
setToolbar
(
...
@@ -118,7 +117,6 @@ class DealScreenController :
...
@@ -118,7 +117,6 @@ class DealScreenController :
,
true
,
true
)
)
)
)
}
}
)
)
}
}
...
@@ -159,6 +157,12 @@ class DealScreenController :
...
@@ -159,6 +157,12 @@ class DealScreenController :
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
private
fun
render
(
viewState
:
DealScreenViewState
.
LoadDeal
)
{
dealTitle
.
text
=
resources
?.
getString
(
viewState
.
estate
.
estate
.
type
.
typeDoubleString
(),
viewState
.
estate
.
estate
.
number
)
info1
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
building
)
info1
.
title
.
text
=
resources
?.
getString
(
R
.
string
.
building
)
info1
.
text
.
text
=
viewState
.
estate
.
estate
.
commonInfo
?.
building
.
toString
()
info1
.
text
.
text
=
viewState
.
estate
.
estate
.
commonInfo
?.
building
.
toString
()
...
@@ -218,10 +222,6 @@ class DealScreenController :
...
@@ -218,10 +222,6 @@ class DealScreenController :
progressLayout
.
addView
(
statusLayout
)
progressLayout
.
addView
(
statusLayout
)
}
}
progressLayout
.
invalidate
()
progressLayout
.
invalidate
()
}
}
private
fun
getComponent
()
=
DaggerDealScreenComponent
.
factory
()
private
fun
getComponent
()
=
DaggerDealScreenComponent
.
factory
()
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenController.kt
View file @
62322aa7
...
@@ -63,25 +63,30 @@ class DealsScreenController :
...
@@ -63,25 +63,30 @@ class DealsScreenController :
@Inject
@Inject
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
lateinit
var
injectedPresenter
:
DealsScreenPresenter
override
fun
onAttach
(
view
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
super
.
onAttach
(
view
)
bottomNavigationController
.
show
()
Timber
.
d
(
"On attach View"
)
setToolbar
()
bindRecycler
()
detachDisposable
.
addAll
(
detachDisposable
.
addAll
(
(
dealsRecyclerView
.
adapter
as
DealsListAdapter
)
(
dealsRecyclerView
.
adapter
as
DealsListAdapter
)
.
onItemClicked
.
onItemClicked
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
.
subscribe
{
Timber
.
d
(
"got card clicked $it"
)
Timber
.
d
(
"got card clicked $it"
)
router
.
pushController
(
RouterTransaction
.
with
(
DealScreenController
(
it
.
id
))
router
.
pushController
(
.
pushChangeHandler
(
FadeChangeHandler
())
RouterTransaction
.
with
(
DealScreenController
(
it
.
id
))
.
popChangeHandler
(
FadeChangeHandler
())
.
pushChangeHandler
(
FadeChangeHandler
())
.
popChangeHandler
(
FadeChangeHandler
())
)
)
}
}
)
)
}
}
override
fun
onViewBound
(
v
:
View
)
{
bottomNavigationController
.
show
()
setToolbar
()
bindRecycler
()
}
override
fun
render
(
viewState
:
DealsScreenViewState
)
{
override
fun
render
(
viewState
:
DealsScreenViewState
)
{
super
.
render
(
viewState
)
super
.
render
(
viewState
)
Timber
.
d
(
"Render state $viewState"
)
Timber
.
d
(
"Render state $viewState"
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
62322aa7
...
@@ -38,6 +38,18 @@ class FavoritesScreenController :
...
@@ -38,6 +38,18 @@ class FavoritesScreenController :
lateinit
var
favoritesRecyclerView
:
RecyclerView
lateinit
var
favoritesRecyclerView
:
RecyclerView
override
fun
onAttach
(
view
:
View
)
{
super
.
onAttach
(
view
)
detachDisposable
.
addAll
(
(
favoritesRecyclerView
.
adapter
as
FavoritesListAdapter
)
.
onItemClicked
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
Timber
.
d
(
"got card clicked $it"
)
router
.
pushController
(
RouterTransaction
.
with
(
EstateScreenController
(
it
.
id
)))
}
)
}
private
fun
setToolbar
(){
private
fun
setToolbar
(){
favoritesRecyclerView
.
isNestedScrollingEnabled
=
false
favoritesRecyclerView
.
isNestedScrollingEnabled
=
false
...
@@ -68,15 +80,6 @@ class FavoritesScreenController :
...
@@ -68,15 +80,6 @@ class FavoritesScreenController :
bottomNavigationController
.
show
()
bottomNavigationController
.
show
()
setToolbar
()
setToolbar
()
bindRecycler
()
bindRecycler
()
detachDisposable
.
addAll
(
(
favoritesRecyclerView
.
adapter
as
FavoritesListAdapter
)
.
onItemClicked
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
Timber
.
d
(
"got card clicked $it"
)
router
.
pushController
(
RouterTransaction
.
with
(
EstateScreenController
(
it
.
id
)))
}
)
}
}
override
fun
render
(
viewState
:
FavoritesScreenViewState
)
{
override
fun
render
(
viewState
:
FavoritesScreenViewState
)
{
...
@@ -108,4 +111,5 @@ class FavoritesScreenController :
...
@@ -108,4 +111,5 @@ class FavoritesScreenController :
override
fun
getLayoutId
():
Int
=
R
.
layout
.
favorites_screen
override
fun
getLayoutId
():
Int
=
R
.
layout
.
favorites_screen
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/home/home_routing/HomeBottomNavigationController.kt
View file @
62322aa7
...
@@ -5,7 +5,6 @@ import android.view.View
...
@@ -5,7 +5,6 @@ import android.view.View
import
androidx.annotation.IdRes
import
androidx.annotation.IdRes
import
androidx.annotation.NonNull
import
androidx.annotation.NonNull
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.ICollapsingToolBar
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.presentation.screen.deals.DealsScreenController
import
com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
...
@@ -42,10 +41,6 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
...
@@ -42,10 +41,6 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
override
fun
getStartupMenuId
():
Int
=
override
fun
getStartupMenuId
():
Int
=
args
.
getInt
(
OPEN_CHILD_CONTROLLER_KEY
,
R
.
id
.
tab_feeds
)
args
.
getInt
(
OPEN_CHILD_CONTROLLER_KEY
,
R
.
id
.
tab_feeds
)
@Inject
lateinit
var
tb
:
ICollapsingToolBar
@Inject
@Inject
override
lateinit
var
injectedPresenter
:
HomeScreenPresenter
override
lateinit
var
injectedPresenter
:
HomeScreenPresenter
...
@@ -131,12 +126,23 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
...
@@ -131,12 +126,23 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
Timber
.
d
(
"in back stack "
)
Timber
.
d
(
"in back stack "
)
val
childRouter
=
getChildRouter
(
currentlySelectedItemId
)
val
childRouter
=
getChildRouter
(
currentlySelectedItemId
)
Timber
.
d
(
"in back stack
-
${childRouter?.backstackSize}"
)
Timber
.
d
(
"in back stack
#
${childRouter?.backstackSize}"
)
if
(
childRouter
!=
null
)
{
if
(
childRouter
!=
null
)
{
Timber
.
d
(
"in back stack -1"
)
if
(
childRouter
.
backstackSize
<
2
)
return
false
if
(
childRouter
.
backstackSize
<
2
)
return
false
if
(
childRouter
.
handleBack
())
navigateTo
(
getControllerFor
(
R
.
id
.
tab_feeds
),
false
)
Timber
.
d
(
"in back stack -2 ${childRouter.backstack}"
)
val
handleBackResult
=
childRouter
.
handleBack
()
// if ()
// navigateTo(getControllerFor(R.id.tab_feeds), false)
Timber
.
d
(
"in back stack __# ${getChildRouter(currentlySelectedItemId)?.backstackSize}"
)
Timber
.
d
(
"in back stack -3 $handleBackResult"
)
return
true
return
true
...
...
app/src/main/res/layout/deal_card_viewholder.xml
View file @
62322aa7
...
@@ -72,21 +72,21 @@
...
@@ -72,21 +72,21 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/statusContainer"
android:id=
"@+id/statusContainer"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"8dp"
android:background=
"@drawable/gradient_background_accent"
android:background=
"@drawable/gradient_background_accent"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:padding=
"16dp"
>
android:padding=
"16dp"
>
<LinearLayout
<LinearLayout
android:id=
"@+id/progress_holder"
android:id=
"@+id/progress_holder"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
></LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
...
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