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
0845fa5b
Commit
0845fa5b
authored
Apr 03, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
downloader screen; default
parent
53f4fbc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
2 deletions
+50
-2
DownloadTourDialogController.kt
...ctor/dialogs/tour_chooser/DownloadTourDialogController.kt
+50
-2
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/DownloadTourDialogController.kt
View file @
0845fa5b
package
com.biganto.visual.roompark.conductor.dialogs.tour_chooser
import
android.content.Context
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
...
...
@@ -10,14 +11,23 @@ import android.widget.TextView
import
androidx.annotation.LayoutRes
import
androidx.core.os.bundleOf
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.interactor.ToursInteractor
import
com.biganto.visual.roompark.domain.model.TourModel
import
com.biganto.visual.roompark.domain.use_case.DownloadUseCase
import
com.biganto.visual.roomparkvr.data.repository.db.requery.model.TourPreviewEntity
import
com.bluelinelabs.conductor.Controller
import
com.bumptech.glide.Glide
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
import
dagger.Module
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.schedulers.Schedulers
import
jp.wasabeef.glide.transformations.BlurTransformation
import
jp.wasabeef.glide.transformations.ColorFilterTransformation
import
timber.log.Timber
...
...
@@ -42,6 +52,14 @@ class DownloadTourDialogController : Controller {
lateinit
var
downloadTourTitleText
:
TextView
lateinit
var
cancelDownloadText
:
TextView
override
fun
onContextAvailable
(
context
:
Context
)
{
super
.
onContextAvailable
(
context
)
DaggerDownloaderScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
}
private
val
tour
:
TourModel
by
lazy
{
args
.
getParcelable
<
TourModel
>(
DOWNLOAD_TOUR_ID_KEY
)
}
...
...
@@ -82,6 +100,7 @@ class DownloadTourDialogController : Controller {
downloader
.
downloadTour
(
tour
.
tour_id
,
downloadToken
)
.
onErrorReturn
{
Timber
.
e
(
it
);
TourPreviewEntity
()
}
// .onErrorReturn { parseError(it);TourPreviewEntity() }
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
{
model
->
...
...
@@ -100,7 +119,7 @@ class DownloadTourDialogController : Controller {
))
// downloadTour(it.tour.tour_id, downloadToken)
view
.
findViewById
<
View
>(
R
.
id
.
close_current_button
).
setOnClickListener
{
handleBack
()
}
//
view.findViewById<View>(R.id.close_current_button).setOnClickListener { handleBack() }
return
view
}
...
...
@@ -115,7 +134,7 @@ class DownloadTourDialogController : Controller {
}
@LayoutRes
fun
getLayoutId
()
=
R
.
layout
.
photo_viewer
fun
getLayoutId
()
=
R
.
layout
.
download_tour_layout
override
fun
handleBack
():
Boolean
{
return
router
.
popCurrentController
()
...
...
@@ -123,3 +142,32 @@ class DownloadTourDialogController : Controller {
}
@PerScreen
@Component
(
modules
=
[
DownloaderScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
interface
DownloaderScreenComponent
{
@Component
.
Factory
interface
Factory
{
fun
create
(
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
):
DownloaderScreenComponent
}
//
// val presenter: ArticlesScreenPresenter
fun
inject
(
controller
:
DownloadTourDialogController
)
}
@Module
abstract
class
DownloaderScreenModule
{
@PerScreen
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
}
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