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
4c946d7f
Commit
4c946d7f
authored
Jan 14, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show deal screen over press card
parent
30d496d2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
48 deletions
+43
-48
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+0
-2
ScreenDI.kt
...anto/visual/roompark/presentation/screen/deal/ScreenDI.kt
+0
-4
ScreenController.kt
...al/roompark/presentation/screen/deals/ScreenController.kt
+26
-9
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+16
-32
ScreenController.kt
...oompark/presentation/screen/favorites/ScreenController.kt
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
4c946d7f
...
@@ -10,8 +10,6 @@ import com.biganto.visual.roompark.R
...
@@ -10,8 +10,6 @@ import com.biganto.visual.roompark.R
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
import
com.biganto.visual.roompark.presentation.screen.deals.util.createStatusView
import
com.biganto.visual.roompark.presentation.screen.deals.util.deployProgressView
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import
com.google.android.material.textview.MaterialTextView
import
com.google.android.material.textview.MaterialTextView
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenDI.kt
View file @
4c946d7f
...
@@ -4,10 +4,6 @@ import android.content.Context
...
@@ -4,10 +4,6 @@ import android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenComponent
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenController
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenModule
import
com.biganto.visual.roompark.presentation.screen.estate.DealScreenPresenter
import
dagger.Binds
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Component
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenController.kt
View file @
4c946d7f
...
@@ -8,8 +8,12 @@ import com.biganto.visual.roompark.R
...
@@ -8,8 +8,12 @@ import com.biganto.visual.roompark.R
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
import
com.biganto.visual.roompark.presentation.screen.deal.DealScreenController
import
com.biganto.visual.roompark.presentation.screen.deals.util.DealsListAdapter
import
com.biganto.visual.roompark.presentation.screen.deals.util.DealsListAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import
io.reactivex.android.schedulers.AndroidSchedulers
import
timber.log.Timber
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Inject
...
@@ -28,17 +32,17 @@ class DealsScreenController :
...
@@ -28,17 +32,17 @@ class DealsScreenController :
}
}
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
@BindView
(
R
.
id
.
favorites_cards_recycler_view
)
lateinit
var
favorite
sRecyclerView
:
RecyclerView
lateinit
var
deal
sRecyclerView
:
RecyclerView
private
fun
bindRecycler
()
{
private
fun
bindRecycler
()
{
favorite
sRecyclerView
.
isNestedScrollingEnabled
=
true
deal
sRecyclerView
.
isNestedScrollingEnabled
=
true
favorite
sRecyclerView
.
layoutManager
=
deal
sRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
favorite
sRecyclerView
.
adapter
=
DealsListAdapter
()
deal
sRecyclerView
.
adapter
=
DealsListAdapter
()
favorite
sRecyclerView
.
itemAnimator
=
null
deal
sRecyclerView
.
itemAnimator
=
null
if
(
favorite
sRecyclerView
.
itemDecorationCount
==
0
)
if
(
deal
sRecyclerView
.
itemDecorationCount
==
0
)
favorite
sRecyclerView
.
addItemDecoration
(
deal
sRecyclerView
.
addItemDecoration
(
CeilsDecoration
(
1
CeilsDecoration
(
1
,
resources
?.
getDimensionPixelSize
(
R
.
dimen
.
ceil_grid_padding
))
,
resources
?.
getDimensionPixelSize
(
R
.
dimen
.
ceil_grid_padding
))
)
)
...
@@ -51,7 +55,7 @@ class DealsScreenController :
...
@@ -51,7 +55,7 @@ class DealsScreenController :
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
)
favorite
sRecyclerView
.
isNestedScrollingEnabled
=
false
deal
sRecyclerView
.
isNestedScrollingEnabled
=
false
}
}
@Inject
@Inject
...
@@ -61,6 +65,19 @@ class DealsScreenController :
...
@@ -61,6 +65,19 @@ class DealsScreenController :
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
setToolbar
()
setToolbar
()
bindRecycler
()
bindRecycler
()
detachDisposable
.
addAll
(
(
dealsRecyclerView
.
adapter
as
DealsListAdapter
)
.
onItemClicked
.
map
{
it
.
id
.
toInt
()
}
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
{
Timber
.
d
(
"got card clicked $it"
)
router
.
pushController
(
RouterTransaction
.
with
(
DealScreenController
(
it
))
.
pushChangeHandler
(
FadeChangeHandler
())
.
popChangeHandler
(
FadeChangeHandler
())
)
}
)
}
}
override
fun
render
(
viewState
:
DealsScreenViewState
)
{
override
fun
render
(
viewState
:
DealsScreenViewState
)
{
...
@@ -78,7 +95,7 @@ class DealsScreenController :
...
@@ -78,7 +95,7 @@ class DealsScreenController :
}
}
private
fun
render
(
viewState
:
DealsScreenViewState
.
DealsLoaded
){
private
fun
render
(
viewState
:
DealsScreenViewState
.
DealsLoaded
){
(
favorite
sRecyclerView
.
adapter
as
DealsListAdapter
).
addItems
(
viewState
.
items
)
(
deal
sRecyclerView
.
adapter
as
DealsListAdapter
).
addItems
(
viewState
.
items
)
}
}
private
fun
render
(
viewState
:
DealsScreenViewState
.
SomeError
)
=
private
fun
render
(
viewState
:
DealsScreenViewState
.
SomeError
)
=
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
4c946d7f
...
@@ -6,12 +6,13 @@ import android.view.View
...
@@ -6,12 +6,13 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
butterknife.BindView
import
butterknife.ButterKnife
import
butterknife.ButterKnife
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.StatusModel
import
com.biganto.visual.roompark.domain.model.StatusModel
import
com.biganto.visual.roompark.presentation.screen.deals.DealPreviewModel
import
com.biganto.visual.roompark.presentation.screen.deals.DealPreviewModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
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
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import
com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
...
@@ -21,31 +22,14 @@ import com.google.android.material.textview.MaterialTextView
...
@@ -21,31 +22,14 @@ import com.google.android.material.textview.MaterialTextView
* Created by Vladislav Bogdashkin on 16.10.2019.
* Created by Vladislav Bogdashkin on 16.10.2019.
*/
*/
class
DealsListAdapter
:
RecyclerView
.
Adapter
<
DealViewHolder
>()
{
class
DealsListAdapter
:
CommonRecyclerAdapter
<
DealViewHolder
,
DealPreviewModel
>()
{
override
val
vhKlazz
=
DealViewHolder
::
class
private
var
list
:
MutableList
<
DealPreviewModel
>
=
mutableListOf
()
override
fun
getVhLayout
()
=
R
.
layout
.
deal_card_viewholder
fun
addItems
(
list
:
List
<
DealPreviewModel
>){
this
.
list
.
clear
()
this
.
list
.
addAll
(
list
)
notifyDataSetChanged
()
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
DealViewHolder
=
DealViewHolder
(
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
deal_card_viewholder
,
parent
,
false
)
)
override
fun
getItemCount
():
Int
=
list
.
size
override
fun
onBindViewHolder
(
holder
:
DealViewHolder
,
position
:
Int
)
{
holder
.
bindModel
(
list
[
position
])
}
}
}
class
DealViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
class
DealViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
DealPreviewModel
>(
itemView
)
{
@BindView
(
R
.
id
.
deal_card_header
)
lateinit
var
estateTitle
:
TextView
@BindView
(
R
.
id
.
deal_card_header
)
lateinit
var
estateTitle
:
TextView
@BindView
(
R
.
id
.
common_info_block
)
lateinit
var
commonInfo
:
View
@BindView
(
R
.
id
.
common_info_block
)
lateinit
var
commonInfo
:
View
...
@@ -76,24 +60,24 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -76,24 +60,24 @@ class DealViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
ButterKnife
.
bind
(
this
,
itemView
)
ButterKnife
.
bind
(
this
,
itemView
)
}
}
fun
bindModel
(
dea
l
:
DealPreviewModel
)
{
override
fun
onViewBound
(
mode
l
:
DealPreviewModel
)
{
val
fullObjName
=
"${typeName(
deal.type)}\n№${dea
l.name}"
val
fullObjName
=
"${typeName(
model.type)}\n№${mode
l.name}"
estateTitle
.
text
=
fullObjName
estateTitle
.
text
=
fullObjName
renderCommonInfo
(
dea
l
)
renderCommonInfo
(
mode
l
)
if
(
dea
l
.
dealTourIds
.
isNullOrEmpty
())
startTour
.
visibility
=
View
.
GONE
if
(
mode
l
.
dealTourIds
.
isNullOrEmpty
())
startTour
.
visibility
=
View
.
GONE
else
startTour
.
visibility
=
View
.
VISIBLE
else
startTour
.
visibility
=
View
.
VISIBLE
dealSum
.
text
=
dea
l
.
dealSum
.
toRubly
()
dealSum
.
text
=
mode
l
.
dealSum
.
toRubly
()
dealPayed
.
text
=
dea
l
.
dealPayout
.
toRubly
()
dealPayed
.
text
=
mode
l
.
dealPayout
.
toRubly
()
dealSumToPay
.
text
=
dea
l
.
dealToPay
.
toRubly
()
dealSumToPay
.
text
=
mode
l
.
dealToPay
.
toRubly
()
statusContainer
.
deployProgressView
(
deal
.
statusList
,
dea
l
.
statusNo
,
false
)
statusContainer
.
deployProgressView
(
model
.
statusList
,
mode
l
.
statusNo
,
false
)
val
currentStatusText
=
LayoutInflater
.
from
(
itemView
.
context
)
val
currentStatusText
=
LayoutInflater
.
from
(
itemView
.
context
)
.
inflate
(
R
.
layout
.
status_title_textview
,
statusContainer
,
false
)
.
inflate
(
R
.
layout
.
status_title_textview
,
statusContainer
,
false
)
as
MaterialTextView
as
MaterialTextView
currentStatusText
.
text
=
deal
.
statusList
[
dea
l
.
statusNo
-
1
].
title
currentStatusText
.
text
=
model
.
statusList
[
mode
l
.
statusNo
-
1
].
title
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
invalidate
()
statusLayout
.
invalidate
()
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenController.kt
View file @
4c946d7f
...
@@ -8,7 +8,7 @@ import com.biganto.visual.roompark.R
...
@@ -8,7 +8,7 @@ import com.biganto.visual.roompark.R
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
import
com.biganto.visual.roompark.presentation.screen.
deal
.EstateScreenController
import
com.biganto.visual.roompark.presentation.screen.
estate
.EstateScreenController
import
com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.RouterTransaction
...
...
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