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
4955bcd8
Commit
4955bcd8
authored
Jan 09, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove redundant code
parent
bcdc9ac3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
33 deletions
+1
-33
ScreenController.kt
...l/roompark/presentation/screen/estate/ScreenController.kt
+1
-33
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/estate/ScreenController.kt
View file @
4955bcd8
...
@@ -16,8 +16,6 @@ import com.jakewharton.rxbinding3.material.selections
...
@@ -16,8 +16,6 @@ import com.jakewharton.rxbinding3.material.selections
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
timber.log.Timber
import
timber.log.Timber
import
java.io.BufferedReader
import
java.io.InputStreamReader
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
import
javax.inject.Inject
import
javax.inject.Inject
...
@@ -124,40 +122,10 @@ class EstateScreenController :
...
@@ -124,40 +122,10 @@ class EstateScreenController :
}
}
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlan
)
{
private
fun
render
(
viewState
:
EstateScreenViewState
.
LoadPlan
)
{
// val mimeTypeSvg = "image/svg+xml"
val
mimeTypeSvg
=
"text/html"
val
encoding
=
"utf-8"
// viewState.planBody.replace("<br>","<br />")
// viewState.planBody.replace("<\\br>","<br />")
// Timber.w("counts br : ${})
planWebView
.
settings
.
javaScriptEnabled
=
true
planWebView
.
settings
.
javaScriptEnabled
=
true
planWebView
.
clearCache
(
true
)
planWebView
.
clearCache
(
true
)
// planWebView.loadUrl("https://room-park.ru/choose/flat/2/1/74/")
val
svgStream
=
resources
?.
openRawResource
(
R
.
raw
.
flat_plan_test
)
val
inputStreamReader
=
InputStreamReader
(
svgStream
!!
)
val
sb
=
StringBuilder
()
var
line
:
String
?
val
br
=
BufferedReader
(
inputStreamReader
)
line
=
br
.
readLine
()
while
(
line
!=
null
)
{
sb
.
append
(
line
)
line
=
br
.
readLine
()
}
br
.
close
()
var
svgBody
:
String
=
sb
.
toString
()
Timber
.
d
(
"ulr : ${viewState.planBody}"
)
val
uri
=
"file:///${Uri.parse(viewState.planBody).path}"
val
uri
=
"file:///${Uri.parse(viewState.planBody).path}"
Timber
.
d
(
"uri: ${uri}"
)
planWebView
.
loadUrl
(
uri
)
svgBody
=
"https://room-park.ru/api/estates.getPlan?&client=androidplayer&client_version=3.0&v=2.0&estate_id=4902&plan_id=0&furniture=0&sizes=0&walls=0&electric=0"
svgBody
=
uri
planWebView
.
loadUrl
(
svgBody
)
// planWebView.loadUrl("https://room-park.ru/api/estates.getPlan?&client=androidplayer&client_version=3.0&v=2.0&estate_id=4009&plan_id=1&furniture=1&sizes=0&walls=0&electric=1")
// planWebView.loadDataWithBaseURL(
// "",viewState.planBody,mimeTypeSvg,encoding,null
// )
// planWebView.load(svgBody,mimeTypeSvg,encoding)
}
}
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
private
fun
getComponent
()
=
DaggerEstateScreenComponent
.
factory
()
...
...
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