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
b22a6d40
Commit
b22a6d40
authored
Mar 17, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/start_tour_flat_preview' into develop
parents
811a6796
b5481bc1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
37 additions
and
7 deletions
+37
-7
EstateRepository.kt
...to/visual/roompark/data/data_provider/EstateRepository.kt
+3
-2
RetrofitModule.kt
...oompark/data/repository/api/retrofit/di/RetrofitModule.kt
+1
-1
response.kt
...ual/roompark/data/repository/api/retrofit/raw/response.kt
+2
-1
Estate.kt
...isual/roompark/data/repository/db/requrey/model/Estate.kt
+3
-0
raw2entity.kt
...anto/visual/roompark/data/repository/mapper/raw2entity.kt
+1
-0
ContextModule.kt
...va/com/biganto/visual/roompark/di/dagger/ContextModule.kt
+1
-1
DealPreviewModel.kt
.../biganto/visual/roompark/domain/model/DealPreviewModel.kt
+1
-1
deals.kt
...in/java/com/biganto/visual/roompark/domain/model/deals.kt
+2
-0
ScreenController.kt
...ual/roompark/presentation/screen/deal/ScreenController.kt
+11
-0
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+1
-0
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+10
-0
deal_screen.xml
app/src/main/res/layout/deal_screen.xml
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/EstateRepository.kt
View file @
b22a6d40
...
@@ -197,6 +197,7 @@ class EstateRepository @Inject constructor(
...
@@ -197,6 +197,7 @@ class EstateRepository @Inject constructor(
private
val
getDealsApi
:
Observable
<
List
<
DealEntity
>>
=
private
val
getDealsApi
:
Observable
<
List
<
DealEntity
>>
=
local
.
recentUser
()
local
.
recentUser
()
.
doOnError
(
Timber
::
e
)
.
flatMap
{
.
flatMap
{
when
(
it
)
{
when
(
it
)
{
is
UserState
.
Authenticated
->
db
.
fetchUser
(
it
.
uuid
.
toInt
())
is
UserState
.
Authenticated
->
db
.
fetchUser
(
it
.
uuid
.
toInt
())
...
@@ -230,8 +231,8 @@ class EstateRepository @Inject constructor(
...
@@ -230,8 +231,8 @@ class EstateRepository @Inject constructor(
override
fun
getDeals
():
Observable
<
List
<
DealModel
>>
{
override
fun
getDeals
():
Observable
<
List
<
DealModel
>>
{
return
Observable
.
mergeDelayError
(
return
Observable
.
mergeDelayError
(
arrayListOf
(
arrayListOf
(
getDealsDb
,
getDealsApi
getDealsDb
,
getDealsApi
)
)
)
)
.
map
{
fromEntity
(
it
,
::
fromEntity
)
}
.
map
{
fromEntity
(
it
,
::
fromEntity
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/di/RetrofitModule.kt
View file @
b22a6d40
...
@@ -34,7 +34,7 @@ private const val TIMEOUT_SECONDS=120L
...
@@ -34,7 +34,7 @@ private const val TIMEOUT_SECONDS=120L
private
const
val
WRITE_SECONDS
=
120L
private
const
val
WRITE_SECONDS
=
120L
private
const
val
READ_SECONDS
=
120L
private
const
val
READ_SECONDS
=
120L
val
INTERCEPT_LOG_LEVEL
=
HttpLoggingInterceptor
.
Level
.
HEADERS
val
INTERCEPT_LOG_LEVEL
=
HttpLoggingInterceptor
.
Level
.
NONE
@Module
@Module
class
RetrofitModule
{
class
RetrofitModule
{
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/raw/response.kt
View file @
b22a6d40
...
@@ -35,7 +35,8 @@ data class EstateRaw(
...
@@ -35,7 +35,8 @@ data class EstateRaw(
val
plan_jpg
:
PlanRaw
?,
val
plan_jpg
:
PlanRaw
?,
val
url
:
String
,
val
url
:
String
,
val
album_id
:
Int
,
val
album_id
:
Int
,
val
multitour_id
:
Int
?
val
multitour_id
:
Int
?,
val
multitour_preview
:
String
?
)
)
data class
PlanRaw
(
data class
PlanRaw
(
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Estate.kt
View file @
b22a6d40
...
@@ -38,6 +38,9 @@ interface Estate : Persistable {
...
@@ -38,6 +38,9 @@ interface Estate : Persistable {
@get
:
Nullable
@get
:
Nullable
val
multitourId
:
Int
?
val
multitourId
:
Int
?
@get
:
Nullable
val
multitourPreview
:
String
?
val
info_building
:
Int
val
info_building
:
Int
val
info_section_begin
:
Int
val
info_section_begin
:
Int
val
info_floor
:
Int
val
info_floor
:
Int
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/mapper/raw2entity.kt
View file @
b22a6d40
...
@@ -137,6 +137,7 @@ fun fromRaw(raw:EstateRaw):EstateEntity{
...
@@ -137,6 +137,7 @@ fun fromRaw(raw:EstateRaw):EstateEntity{
entity
.
setRooms
(
raw
.
common_info
.
rooms
)
entity
.
setRooms
(
raw
.
common_info
.
rooms
)
entity
.
setAlbumId
(
raw
.
album_id
)
entity
.
setAlbumId
(
raw
.
album_id
)
entity
.
setMultitourId
(
raw
.
multitour_id
)
entity
.
setMultitourId
(
raw
.
multitour_id
)
entity
.
setMultitourPreview
(
raw
.
multitour_preview
)
entity
.
setUrl
(
raw
.
url
)
entity
.
setUrl
(
raw
.
url
)
entity
.
setInfo_floor_max
(
raw
.
common_info
.
floor_max
)
entity
.
setInfo_floor_max
(
raw
.
common_info
.
floor_max
)
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/ContextModule.kt
View file @
b22a6d40
...
@@ -21,7 +21,7 @@ const val ESTATES_CACHE_LIMIT_SECONDS_INACTIVE = 200L
...
@@ -21,7 +21,7 @@ const val ESTATES_CACHE_LIMIT_SECONDS_INACTIVE = 200L
const
val
FILES_CACHE_LIMIT_SIZE
=
10000
const
val
FILES_CACHE_LIMIT_SIZE
=
10000
const
val
FILES_CACHE_LIMIT_SECONDS_INACTIVE
=
60L
const
val
FILES_CACHE_LIMIT_SECONDS_INACTIVE
=
60L
const
val
DATABASE_VERSION
=
9
const
val
DATABASE_VERSION
=
10
@Module
@Module
abstract
class
AppModule
{
abstract
class
AppModule
{
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/DealPreviewModel.kt
View file @
b22a6d40
...
@@ -35,7 +35,7 @@ data class DealPreviewModel(
...
@@ -35,7 +35,7 @@ data class DealPreviewModel(
data
.
first
.
amount_pay_sum
,
data
.
first
.
amount_pay_sum
,
arrayListOf
<
Int
?>(
data
.
first
.
estate
.
multitourId
),
arrayListOf
<
Int
?>(
data
.
first
.
estate
.
multitourId
),
false
,
false
,
null
,
data
.
first
.
estate
.
multitourPreview
,
data
.
second
data
.
second
)
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/deals.kt
View file @
b22a6d40
...
@@ -56,6 +56,7 @@ data class EstateModel(
...
@@ -56,6 +56,7 @@ data class EstateModel(
val
rooms
:
Int
?=
null
,
val
rooms
:
Int
?=
null
,
val
albumId
:
Int
?=
null
,
val
albumId
:
Int
?=
null
,
val
multitourId
:
Int
?=
null
,
val
multitourId
:
Int
?=
null
,
val
multitourPreview
:
String
?=
null
,
val
commonInfo
:
CommonInfoModel
?
=
null
,
val
commonInfo
:
CommonInfoModel
?
=
null
,
val
url
:
String
?
val
url
:
String
?
)
)
...
@@ -94,6 +95,7 @@ fun fromEntity(entity:EstateEntity): EstateModel {
...
@@ -94,6 +95,7 @@ fun fromEntity(entity:EstateEntity): EstateModel {
rooms
=
entity
.
rooms
,
rooms
=
entity
.
rooms
,
albumId
=
entity
.
albumId
,
albumId
=
entity
.
albumId
,
multitourId
=
entity
.
multitourId
,
multitourId
=
entity
.
multitourId
,
multitourPreview
=
entity
.
multitourPreview
,
commonInfo
=
CommonInfoModel
(
commonInfo
=
CommonInfoModel
(
building
=
entity
.
info_building
,
building
=
entity
.
info_building
,
section_begin
=
entity
.
sectionBegin
,
section_begin
=
entity
.
sectionBegin
,
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deal/ScreenController.kt
View file @
b22a6d40
...
@@ -17,10 +17,12 @@ import com.biganto.visual.roompark.domain.model.typeDoubleString
...
@@ -17,10 +17,12 @@ 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.presentation.screen.estate.EstateScreenController
import
com.biganto.visual.roompark.presentation.screen.estate.EstateScreenController
import
com.biganto.visual.roompark.util.extensions.toRubly
import
com.biganto.visual.roompark.util.extensions.toRubly
import
com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
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.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import
com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import
com.bumptech.glide.Glide
import
com.google.android.material.textview.MaterialTextView
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.view.clicks
import
com.jakewharton.rxbinding3.view.clicks
import
com.jakewharton.rxbinding3.view.scrollChangeEvents
import
com.jakewharton.rxbinding3.view.scrollChangeEvents
...
@@ -85,6 +87,9 @@ class DealScreenController :
...
@@ -85,6 +87,9 @@ class DealScreenController :
@BindView
(
R
.
id
.
start_tour_card
)
@BindView
(
R
.
id
.
start_tour_card
)
lateinit
var
startTourView
:
View
lateinit
var
startTourView
:
View
@BindView
(
R
.
id
.
start_tour_image_view
)
lateinit
var
tourScreen
:
RoundedImageView
private
var
servedDeal
:
DealModel
?
=
null
private
var
servedDeal
:
DealModel
?
=
null
override
fun
onAttach
(
view
:
View
)
{
override
fun
onAttach
(
view
:
View
)
{
...
@@ -204,6 +209,12 @@ class DealScreenController :
...
@@ -204,6 +209,12 @@ class DealScreenController :
dealPayed
.
text
=
viewState
.
estate
.
paymentSum
.
toRubly
()
dealPayed
.
text
=
viewState
.
estate
.
paymentSum
.
toRubly
()
dealSumToPay
.
text
=
viewState
.
estate
.
amount_pay_sum
.
toRubly
()
dealSumToPay
.
text
=
viewState
.
estate
.
amount_pay_sum
.
toRubly
()
viewState
.
estate
.
estate
.
multitourPreview
?.
let
{
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
into
(
tourScreen
)
}
dealModel
=
viewState
.
estate
dealModel
=
viewState
.
estate
toolBar
.
setToolbar
(
HeaderToolbarModel
(
toolBar
.
setToolbar
(
HeaderToolbarModel
(
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
b22a6d40
...
@@ -92,6 +92,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
...
@@ -92,6 +92,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
addView
(
currentStatusText
,
0
)
statusLayout
.
invalidate
()
statusLayout
.
invalidate
()
model
.
tourPreview
?.
let
{
model
.
tourPreview
?.
let
{
Glide
.
with
(
tourScreen
)
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
load
(
it
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
b22a6d40
...
@@ -22,6 +22,8 @@ import com.biganto.visual.roompark.domain.model.*
...
@@ -22,6 +22,8 @@ import com.biganto.visual.roompark.domain.model.*
import
com.biganto.visual.roompark.presentation.screen.estate.util.FlatInfoAdapter
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.setGone
import
com.biganto.visual.roompark.util.extensions.startUrl
import
com.biganto.visual.roompark.util.extensions.startUrl
import
com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import
com.bumptech.glide.Glide
import
com.google.android.material.switchmaterial.SwitchMaterial
import
com.google.android.material.switchmaterial.SwitchMaterial
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.textview.MaterialTextView
import
com.google.android.material.textview.MaterialTextView
...
@@ -183,6 +185,8 @@ class EstateScreenController :
...
@@ -183,6 +185,8 @@ class EstateScreenController :
lateinit
var
furnitureDivider
:
View
lateinit
var
furnitureDivider
:
View
@BindView
(
R
.
id
.
start_tour_image_view
)
lateinit
var
tourScreen
:
RoundedImageView
private
fun
setToolbar
(){
private
fun
setToolbar
(){
toolBar
.
setToolbar
(
null
,
StatusToolbarModel
())
toolBar
.
setToolbar
(
null
,
StatusToolbarModel
())
toolBar
.
statusToolbar
.
findViewById
<
View
>(
R
.
id
.
back_cross
).
let
{
toolBar
.
statusToolbar
.
findViewById
<
View
>(
R
.
id
.
back_cross
).
let
{
...
@@ -276,6 +280,12 @@ class EstateScreenController :
...
@@ -276,6 +280,12 @@ class EstateScreenController :
startTour
.
setGone
(
viewState
.
estate
.
multitourId
==
null
)
startTour
.
setGone
(
viewState
.
estate
.
multitourId
==
null
)
startTourDivider
.
setGone
(
viewState
.
estate
.
multitourId
==
null
)
startTourDivider
.
setGone
(
viewState
.
estate
.
multitourId
==
null
)
viewState
.
estate
.
multitourPreview
?.
let
{
Glide
.
with
(
tourScreen
)
.
load
(
it
)
.
into
(
tourScreen
)
}
when
(
viewState
.
estate
.
type
){
when
(
viewState
.
estate
.
type
){
FlatType
.
FLAT
->
{
FlatType
.
FLAT
->
{
flatTypeView
.
setGone
(
false
)
flatTypeView
.
setGone
(
false
)
...
...
app/src/main/res/layout/deal_screen.xml
View file @
b22a6d40
...
@@ -235,7 +235,7 @@
...
@@ -235,7 +235,7 @@
android:id=
"@+id/start_tour_card"
android:id=
"@+id/start_tour_card"
layout=
"@layout/start_tour_viewholder_big"
layout=
"@layout/start_tour_viewholder_big"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<include
<include
layout=
"@layout/horizontal_divider"
layout=
"@layout/horizontal_divider"
...
...
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