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
b9a650c5
Commit
b9a650c5
authored
Jan 21, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update strings
parent
59ed84a4
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
132 additions
and
77 deletions
+132
-77
RoomParkMainActivity.kt
.../com/biganto/visual/roompark/base/RoomParkMainActivity.kt
+0
-5
feeds.kt
...va/com/biganto/visual/roompark/domain/interactor/feeds.kt
+1
-0
DealPreviewModel.kt
.../biganto/visual/roompark/domain/model/DealPreviewModel.kt
+58
-0
deals.kt
...in/java/com/biganto/visual/roompark/domain/model/deals.kt
+18
-0
estateUseCase.kt
.../biganto/visual/roompark/domain/use_case/estateUseCase.kt
+1
-1
ScreenContract.kt
...sual/roompark/presentation/screen/deals/ScreenContract.kt
+0
-35
ScreenPresenter.kt
...ual/roompark/presentation/screen/deals/ScreenPresenter.kt
+6
-1
ScreenViewState.kt
...ual/roompark/presentation/screen/deals/ScreenViewState.kt
+1
-0
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+6
-4
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+8
-0
FavoritesAdapter.kt
...rk/presentation/screen/favorites/util/FavoritesAdapter.kt
+10
-17
feeds_screen.xml
app/src/main/res/layout/feeds_screen.xml
+14
-13
switch_toolbar.xml
app/src/main/res/layout/switch_toolbar.xml
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+8
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/base/RoomParkMainActivity.kt
View file @
b9a650c5
...
...
@@ -91,10 +91,6 @@ class RoomParkMainActivity(
headerToolbar
.
setGone
(
header
==
null
)
statusToolbar
.
setGone
(
status
==
null
)
header
?.
let
{
Timber
.
d
(
"bb: ${it.backButton}"
)
Timber
.
d
(
"bt: ${it.backTitle}"
)
Timber
.
d
(
"itTitle: ${it.title}"
)
Timber
.
d
(
"switcher: ${it.switcher} - ${it.switcher?:false}"
)
headerToolbarBack
.
setGone
(!
it
.
backButton
)
headerToolbarBack
.
text
=
it
.
backTitle
?:
""
headerToolbar
.
findViewById
<
MaterialTextView
>(
R
.
id
.
toolbar_title
).
text
=
it
.
title
?:
""
...
...
@@ -102,7 +98,6 @@ class RoomParkMainActivity(
}
status
?.
let
{
Timber
.
d
(
" inda status"
)
statusToolbar
.
status_icon
.
setGone
(
it
.
state
==
null
)
statusToolbar
.
status_title
.
setGone
(
it
.
state
==
null
)
it
.
state
?.
let
{
state
->
...
...
app/src/main/java/com/biganto/visual/roompark/domain/interactor/feeds.kt
View file @
b9a650c5
...
...
@@ -32,6 +32,7 @@ class FeedsInteractor @Inject constructor(
// else -> error("unknown feedId")
// }
// )
fun
fetchArticles
(
feedAlias
:
String
,
pageSize
:
Int
,
startIndex
:
Int
):
Observable
<
ArticlesPreviewModel
>
=
feedsUseCase
.
fetchArticlesPage
(
feedAlias
,
pageSize
,
startIndex
)
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/DealPreviewModel.kt
0 → 100644
View file @
b9a650c5
package
com.biganto.visual.roompark.domain.model
import
androidx.annotation.StringRes
import
com.biganto.visual.roompark.R
data class
DealPreviewModel
(
val
id
:
String
,
val
type
:
String
,
val
name
:
String
,
val
building
:
Int
?,
val
section
:
Int
?,
val
floor
:
Int
?,
val
area
:
Float
?,
val
statusNo
:
Int
,
val
dealSum
:
Int
,
val
dealPayout
:
Int
,
val
dealToPay
:
Int
,
val
dealTourIds
:
List
<
Int
?>?,
val
isViewed
:
Boolean
=
true
,
val
statusList
:
List
<
StatusModel
>
){
constructor
(
data
:
Pair
<
DealModel
,
List
<
StatusModel
>>)
:
this
(
data
.
first
.
id
,
data
.
first
.
estate
.
type
,
data
.
first
.
estate
.
number
,
data
.
first
.
estate
.
commonInfo
?.
building
,
data
.
first
.
estate
.
commonInfo
?.
section_begin
,
data
.
first
.
estate
.
commonInfo
?.
floor
,
data
.
first
.
estate
.
commonInfo
?.
area
,
data
.
first
.
statusId
,
data
.
first
.
opportunitySum
,
data
.
first
.
paymentSum
,
data
.
first
.
amount_pay_sum
,
arrayListOf
<
Int
?>(
data
.
first
.
estate
.
multitourId
),
false
,
data
.
second
)
}
@StringRes
fun
DealPreviewModel
.
typeDoubleString
()
=
when
(
this
.
type
){
"flat"
->
R
.
string
.
estate_type_flat_long
"parking"
->
R
.
string
.
estate_type_parking_long
"storage"
->
R
.
string
.
estate_type_store_long
else
->
R
.
string
.
estate_type_other_long
}
@StringRes
fun
DealPreviewModel
.
typeShortString
()
=
when
(
this
.
type
){
"flat"
->
R
.
string
.
estate_type_flat_short
"parking"
->
R
.
string
.
estate_type_parking_short
"storage"
->
R
.
string
.
estate_type_store_short
else
->
R
.
string
.
estate_type_other_short
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/model/deals.kt
View file @
b9a650c5
package
com.biganto.visual.roompark.domain.model
import
androidx.annotation.StringRes
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.data.repository.db.requrey.model.DealEntity
import
com.biganto.visual.roompark.data.repository.db.requrey.model.EstateEntity
import
com.biganto.visual.roompark.data.repository.db.requrey.model.ExplicationEntity
...
...
@@ -58,6 +60,22 @@ data class EstateModel(
val
url
:
String
?
)
@StringRes
fun
EstateModel
.
typeDoubleString
()
=
when
(
this
.
type
){
"flat"
->
R
.
string
.
estate_type_flat_long
"parking"
->
R
.
string
.
estate_type_parking_long
"storage"
->
R
.
string
.
estate_type_store_long
else
->
R
.
string
.
estate_type_other_long
}
@StringRes
fun
EstateModel
.
typeShortString
()
=
when
(
this
.
type
){
"flat"
->
R
.
string
.
estate_type_flat_short
"parking"
->
R
.
string
.
estate_type_parking_short
"storage"
->
R
.
string
.
estate_type_store_short
else
->
R
.
string
.
estate_type_other_short
}
fun
fromEntity
(
entity
:
EstateEntity
):
EstateModel
{
val
model
=
EstateModel
(
id
=
entity
.
id
,
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/estateUseCase.kt
View file @
b9a650c5
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenContract.kt
View file @
b9a650c5
package
com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBaseContract
import
com.biganto.visual.roompark.domain.model.DealModel
import
com.biganto.visual.roompark.domain.model.StatusModel
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
...
...
@@ -12,36 +10,3 @@ interface DealsScreen : BigantoBaseContract<DealsScreenViewState> {
}
data class
DealPreviewModel
(
val
id
:
String
,
val
type
:
String
,
val
name
:
String
,
val
building
:
Int
?,
val
section
:
Int
?,
val
floor
:
Int
?,
val
area
:
Float
?,
val
statusNo
:
Int
,
val
dealSum
:
Int
,
val
dealPayout
:
Int
,
val
dealToPay
:
Int
,
val
dealTourIds
:
List
<
Int
?>?,
val
isViewed
:
Boolean
=
true
,
val
statusList
:
List
<
StatusModel
>
){
constructor
(
data
:
Pair
<
DealModel
,
List
<
StatusModel
>>)
:
this
(
data
.
first
.
id
,
data
.
first
.
estate
.
type
,
data
.
first
.
estate
.
number
,
data
.
first
.
estate
.
commonInfo
?.
building
,
data
.
first
.
estate
.
commonInfo
?.
section_begin
,
data
.
first
.
estate
.
commonInfo
?.
floor
,
data
.
first
.
estate
.
commonInfo
?.
area
,
data
.
first
.
statusId
,
data
.
first
.
opportunitySum
,
data
.
first
.
paymentSum
,
data
.
first
.
amount_pay_sum
,
arrayListOf
<
Int
?>(
data
.
first
.
estate
.
multitourId
),
false
,
data
.
second
)
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenPresenter.kt
View file @
b9a650c5
...
...
@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBasePresenter
import
com.biganto.visual.roompark.domain.interactor.DealsInteractor
import
com.biganto.visual.roompark.domain.model.DealPreviewModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
...
...
@@ -28,7 +29,11 @@ class DealsScreenPresenter @Inject constructor(
val
fetchDeals
=
interactor
.
fetchDeals
()
.
flatMap
{
deals
->
getStatusList
.
map
{
List
(
deals
.
size
)
{
index
->
DealPreviewModel
(
Pair
(
deals
[
index
],
it
))
}
}
.
map
{
List
(
deals
.
size
)
{
index
->
DealPreviewModel
(
Pair
(
deals
[
index
],
it
)
)
}
}
}
.
map
(
DealsScreenViewState
::
DealsLoaded
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenViewState.kt
View file @
b9a650c5
package
com.biganto.visual.roompark.presentation.screen.deals
import
com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.DealPreviewModel
import
com.biganto.visual.roompark.util.monades.ExceptionString
/**
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
b9a650c5
...
...
@@ -9,8 +9,9 @@ import android.widget.TextView
import
butterknife.BindView
import
butterknife.ButterKnife
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.DealPreviewModel
import
com.biganto.visual.roompark.domain.model.StatusModel
import
com.biganto.visual.roompark.
presentation.screen.deals.DealPreviewModel
import
com.biganto.visual.roompark.
domain.model.typeDoubleString
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
...
...
@@ -22,7 +23,7 @@ import com.google.android.material.textview.MaterialTextView
* Created by Vladislav Bogdashkin on 16.10.2019.
*/
class
DealsListAdapter
:
CommonRecyclerAdapter
<
DealViewHolder
,
DealPreviewModel
>()
{
class
DealsListAdapter
:
CommonRecyclerAdapter
<
DealViewHolder
,
DealPreviewModel
>()
{
override
val
vhKlazz
=
DealViewHolder
::
class
override
fun
getVhLayout
()
=
R
.
layout
.
deal_card_viewholder
}
...
...
@@ -62,7 +63,8 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
override
fun
onViewBound
(
model
:
DealPreviewModel
)
{
val
fullObjName
=
"${typeName(model.type)}\n№${model.name}"
estateTitle
.
text
=
fullObjName
estateTitle
.
text
=
itemView
.
context
.
resources
?.
getString
(
model
.
typeDoubleString
(),
model
.
name
)
renderCommonInfo
(
model
)
if
(
model
.
dealTourIds
.
isNullOrEmpty
())
startTour
.
visibility
=
View
.
GONE
...
...
@@ -82,7 +84,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
statusLayout
.
invalidate
()
}
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
private
fun
renderCommonInfo
(
info
:
DealPreviewModel
){
if
(
info
.
building
==
null
)
info1
.
visibility
=
View
.
GONE
else
{
info1
.
title
().
text
=
"Корпус"
;
info1
.
text
().
text
=
info
.
building
.
toString
()}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
b9a650c5
...
...
@@ -18,6 +18,7 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.domain.model.FeatureModel
import
com.biganto.visual.roompark.domain.model.PlanPresetModel
import
com.biganto.visual.roompark.domain.model.typeShortString
import
com.biganto.visual.roompark.presentation.screen.estate.util.FlatInfoAdapter
import
com.google.android.material.switchmaterial.SwitchMaterial
import
com.google.android.material.tabs.TabLayout
...
...
@@ -205,10 +206,17 @@ class EstateScreenController :
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadEstate
)
{
toolBar
.
setToolbar
(
HeaderToolbarModel
(
true
,
null
,
resources
?.
getString
(
viewState
.
estate
.
typeShortString
(),
viewState
.
estate
.
number
)
,
null
)
)
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
ShowEstateInfo
)
{
(
flatInfoRecyclerView
.
adapter
as
FlatInfoAdapter
).
setItems
(
viewState
.
info
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/util/FavoritesAdapter.kt
View file @
b9a650c5
...
...
@@ -7,8 +7,10 @@ import butterknife.ButterKnife
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.CommonInfoModel
import
com.biganto.visual.roompark.domain.model.EstateModel
import
com.biganto.visual.roompark.domain.model.typeDoubleString
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.setGone
/**
* Created by Vladislav Bogdashkin on 16.10.2019.
...
...
@@ -35,25 +37,17 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
@BindView
(
R
.
id
.
info_ceil_7
)
lateinit
var
info7
:
View
@BindView
(
R
.
id
.
info_ceil_8
)
lateinit
var
info8
:
View
fun
typeName
(
type
:
String
)
=
when
(
type
){
"flat"
->
"КВАРТИРА"
"parking"
->
"МАШИНОМЕСТО"
"storage"
->
"КЛАДОВКА"
else
->
"ОБЪЕКТ"
}
init
{
ButterKnife
.
bind
(
this
,
itemView
)
}
override
fun
onViewBound
(
model
:
EstateModel
)
{
val
fullObjName
=
"${typeName(model.type)}\n${model.number}"
estateTitle
.
text
=
fullObjName
if
(
model
.
commonInfo
==
null
)
commonInfo
.
visibility
=
View
.
GONE
else
{
commonInfo
.
visibility
=
View
.
VISIBLE
;
renderCommonInfo
(
model
.
commonInfo
)}
estateTitle
.
text
=
itemView
.
context
.
resources
?.
getString
(
model
.
typeDoubleString
(),
model
.
number
)
commonInfo
.
setGone
(
model
.
commonInfo
==
null
)
model
.
commonInfo
?.
let
{
renderCommonInfo
(
it
)}
if
(
model
.
type
==
"flat"
)
startTour
.
visibility
=
View
.
VISIBLE
else
startTour
.
visibility
=
View
.
GONE
startTour
.
setGone
(
model
.
type
!=
"flat"
)
}
private
fun
renderCommonInfo
(
info
:
CommonInfoModel
){
...
...
@@ -71,10 +65,10 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
else
{
info4
.
title
().
text
=
"Общая, м²"
;
info4
.
text
().
text
=
info
.
area
.
toString
()}
if
(
info
.
price_meter
==
null
)
info1
.
visibility
=
View
.
GONE
else
{
info5
.
title
().
text
=
"Цена за м²"
;
info5
.
text
().
text
=
info
.
price_meter
.
toRubl
y
()}
else
{
info5
.
title
().
text
=
"Цена за м²"
;
info5
.
text
().
text
=
info
.
price_meter
.
toRubl
es
()}
if
(
info
.
price
==
null
)
info1
.
visibility
=
View
.
GONE
else
{
info6
.
title
().
text
=
"Стоимость"
;
info6
.
text
().
text
=
info
.
price
.
toRubl
y
()}
else
{
info6
.
title
().
text
=
"Стоимость"
;
info6
.
text
().
text
=
info
.
price
.
toRubl
es
()}
if
(
true
)
info7
.
visibility
=
View
.
GONE
else
{
info7
.
title
().
text
=
"вщщ"
;
info7
.
text
().
text
=
info
.
building
.
toString
()}
...
...
@@ -86,8 +80,7 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
private
fun
View
.
title
()
=
this
.
findViewById
<
TextView
>(
R
.
id
.
info_ceil_header
)
private
fun
View
.
text
()
=
this
.
findViewById
<
TextView
>(
R
.
id
.
info_ceil_content
)
private
fun
Int
.
toRubly
():
String
{
private
fun
Int
.
toRubles
():
String
{
return
String
.
format
(
"%,d \u20BD"
,
this
).
replace
(
','
,
' '
)
}
...
...
app/src/main/res/layout/feeds_screen.xml
View file @
b9a650c5
...
...
@@ -14,6 +14,7 @@
<include
android:id=
"@+id/feedsBlock"
layout=
"@layout/feeds_block_view"
android:layout_height=
"426dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
@@ -24,10 +25,10 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"24dp"
android:layout_marginEnd=
"16dp"
android:text=
"ХОД\nСТРОИТЕЛЬСТВА"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/feedsBlock"
/>
...
...
@@ -55,5 +56,5 @@
app:layout_constraintTop_toBottomOf=
"@+id/dev_progress_recycler_view"
tools:listitem=
"@layout/cam_button_viewholder"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
app/src/main/res/layout/switch_toolbar.xml
View file @
b9a650c5
...
...
@@ -31,7 +31,7 @@
android:layout_marginStart=
"16dp"
android:fitsSystemWindows=
"true"
android:gravity=
"start|center_vertical"
android:text=
"НОВОСТИ"
android:text=
"НОВОСТИ
\nИРКУТСКА
"
android:textAlignment=
"gravity"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
app/src/main/res/values/strings.xml
View file @
b9a650c5
...
...
@@ -81,6 +81,14 @@
<string
name=
"deal_back_chevron_title"
>
МОИ\nСДЕЛКИ
</string>
<string
name=
"news_header"
>
НОВОСТИ
</string>
<string
name=
"blog_header"
>
БЛОГ
</string>
<string
name=
"estate_type_flat_long"
>
КВАРТИРА\n№%s
</string>
<string
name=
"estate_type_parking_long"
>
МАШИНОМЕСТО\n%s
</string>
<string
name=
"estate_type_store_long"
>
КЛАДОВКА\n%s
</string>
<string
name=
"estate_type_other_long"
>
ОБЪЕКТ\n%s
</string>
<string
name=
"estate_type_flat_short"
>
кв.№%s
</string>
<string
name=
"estate_type_parking_short"
>
м\\м %s
</string>
<string
name=
"estate_type_store_short"
>
кл.%s
</string>
<string
name=
"estate_type_other_short"
>
об.%s
</string>
<!--endregion-->
</resources>
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