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
394e26c4
Commit
394e26c4
authored
Dec 30, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
can't cast svg withing webview - tags parse error
parent
d5e2c26e
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
119 additions
and
43 deletions
+119
-43
build.gradle
app/build.gradle
+1
-0
EstateRepository.kt
...to/visual/roompark/data/data_provider/EstateRepository.kt
+19
-2
IApi.kt
...a/com/biganto/visual/roompark/data/repository/api/IApi.kt
+1
-2
IRoomParkMobileApi.kt
...ompark/data/repository/api/retrofit/IRoomParkMobileApi.kt
+1
-6
RetrofitRepository.kt
...ompark/data/repository/api/retrofit/RetrofitRepository.kt
+2
-2
RetrofitModule.kt
...oompark/data/repository/api/retrofit/di/RetrofitModule.kt
+2
-0
Explication.kt
.../roompark/data/repository/db/requrey/model/Explication.kt
+4
-5
PlanPreset.kt
...l/roompark/data/repository/db/requrey/model/PlanPreset.kt
+2
-2
DealContract.kt
...m/biganto/visual/roompark/domain/contract/DealContract.kt
+1
-0
estate.kt
...a/com/biganto/visual/roompark/domain/interactor/estate.kt
+4
-1
estateUseCase.kt
.../biganto/visual/roompark/domain/use_case/estateUseCase.kt
+6
-0
ScreenContract.kt
...ual/roompark/presentation/screen/estate/ScreenContract.kt
+2
-0
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+38
-5
ScreenPresenter.kt
...al/roompark/presentation/screen/estate/ScreenPresenter.kt
+9
-0
ScreenViewState.kt
...al/roompark/presentation/screen/estate/ScreenViewState.kt
+3
-2
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+0
-3
plantype_tab_background_selector.xml
app/src/main/res/color/plantype_tab_background_selector.xml
+0
-7
accent_selector_rectangle.xml
app/src/main/res/drawable/accent_selector_rectangle.xml
+5
-0
plantype_tab_background_selector.xml
...rc/main/res/drawable/plantype_tab_background_selector.xml
+7
-0
primary_selector_rectangle.xml
app/src/main/res/drawable/primary_selector_rectangle.xml
+5
-0
flat_full_card_screen.xml
app/src/main/res/layout/flat_full_card_screen.xml
+2
-4
select_text_tab.xml
app/src/main/res/layout/select_text_tab.xml
+4
-1
styles.xml
app/src/main/res/values/styles.xml
+1
-1
No files found.
app/build.gradle
View file @
394e26c4
...
@@ -126,6 +126,7 @@ dependencies {
...
@@ -126,6 +126,7 @@ dependencies {
implementation
'com.google.code.gson:gson:2.8.5'
implementation
'com.google.code.gson:gson:2.8.5'
implementation
'com.squareup.retrofit2:retrofit:2.6.1'
implementation
'com.squareup.retrofit2:retrofit:2.6.1'
implementation
'com.squareup.retrofit2:converter-gson:2.3.0'
implementation
'com.squareup.retrofit2:converter-gson:2.3.0'
implementation
'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation
'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation
'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation
'com.squareup.okhttp3:okhttp-urlconnection:3.14.0'
implementation
'com.squareup.okhttp3:okhttp-urlconnection:3.14.0'
...
...
app/src/main/java/com/biganto/visual/roompark/data/data_provider/EstateRepository.kt
View file @
394e26c4
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.data.repository.mapper.fromRawList
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.data.repository.mapper.fromRawList
import
com.biganto.visual.roompark.domain.contract.DealContract
import
com.biganto.visual.roompark.domain.contract.DealContract
import
com.biganto.visual.roompark.domain.custom_exception.CustomApiException
import
com.biganto.visual.roompark.domain.custom_exception.CustomApiException
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.PlanPresetModel
import
com.biganto.visual.roompark.domain.model.fromEntity
import
com.biganto.visual.roompark.domain.model.fromEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
...
@@ -101,10 +102,26 @@ class EstateRepository @Inject constructor(
...
@@ -101,10 +102,26 @@ class EstateRepository @Inject constructor(
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
override
fun
getPlanTypes
(
estateId
:
Int
)
=
override
fun
getPlanTypes
(
estateId
:
Int
)
:
Observable
<
List
<
PlanPresetModel
>>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
getPlanTypesApi
(
estateId
))
arrayListOf
(
getPlanTypesApi
(
estateId
))
).
map
{
l
->
List
(
l
.
size
)
{
fromEntity
(
l
[
it
])
}
}
private
fun
getPlanApi
(
estateId
:
Int
,
planId
:
Int
,
furniture
:
Boolean
=
false
,
sizes
:
Boolean
=
false
,
walls
:
Boolean
=
false
,
electric
:
Boolean
=
false
)
=
api
.
getDirectPlan
(
estateId
,
planId
,
furniture
,
sizes
,
walls
,
electric
)
.
subscribeOn
(
Schedulers
.
io
())
override
fun
getEmptyPlan
(
estateId
:
Int
,
planId
:
Int
):
Observable
<
String
>
=
Observable
.
mergeDelayError
(
arrayListOf
(
getPlanApi
(
estateId
,
planId
))
)
)
.
map
{
l
->
List
(
l
.
size
)
{
fromEntity
(
l
[
it
])
}
}
}
}
app/src/main/java/com/biganto/visual/roompark/data/repository/api/IApi.kt
View file @
394e26c4
package
com.biganto.visual.roompark.data.repository.api
package
com.biganto.visual.roompark.data.repository.api
import
com.biganto.visual.roompark.data.repository.api.retrofit.DEFAULT_ARTICLE_PAGE_SIZE
import
com.biganto.visual.roompark.data.repository.api.retrofit.DEFAULT_ARTICLE_PAGE_SIZE
import
com.biganto.visual.roompark.data.repository.api.retrofit.PlanTypeCatalog
import
com.biganto.visual.roompark.data.repository.api.retrofit.raw.*
import
com.biganto.visual.roompark.data.repository.api.retrofit.raw.*
import
io.reactivex.Observable
import
io.reactivex.Observable
...
@@ -33,7 +32,7 @@ interface IRoomParkApi {
...
@@ -33,7 +32,7 @@ interface IRoomParkApi {
fun
getEstatePlanTypes
(
estateId
:
Int
):
Observable
<
List
<
PlanTypeRaw
>>
fun
getEstatePlanTypes
(
estateId
:
Int
):
Observable
<
List
<
PlanTypeRaw
>>
fun
getDirectPlan
(
fun
getDirectPlan
(
estateId
:
Int
,
estateId
:
Int
,
planType
:
PlanTypeCatalog
,
planType
:
Int
,
showFurniture
:
Boolean
,
showFurniture
:
Boolean
,
showSizes
:
Boolean
,
showSizes
:
Boolean
,
showWalls
:
Boolean
,
showWalls
:
Boolean
,
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/IRoomParkMobileApi.kt
View file @
394e26c4
...
@@ -108,12 +108,7 @@ interface IRoomParkMobileApi{
...
@@ -108,12 +108,7 @@ interface IRoomParkMobileApi{
//region Get Plan Types
//region Get Plan Types
const
val
GET_DIRECT_PLAN_METHOD
=
"estates.getPlan"
const
val
GET_DIRECT_PLAN_METHOD
=
"estates.getPlan"
const
val
DIRECT_PLAN_ESTATE_ID_PARAM
=
"estate_id"
const
val
DIRECT_PLAN_ESTATE_ID_PARAM
=
"estate_id"
const
val
DIRECT_PLAN_TYPE_PARAM
=
"plan_type"
const
val
DIRECT_PLAN_TYPE_PARAM
=
"plan_id"
val
planTypes
=
arrayListOf
(
Pair
(
0
,
"проектная планировка"
),
Pair
(
1
,
"перепланировка №1"
),
Pair
(
2
,
"перепланировка №2"
)
)
const
val
DIRECT_PLAN_FURNITURE_PARAM
=
"furniture"
const
val
DIRECT_PLAN_FURNITURE_PARAM
=
"furniture"
const
val
DIRECT_PLAN_SIZES_PARAM
=
"sizes"
const
val
DIRECT_PLAN_SIZES_PARAM
=
"sizes"
const
val
DIRECT_PLAN_WALLS_PARAM
=
"walls"
const
val
DIRECT_PLAN_WALLS_PARAM
=
"walls"
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/RetrofitRepository.kt
View file @
394e26c4
...
@@ -96,7 +96,7 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
...
@@ -96,7 +96,7 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
override
fun
getDirectPlan
(
override
fun
getDirectPlan
(
estateId
:
Int
,
estateId
:
Int
,
planType
:
PlanTypeCatalog
,
planType
:
Int
,
showFurniture
:
Boolean
,
showFurniture
:
Boolean
,
showSizes
:
Boolean
,
showSizes
:
Boolean
,
showWalls
:
Boolean
,
showWalls
:
Boolean
,
...
@@ -104,7 +104,7 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
...
@@ -104,7 +104,7 @@ class RetrofitRepository @Inject constructor(retrofit: Retrofit) : IRoomParkApi
):
Observable
<
String
>
=
):
Observable
<
String
>
=
api
.
getPlan
(
api
.
getPlan
(
estate_id
=
estateId
,
estate_id
=
estateId
,
planType
=
planType
.
planId
,
planType
=
planType
,
furniture
=
showFurniture
.
asInt
,
furniture
=
showFurniture
.
asInt
,
sizes
=
showSizes
.
asInt
,
sizes
=
showSizes
.
asInt
,
walls
=
showWalls
.
asInt
,
walls
=
showWalls
.
asInt
,
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/di/RetrofitModule.kt
View file @
394e26c4
...
@@ -18,6 +18,7 @@ import okhttp3.logging.HttpLoggingInterceptor
...
@@ -18,6 +18,7 @@ import okhttp3.logging.HttpLoggingInterceptor
import
retrofit2.Retrofit
import
retrofit2.Retrofit
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import
retrofit2.converter.gson.GsonConverterFactory
import
retrofit2.converter.gson.GsonConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
import
timber.log.Timber
import
timber.log.Timber
import
java.util.*
import
java.util.*
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
...
@@ -106,6 +107,7 @@ class RetrofitModule{
...
@@ -106,6 +107,7 @@ class RetrofitModule{
Retrofit
.
Builder
()
Retrofit
.
Builder
()
.
baseUrl
(
IRoomParkMobileApi
.
BASE_URL
)
.
baseUrl
(
IRoomParkMobileApi
.
BASE_URL
)
.
client
(
client
(
AppVersionManager
(
context
),
LiveNetworkMonitor
(
context
)))
.
client
(
client
(
AppVersionManager
(
context
),
LiveNetworkMonitor
(
context
)))
.
addConverterFactory
(
ScalarsConverterFactory
.
create
())
.
addConverterFactory
(
NullOnEmptyConverterFactory
.
create
())
.
addConverterFactory
(
NullOnEmptyConverterFactory
.
create
())
.
addConverterFactory
(
gsonConverterFactory
())
.
addConverterFactory
(
gsonConverterFactory
())
.
addCallAdapterFactory
(
RxJava2CallAdapterFactory
.
create
())
.
addCallAdapterFactory
(
RxJava2CallAdapterFactory
.
create
())
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Explication.kt
View file @
394e26c4
package
com.biganto.visual.roompark.data.repository.db.requrey.model
package
com.biganto.visual.roompark.data.repository.db.requrey.model
import
io.requery.Entity
import
io.requery.*
import
io.requery.Generated
import
io.requery.Key
import
io.requery.Persistable
/**
/**
* Created by Vladislav Bogdashkin on 24.09.2019.
* Created by Vladislav Bogdashkin on 24.09.2019.
*/
*/
@Entity
@Entity
interface
Explication
:
Persistable
{
interface
Explication
:
Persistable
{
@get
:
Key
@get
:
Key
@get
:
Generated
@get
:
Generated
val
id
:
Int
val
id
:
Int
val
living
:
Boolean
val
living
:
Boolean
val
area
:
Float
val
area
:
Float
val
title
:
String
val
title
:
String
@get
:
ManyToOne
(
cascade
=
[
CascadeAction
.
NONE
])
val
owner
:
PlanPreset
}
}
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/PlanPreset.kt
View file @
394e26c4
...
@@ -14,12 +14,12 @@ interface PlanPreset : Persistable {
...
@@ -14,12 +14,12 @@ interface PlanPreset : Persistable {
@get
:
Generated
@get
:
Generated
val
id
:
Int
val
id
:
Int
@get
:
ForeignKey
(
references
=
Estate
::
class
)
@get
:
ForeignKey
(
references
=
Estate
::
class
)
@get
:
ManyToOne
@get
:
ManyToOne
(
cascade
=
[
CascadeAction
.
NONE
])
var
estateId
:
Estate
var
estateId
:
Estate
val
planId
:
Int
val
planId
:
Int
val
title
:
String
val
title
:
String
@get
:
Convert
(
StringListConverter
::
class
)
@get
:
Convert
(
StringListConverter
::
class
)
val
features
:
List
<
String
>
val
features
:
List
<
String
>
@get
:
OneToMany
(
mappedBy
=
"id
"
,
cascade
=
[
CascadeAction
.
SAVE
,
CascadeAction
.
DELETE
])
@get
:
OneToMany
(
mappedBy
=
"owner
"
,
cascade
=
[
CascadeAction
.
SAVE
,
CascadeAction
.
DELETE
])
val
explication
:
MutableList
<
Explication
>
val
explication
:
MutableList
<
Explication
>
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/contract/DealContract.kt
View file @
394e26c4
...
@@ -14,4 +14,5 @@ interface DealContract{
...
@@ -14,4 +14,5 @@ interface DealContract{
fun
getFavorites
()
:
Observable
<
List
<
EstateModel
>>
fun
getFavorites
()
:
Observable
<
List
<
EstateModel
>>
fun
getEstate
(
estateId
:
Int
):
Observable
<
EstateModel
>
fun
getEstate
(
estateId
:
Int
):
Observable
<
EstateModel
>
fun
getPlanTypes
(
estateId
:
Int
):
Observable
<
List
<
PlanPresetModel
>>
fun
getPlanTypes
(
estateId
:
Int
):
Observable
<
List
<
PlanPresetModel
>>
fun
getEmptyPlan
(
estateId
:
Int
,
planId
:
Int
):
Observable
<
String
>
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/interactor/estate.kt
View file @
394e26c4
...
@@ -13,6 +13,9 @@ class EstateInteractor @Inject constructor(
...
@@ -13,6 +13,9 @@ class EstateInteractor @Inject constructor(
fun
getEstate
(
estateId
:
Int
)
=
useCase
.
getEstate
(
estateId
)
fun
getEstate
(
estateId
:
Int
)
=
useCase
.
getEstate
(
estateId
)
// fun getPlanTypes() =
fun
getPlanTypes
(
estateId
:
Int
)
=
useCase
.
getEstatePlanPresets
(
estateId
)
fun
getPlan
(
estateId
:
Int
,
planId
:
Int
)
=
useCase
.
getPlan
(
estateId
,
planId
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/use_case/estateUseCase.kt
View file @
394e26c4
...
@@ -15,4 +15,10 @@ class EstateUseCase @Inject constructor(
...
@@ -15,4 +15,10 @@ class EstateUseCase @Inject constructor(
fun
getEstate
(
estateId
:
Int
)
=
contract
.
getEstate
(
estateId
)
fun
getEstate
(
estateId
:
Int
)
=
contract
.
getEstate
(
estateId
)
fun
getEstatePlanPresets
(
estateId
:
Int
)
=
contract
.
getPlanTypes
(
estateId
)
fun
getPlan
(
estateId
:
Int
,
planId
:
Int
)
=
contract
.
getEmptyPlan
(
estateId
,
planId
)
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenContract.kt
View file @
394e26c4
package
com.biganto.visual.roompark.presentation.screen.estate
package
com.biganto.visual.roompark.presentation.screen.estate
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
import
io.reactivex.Observable
/**
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
*/
interface
EstateScreen
:
BigantoBaseContract
<
EstateScreenViewState
>
{
interface
EstateScreen
:
BigantoBaseContract
<
EstateScreenViewState
>
{
fun
planTypesTabSelected
():
Observable
<
Int
>
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
394e26c4
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.estate
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.estate
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
android.webkit.WebView
import
androidx.core.os.bundleOf
import
androidx.core.os.bundleOf
import
butterknife.BindView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
...
@@ -10,7 +11,11 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
...
@@ -10,7 +11,11 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.conductor.BigantoBaseController
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
import
com.jakewharton.rxbinding3.material.selections
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
timber.log.Timber
import
timber.log.Timber
import
java.util.concurrent.TimeUnit
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -27,6 +32,13 @@ class EstateScreenController :
...
@@ -27,6 +32,13 @@ class EstateScreenController :
,
EstateScreen
{
,
EstateScreen
{
override
fun
planTypesTabSelected
():
Observable
<
Int
>
=
planTypesTabLayout
.
selections
()
.
debounce
(
200L
,
TimeUnit
.
MILLISECONDS
)
.
map
{
it
.
position
}
.
observeOn
(
AndroidSchedulers
.
mainThread
())
constructor
(
args
:
Bundle
):
super
(
args
)
constructor
(
args
:
Bundle
):
super
(
args
)
constructor
(
id
:
Int
)
:
super
(
bundleOf
(
SELECTED_ESTATE_ID_KEY
to
id
))
constructor
(
id
:
Int
)
:
super
(
bundleOf
(
SELECTED_ESTATE_ID_KEY
to
id
))
...
@@ -41,6 +53,9 @@ class EstateScreenController :
...
@@ -41,6 +53,9 @@ class EstateScreenController :
@BindView
(
R
.
id
.
planTypesTabs
)
@BindView
(
R
.
id
.
planTypesTabs
)
lateinit
var
planTypesTabLayout
:
TabLayout
lateinit
var
planTypesTabLayout
:
TabLayout
@BindView
(
R
.
id
.
flat_plan_webview
)
lateinit
var
planWebView
:
WebView
private
fun
setToolbar
(){
private
fun
setToolbar
(){
toolBar
.
showAll
()
toolBar
.
showAll
()
...
@@ -69,6 +84,7 @@ class EstateScreenController :
...
@@ -69,6 +84,7 @@ class EstateScreenController :
is
EstateScreenViewState
.
Idle
->
render
(
viewState
)
is
EstateScreenViewState
.
Idle
->
render
(
viewState
)
is
EstateScreenViewState
.
LoadEstate
->
render
(
viewState
)
is
EstateScreenViewState
.
LoadEstate
->
render
(
viewState
)
is
EstateScreenViewState
.
LoadPlanTypes
->
render
(
viewState
)
is
EstateScreenViewState
.
LoadPlanTypes
->
render
(
viewState
)
is
EstateScreenViewState
.
LoadPlan
->
render
(
viewState
)
is
EstateScreenViewState
.
SomeError
->
render
(
viewState
)
is
EstateScreenViewState
.
SomeError
->
render
(
viewState
)
}
}
}
}
...
@@ -88,15 +104,32 @@ class EstateScreenController :
...
@@ -88,15 +104,32 @@ class EstateScreenController :
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlanTypes
)
{
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlanTypes
)
{
planTypesTabLayout
.
removeAllTabs
()
planTypesTabLayout
.
removeAllTabs
()
var
i
=
1
var
i
=
1
viewState
.
types
.
forEach
{
viewState
.
types
.
forEach
{
val
tab
=
planTypesTabLayout
.
newTab
()
try
{
.
setCustomView
(
R
.
layout
.
select_text_tab
).
setTag
(
it
.
planTypeId
)
tab
.
customView
?.
findViewById
<
MaterialTextView
>(
R
.
id
.
textTitle
)
?.
text
=
"Вариант $i"
val
tab
=
planTypesTabLayout
.
newTab
()
i
++
.
setCustomView
(
R
.
layout
.
select_text_tab
).
setTag
(
it
.
planId
)
(
tab
.
customView
as
MaterialTextView
).
text
=
"Вариант $i"
planTypesTabLayout
.
addTab
(
tab
)
i
++
}
catch
(
e
:
Exception
)
{
Timber
.
e
(
e
)
}
}
}
}
}
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlan
)
{
val
mimeTypeSvg
=
"image/svg+xml"
val
encoding
=
"utf-8"
viewState
.
planBody
.
replace
(
"<br>"
,
"<br />"
)
viewState
.
planBody
.
replace
(
"<\\br>"
,
"<br />"
)
// Timber.w("counts br : ${})
planWebView
.
settings
.
javaScriptEnabled
=
true
planWebView
.
loadData
(
viewState
.
planBody
,
mimeTypeSvg
,
encoding
)
}
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
,
args
.
getInt
(
SELECTED_ESTATE_ID_KEY
))
,
args
.
getInt
(
SELECTED_ESTATE_ID_KEY
))
.
inject
(
this
)
.
inject
(
this
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenPresenter.kt
View file @
394e26c4
...
@@ -29,8 +29,17 @@ class EstateScreenPresenter @Inject constructor(
...
@@ -29,8 +29,17 @@ class EstateScreenPresenter @Inject constructor(
.
map
{
EstateScreenViewState
.
LoadEstate
(
it
)
}
.
map
{
EstateScreenViewState
.
LoadEstate
(
it
)
}
//.map { EstateScreenViewState.FavoriteEstatesLoaded(it) }
//.map { EstateScreenViewState.FavoriteEstatesLoaded(it) }
val
fetchPlans
=
interactor
.
getPlanTypes
(
estateId
)
.
map
{
EstateScreenViewState
.
LoadPlanTypes
(
it
)
}
val
fetchPlan
=
intent
(
EstateScreen
::
planTypesTabSelected
)
.
flatMap
{
planId
->
interactor
.
getPlan
(
estateId
,
planId
)
}
.
map
{
EstateScreenViewState
.
LoadPlan
(
it
)
}
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
fetchPlans
)
.
mergeWith
(
fetchPlan
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenViewState.kt
View file @
394e26c4
...
@@ -2,7 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.estate
...
@@ -2,7 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.estate
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.Plan
Type
Model
import
com.biganto.visual.roompark.domain.model.Plan
Preset
Model
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
/**
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.util.monades.ExceptionString
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.util.monades.ExceptionString
sealed
class
EstateScreenViewState
:
BigantoBaseViewState
()
{
sealed
class
EstateScreenViewState
:
BigantoBaseViewState
()
{
class
Idle
:
EstateScreenViewState
()
class
Idle
:
EstateScreenViewState
()
class
LoadEstate
(
val
estate
:
EstateModel
)
:
EstateScreenViewState
()
class
LoadEstate
(
val
estate
:
EstateModel
)
:
EstateScreenViewState
()
class
LoadPlanTypes
(
val
types
:
List
<
PlanTypeModel
>)
:
EstateScreenViewState
()
class
LoadPlanTypes
(
val
types
:
List
<
PlanPresetModel
>)
:
EstateScreenViewState
()
class
LoadPlan
(
val
planBody
:
String
)
:
EstateScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
EstateScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
EstateScreenViewState
()
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
394e26c4
...
@@ -70,8 +70,6 @@ class FeedsScreenController :
...
@@ -70,8 +70,6 @@ class FeedsScreenController :
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnNext
{
allFeedArticles
.
text
=
"ВСЕ ${allFeedName(it)} →"
}
.
doOnNext
{
allFeedArticles
.
text
=
"ВСЕ ${allFeedName(it)} →"
}
override
fun
injectDependencies
()
{
override
fun
injectDependencies
()
{
getComponent
()
getComponent
()
}
}
...
@@ -95,7 +93,6 @@ class FeedsScreenController :
...
@@ -95,7 +93,6 @@ class FeedsScreenController :
lateinit
var
allFeedArticles
:
MaterialButton
lateinit
var
allFeedArticles
:
MaterialButton
override
fun
requsetsNewArticles
()
=
override
fun
requsetsNewArticles
()
=
feedsRecyclerView
.
scrollStateChanges
()
feedsRecyclerView
.
scrollStateChanges
()
.
filter
{
it
==
RecyclerView
.
SCROLL_STATE_IDLE
}
.
filter
{
it
==
RecyclerView
.
SCROLL_STATE_IDLE
}
...
...
app/src/main/res/color/plantype_tab_background_selector.xml
deleted
100644 → 0
View file @
d5e2c26e
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_selected=
"true"
android:color=
"@color/colorAccent"
/>
<item
android:state_focused=
"true"
android:color=
"@color/colorAccent"
/>
<item
android:state_pressed=
"true"
android:color=
"@color/colorAccent"
/>
<item
android:color=
"@color/colorPrimary"
/>
</selector>
\ No newline at end of file
app/src/main/res/drawable/accent_selector_rectangle.xml
0 → 100644
View file @
394e26c4
<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/colorAccent"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/plantype_tab_background_selector.xml
0 → 100644
View file @
394e26c4
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_selected=
"true"
android:drawable=
"@drawable/accent_selector_rectangle"
/>
<item
android:state_focused=
"true"
android:drawable=
"@drawable/accent_selector_rectangle"
/>
<item
android:state_pressed=
"true"
android:drawable=
"@drawable/accent_selector_rectangle"
/>
<item
android:drawable=
"@drawable/primary_selector_rectangle"
/>
</selector>
\ No newline at end of file
app/src/main/res/drawable/primary_selector_rectangle.xml
0 → 100644
View file @
394e26c4
<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/colorPrimary"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/flat_full_card_screen.xml
View file @
394e26c4
...
@@ -13,13 +13,11 @@
...
@@ -13,13 +13,11 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<com.google.android.material.tabs.TabLayout
<com.google.android.material.tabs.TabLayout
android:id=
"@+id/planTypesTabs"
android:id=
"@+id/planTypesTabs"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:layout_marginTop=
"32dp"
android:background=
"#00000000"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
@@ -36,7 +34,7 @@
...
@@ -36,7 +34,7 @@
android:orientation=
"horizontal"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/
variants_choose_recycler_view
"
/>
app:layout_constraintTop_toBottomOf=
"@+id/
planTypesTabs
"
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/textView19"
android:id=
"@+id/textView19"
...
@@ -55,7 +53,7 @@
...
@@ -55,7 +53,7 @@
<WebView
<WebView
android:id=
"@+id/flat_plan_webview"
android:id=
"@+id/flat_plan_webview"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
200dp
"
android:layout_height=
"
wrap_content
"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
...
...
app/src/main/res/layout/select_text_tab.xml
View file @
394e26c4
...
@@ -4,8 +4,11 @@
...
@@ -4,8 +4,11 @@
style=
"@style/Accent_Minor_TextView.Tab"
style=
"@style/Accent_Minor_TextView.Tab"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"4dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingStart=
"8dp"
android:paddingTop=
"4dp"
android:paddingEnd=
"8dp"
android:paddingBottom=
"4dp"
android:text=
"Вариант 1"
>
android:text=
"Вариант 1"
>
</com.google.android.material.textview.MaterialTextView>
</com.google.android.material.textview.MaterialTextView>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
394e26c4
...
@@ -349,7 +349,7 @@
...
@@ -349,7 +349,7 @@
<style
name=
"Accent_Minor_TextView.Tab"
>
<style
name=
"Accent_Minor_TextView.Tab"
>
<item
name=
"android:textColor"
>
@color/plantype_tab_text_selector
</item>
<item
name=
"android:textColor"
>
@color/plantype_tab_text_selector
</item>
<item
name=
"android:background"
>
@
color
/plantype_tab_background_selector
</item>
<item
name=
"android:background"
>
@
drawable
/plantype_tab_background_selector
</item>
</style>
</style>
...
...
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