Commit 4955bcd8 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

remove redundant code

parent bcdc9ac3
...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment