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
a4a7079b
Commit
a4a7079b
authored
Apr 03, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tours chooser dialog screen
parent
4ff314c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
2 deletions
+135
-2
ChooseResolutionDialogController.kt
...ark/conductor/dialogs/ChooseResolutionDialogController.kt
+1
-1
TourChooserDialogController.kt
...uctor/dialogs/tour_chooser/TourChooserDialogController.kt
+107
-0
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+8
-1
tours_chooser_screen.xml
app/src/main/res/layout/tours_chooser_screen.xml
+19
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/ChooseResolutionDialogController.kt
View file @
a4a7079b
...
...
@@ -25,7 +25,7 @@ import timber.log.Timber
* Created by Vladislav Bogdashkin on 09.04.2019.
*/
internal
const
val
PHOTOS_KEY
=
"CH
H
OSE_PHOTO_LIST_KEY"
internal
const
val
PHOTOS_KEY
=
"CH
O
OSE_PHOTO_LIST_KEY"
private
fun
formBundle
(
photos
:
ArrayList
<
PhotoResolutionModel
>):
Bundle
{
val
b
=
Bundle
()
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/TourChooserDialogController.kt
0 → 100644
View file @
a4a7079b
package
com.biganto.visual.roompark.conductor.dialogs.tour_chooser
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.annotation.LayoutRes
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.TourModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.bluelinelabs.conductor.Controller
import
com.google.android.material.textview.MaterialTextView
import
io.reactivex.disposables.CompositeDisposable
import
timber.log.Timber
/**
* Created by Vladislav Bogdashkin on 09.04.2019.
*/
internal
const
val
TOUR_MODEL_LIST
=
"CHOOSE_TOUR_LIST_KEY"
private
fun
formBundle
(
photos
:
ArrayList
<
TourModel
>):
Bundle
{
val
b
=
Bundle
()
b
.
putParcelableArrayList
(
TOUR_MODEL_LIST
,
photos
)
return
b
}
class
ChooseTourDialogController
:
Controller
{
constructor
(
args
:
Bundle
)
:
super
(
args
)
constructor
(
items
:
ArrayList
<
TourModel
>)
:
super
(
formBundle
(
items
))
private
lateinit
var
recyclerView
:
RecyclerView
private
val
detachDisposable
=
CompositeDisposable
()
override
fun
onDetach
(
view
:
View
)
{
detachDisposable
.
clear
()
super
.
onDetach
(
view
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
recyclerView
=
view
.
findViewById
(
R
.
id
.
toursList
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
recyclerView
.
adapter
=
TourChooserAdapter
()
recyclerView
.
itemAnimator
=
null
recyclerView
.
addItemDecoration
(
DividerItemDecoration
(
activity
,
DividerItemDecoration
.
VERTICAL
)
)
args
.
getParcelableArrayList
<
TourModel
>(
TOUR_MODEL_LIST
)
?.
let
{
(
recyclerView
.
adapter
as
TourChooserAdapter
).
setItems
(
it
)
}
detachDisposable
.
add
(
(
recyclerView
.
adapter
as
TourChooserAdapter
).
onItemClicked
.
subscribe
{
Timber
.
d
(
"gonna shit : $it"
)
// router.replaceTopController(RouterTransaction.with(
// PhotoDialogController(
// it.url
// )
// )
// .popChangeHandler(DialogChangeHandler())
// .pushChangeHandler(DialogChangeHandler())
// )
})
view
.
findViewById
<
View
>(
R
.
id
.
cancel_button
).
setOnClickListener
{
handleBack
()
}
return
view
}
@LayoutRes
fun
getLayoutId
()
=
R
.
layout
.
tours_chooser_screen
override
fun
handleBack
():
Boolean
{
return
router
.
popCurrentController
()
}
}
internal
class
TourChooserAdapter
:
CommonRecyclerAdapter
<
TourChooserViewHolder
,
TourModel
>(){
override
val
vhKlazz
=
TourChooserViewHolder
::
class
override
fun
getVhLayout
():
Int
=
R
.
layout
.
tour_chooser_viewholder
}
internal
class
TourChooserViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
TourModel
>(
itemView
){
@BindView
(
R
.
id
.
tour_name
)
lateinit
var
tourName
:
MaterialTextView
override
fun
onViewBound
(
model
:
TourModel
)
{
tourName
.
text
=
model
.
title
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
a4a7079b
...
...
@@ -18,11 +18,14 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.StatusState
import
com.biganto.visual.roompark.base.StatusToolbarModel
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import
com.biganto.visual.roompark.conductor.dialogs.tour_chooser.ChooseTourDialogController
import
com.biganto.visual.roompark.domain.model.*
import
com.biganto.visual.roompark.presentation.screen.estate.util.FlatInfoAdapter
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.biganto.visual.roompark.util.extensions.startUrl
import
com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bumptech.glide.Glide
import
com.google.android.material.switchmaterial.SwitchMaterial
import
com.google.android.material.tabs.TabLayout
...
...
@@ -318,7 +321,11 @@ class EstateScreenController :
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
ToursLoaded
)
{
router
.
pushController
(
RouterTransaction
.
with
(
ChooseTourDialogController
(
ArrayList
(
viewState
.
tours
)))
.
popChangeHandler
(
DialogChangeHandler
())
.
pushChangeHandler
(
DialogChangeHandler
())
)
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlanTypes
)
{
...
...
app/src/main/res/layout/tours_chooser_screen.xml
View file @
a4a7079b
...
...
@@ -30,4 +30,23 @@
</androidx.recyclerview.widget.RecyclerView>
</com.google.android.material.card.MaterialCardView>
<ImageView
android:id=
"@+id/close_current_button"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_alignParentTop=
"true"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"8dp"
android:clickable=
"true"
android:contentDescription=
"@string/content_description_close"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:scaleType=
"fitXY"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:src=
"@drawable/ic_close_circled"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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