Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
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
0e5dd9ee
Commit
0e5dd9ee
authored
Aug 24, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix switcher && walls-furniture condition
parent
ffdb56e4
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
120 additions
and
19 deletions
+120
-19
Project.xml
.idea/codeStyles/Project.xml
+0
-3
misc.xml
.idea/misc.xml
+1
-1
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+15
-3
ScreenPresenter.kt
...al/roompark/presentation/screen/estate/ScreenPresenter.kt
+9
-2
bell_switch_track.xml
app/src/main/res/drawable/bell_switch_track.xml
+22
-0
bell_switch_track_tint.xml
app/src/main/res/drawable/bell_switch_track_tint.xml
+1
-1
switch_track.xml
app/src/main/res/drawable/switch_track.xml
+40
-0
bell_switch_view.xml
app/src/main/res/layout/bell_switch_view.xml
+1
-0
flat_plan_type_selector_view.xml
app/src/main/res/layout/flat_plan_type_selector_view.xml
+4
-4
switch_view.xml
app/src/main/res/layout/switch_view.xml
+17
-0
styles.xml
app/src/main/res/values-v23/styles.xml
+1
-3
styles.xml
app/src/main/res/values/styles.xml
+9
-2
No files found.
.idea/codeStyles/Project.xml
View file @
0e5dd9ee
<component
name=
"ProjectCodeStyleConfiguration"
>
<code_scheme
name=
"Project"
version=
"173"
>
<AndroidXmlCodeStyleSettings>
<option
name=
"ARRANGEMENT_SETTINGS_MIGRATED_TO_191"
value=
"true"
/>
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option
name=
"CODE_STYLE_DEFAULTS"
value=
"KOTLIN_OFFICIAL"
/>
</JetCodeStyleSettings>
...
...
.idea/misc.xml
View file @
0e5dd9ee
...
...
@@ -148,7 +148,7 @@
</profile-state>
</entry>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
0e5dd9ee
...
...
@@ -91,7 +91,6 @@ class EstateScreenController :
override
fun
switchElectric
():
Observable
<
Pair
<
Int
,
Boolean
>>
=
electricSwitcher
.
switchMatch
()
override
fun
planTypesTabSelected
():
Observable
<
Int
>
=
planTypesTabLayout
.
selections
()
.
debounce
(
200L
,
TimeUnit
.
MILLISECONDS
)
...
...
@@ -238,6 +237,11 @@ class EstateScreenController :
bottomNavigationController
.
hide
()
setToolbar
()
bindRecycler
()
detachDisposable
.
add
(
furnSwitcher
.
clicks
()
.
filter
{
!
furnSwitcher
.
isEnabled
}
.
subscribe
{
snackbar
.
showSnackBar
(
"Мебелировка не доступна"
)
}
)
}
override
fun
render
(
viewState
:
EstateScreenViewState
)
{
...
...
@@ -343,8 +347,16 @@ class EstateScreenController :
is
FeatureModel
.
Furniture
->
{
furnContainer
.
setGone
(
false
)
furnTitle
.
text
=
it
.
featureTitle
furnSwitcher
.
findViewById
<
SwitchMaterial
>(
R
.
id
.
switch1
).
isChecked
=
it
.
switchedOn
val
fSwitcher
=
furnSwitcher
.
findViewById
<
SwitchMaterial
>(
R
.
id
.
switch1
)
fSwitcher
.
isChecked
=
it
.
switchedOn
// val fSwitcher = furnSwitcher.findViewById<SwitchMaterial>(R.id.switch1)
val
wls
=
plan
.
features
.
firstOrNull
{
feature
->
feature
is
FeatureModel
.
Walls
}
?.
switchedOn
fSwitcher
.
isEnabled
=
wls
?:
true
furnitureDivider
.
setGone
(
false
)
}
is
FeatureModel
.
Walls
->{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenPresenter.kt
View file @
0e5dd9ee
...
...
@@ -40,6 +40,11 @@ class EstateScreenPresenter @Inject constructor(
private
fun
getPlan
(
plan
:
PlanPresetModel
):
Observable
<
EstateScreenViewState
>
=
interactor
.
getPlan
(
plan
)
.
map
<
EstateScreenViewState
>
{
EstateScreenViewState
.
LoadPlan
(
it
)
}
.
startWith
(
Observable
.
just
<
EstateScreenViewState
>(
EstateScreenViewState
.
PlanTypeSelected
(
plan
)
)
)
override
fun
bindIntents
()
{
...
...
@@ -53,17 +58,18 @@ class EstateScreenPresenter @Inject constructor(
val
fetchPlan
=
intent
(
EstateScreen
::
planTypesTabSelected
)
.
map
{
planList
?.
get
(
it
)
}
.
flatMap
{
planPreset
->
.
flatMap
{
planPreset
->
interactor
.
getPlan
(
planPreset
)
.
map
<
EstateScreenViewState
>
{
plan
->
EstateScreenViewState
.
LoadPlan
(
plan
)
}
.
startWith
(
Observable
.
just
<
EstateScreenViewState
>(
EstateScreenViewState
.
PlanTypeSelected
(
planPreset
)
)
)
.
startWith
(
Observable
.
just
<
EstateScreenViewState
>(
EstateScreenViewState
.
ShowEstateInfo
(
showType
,
if
(
showType
==
InfoShowType
.
COMMON_INFO
)
...
...
@@ -74,6 +80,7 @@ class EstateScreenPresenter @Inject constructor(
)
}
val
switchSizes
=
intent
(
EstateScreen
::
switchSizes
)
.
map
{
pair
->
val
plan
=
planList
?.
first
{
it
.
planId
==
pair
.
first
}
...
...
app/src/main/res/drawable/bell_switch_track.xml
View file @
0e5dd9ee
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:width=
"http://schemas.android.com/apk/res-auto"
>
<item
android:state_enabled=
"false"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
<item
android:right=
"8dp"
>
<bitmap
android:width=
"14dp"
android:height=
"15dp"
android:src=
"@drawable/ic_bell_off"
android:tintMode=
"multiply"
android:gravity=
"end"
android:tint=
"@color/colorPrimaryDark"
/>
</item>
</layer-list>
</item>
<item
android:state_checked=
"false"
>
<layer-list>
<item>
...
...
app/src/main/res/drawable/bell_switch_track_tint.xml
View file @
0e5dd9ee
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_enabled=
"false"
android:color=
"@color/color
Accent
"
>
android:color=
"@color/color
OpacityBackgroundInv
"
>
</item>
<item
android:state_checked=
"true"
android:color=
"@color/colorAccent"
>
...
...
app/src/main/res/drawable/switch_track.xml
0 → 100644
View file @
0e5dd9ee
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:width=
"http://schemas.android.com/apk/res-auto"
>
<item
android:state_enabled=
"false"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
</layer-list>
</item>
<item
android:state_checked=
"false"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
</layer-list>
</item>
<item
android:state_checked=
"true"
>
<layer-list>
<item>
<shape
android:shape=
"rectangle"
android:dither=
"true"
android:useLevel=
"false"
>
<size
android:width=
"48dp"
android:height=
"24dp"
/>
<solid
android:color=
"#FFFFFFFF"
/>
<corners
android:radius=
"12dp"
/>
</shape>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
app/src/main/res/layout/bell_switch_view.xml
View file @
0e5dd9ee
...
...
@@ -8,6 +8,7 @@
<com.google.android.material.switchmaterial.SwitchMaterial
android:id=
"@+id/switch1"
style=
"@style/BellSwitchStyle"
android:layout_width=
"48dp"
android:layout_height=
"24dp"
android:height=
"24dp"
...
...
app/src/main/res/layout/flat_plan_type_selector_view.xml
View file @
0e5dd9ee
...
...
@@ -97,7 +97,7 @@
<include
android:id=
"@+id/sizes_switcher"
layout=
"@layout/
bell_
switch_view"
layout=
"@layout/switch_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|center_vertical"
...
...
@@ -140,7 +140,7 @@
<include
android:id=
"@+id/furniture_switcher"
layout=
"@layout/
bell_
switch_view"
layout=
"@layout/switch_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|center_vertical"
...
...
@@ -183,7 +183,7 @@
<include
android:id=
"@+id/electricity_switcher"
layout=
"@layout/
bell_
switch_view"
layout=
"@layout/switch_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|center_vertical"
...
...
@@ -227,7 +227,7 @@
<include
android:id=
"@+id/walls_switcher"
layout=
"@layout/
bell_
switch_view"
layout=
"@layout/switch_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|center_vertical"
...
...
app/src/main/res/layout/switch_view.xml
0 → 100644
View file @
0e5dd9ee
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/bell_container"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id=
"@+id/switch1"
android:layout_width=
"48dp"
android:layout_height=
"24dp"
android:height=
"24dp"
android:checked=
"false"
app:switchMinWidth=
"48dp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values-v23/styles.xml
View file @
0e5dd9ee
...
...
@@ -10,9 +10,7 @@
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"materialCardViewStyle"
>
@style/Widget.Biganto.MaterialCardView
</item>
<item
name=
"switchStyle"
>
@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle
</item>
<item
name=
"switchStyle"
>
@style/Widget.MaterialComponents.CompoundButton.Switch.AccentSwitch
</item>
<item
name=
"colorControlActivated"
>
@color/colorAccent
</item>
<item
name=
"colorControlHighlight"
>
@color/colorAccent
</item>
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
...
...
app/src/main/res/values/styles.xml
View file @
0e5dd9ee
...
...
@@ -10,7 +10,7 @@
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"materialCardViewStyle"
>
@style/Widget.Biganto.MaterialCardView
</item>
<item
name=
"switchStyle"
>
@style/Widget.MaterialComponents.CompoundButton.Switch.
BellSwitchStyle
</item>
<item
name=
"switchStyle"
>
@style/Widget.MaterialComponents.CompoundButton.Switch.
AccentSwitch
</item>
<item
name=
"colorControlActivated"
>
@color/colorAccent
</item>
<item
name=
"colorControlHighlight"
>
@color/colorAccent
</item>
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
...
...
@@ -25,13 +25,20 @@
<item
name=
"android:windowBackground"
>
@color/colorAccent
</item>
</style>
<style
name=
"
Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle"
>
<style
name=
"
BellSwitchStyle"
parent=
"Widget.MaterialComponents.CompoundButton.Switch"
>
<item
name=
"track"
>
@drawable/bell_switch_track
</item>
<item
name=
"android:thumb"
>
@drawable/bell_switcher
</item>
<item
name=
"thumbTint"
>
@color/colorPrimaryDark
</item>
<item
name=
"trackTint"
>
@drawable/bell_switch_track_tint
</item>
</style>
<style
name=
"Widget.MaterialComponents.CompoundButton.Switch.AccentSwitch"
>
<item
name=
"track"
>
@drawable/switch_track
</item>
<item
name=
"android:thumb"
>
@drawable/bell_switcher
</item>
<item
name=
"thumbTint"
>
@color/colorPrimaryDark
</item>
<item
name=
"trackTint"
>
@drawable/bell_switch_track_tint
</item>
</style>
<style
name=
"Widget.Biganto.MaterialCardView"
parent=
"Widget.MaterialComponents.CardView"
>
<item
name=
"cardUseCompatPadding"
>
false
</item>
<item
name=
"strokeWidth"
>
0dp
</item>
...
...
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