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
d9a1127f
Commit
d9a1127f
authored
Apr 22, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fatals
parent
95e93ea2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
26 deletions
+15
-26
StartToursDownloadingDialogController.kt
...ogs/tour_chooser/StartToursDownloadingDialogController.kt
+6
-17
ScreenContract.kt
...l/roompark/presentation/screen/settings/ScreenContract.kt
+1
-1
ScreenController.kt
...roompark/presentation/screen/settings/ScreenController.kt
+3
-3
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+5
-5
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/StartToursDownloadingDialogController.kt
View file @
d9a1127f
...
@@ -8,30 +8,18 @@ import android.view.ViewGroup
...
@@ -8,30 +8,18 @@ import android.view.ViewGroup
import
android.widget.Button
import
android.widget.Button
import
android.widget.ImageView
import
android.widget.ImageView
import
androidx.annotation.LayoutRes
import
androidx.annotation.LayoutRes
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.BaseRoomParkActivity
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.data.repository.file.FileModule
import
com.biganto.visual.roompark.di.dagger.ActivityModule
import
com.biganto.visual.roompark.di.dagger.ActivityModule
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import
com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import
com.biganto.visual.roompark.domain.model.TourModel
import
com.biganto.visual.roompark.domain.model.bytesToSize
import
com.biganto.visual.roompark.domain.model.bytesToSize
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
import
com.biganto.visual.roompark.util.view_utils.snackbar.ISnackBarProvider
import
com.biganto.visual.roompark.util.view_utils.snackbar.ISnackBarProvider
import
com.biganto.visual.roomparkvr.data.repository.db.requery.model.DownloadState
import
com.bluelinelabs.conductor.Controller
import
com.bluelinelabs.conductor.Controller
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.view.clicks
import
com.jakewharton.rxbinding3.view.clicks
import
dagger.Binds
import
dagger.Binds
...
@@ -104,7 +92,7 @@ class StartToursDownloadingDialogController : Controller {
...
@@ -104,7 +92,7 @@ class StartToursDownloadingDialogController : Controller {
view
.
findViewById
<
Button
>(
R
.
id
.
alert_dismiss_button
)
view
.
findViewById
<
Button
>(
R
.
id
.
alert_dismiss_button
)
.
setOnClickListener
{
handleBack
()
}
.
setOnClickListener
{
handleBack
()
}
view
.
findViewById
<
Button
>(
R
.
id
.
close_current_button
)
view
.
findViewById
<
ImageView
>(
R
.
id
.
close_current_button
)
.
setOnClickListener
{
handleBack
()
}
.
setOnClickListener
{
handleBack
()
}
detachDisposable
.
add
(
detachDisposable
.
add
(
...
@@ -143,14 +131,14 @@ class StartToursDownloadingDialogController : Controller {
...
@@ -143,14 +131,14 @@ class StartToursDownloadingDialogController : Controller {
@Component
(
@Component
(
modules
=
[
StartToursDownloadingDialogScreenModule
::
class
],
modules
=
[
StartToursDownloadingDialogScreenModule
::
class
],
dependencies
=
[
AppComponent
::
class
])
dependencies
=
[
AppComponent
::
class
])
interface
StartToursDownloadingDialogComponent
{
interface
StartToursDownloadingDialog
Screen
Component
{
@Component
.
Factory
@Component
.
Factory
interface
Factory
{
interface
Factory
{
fun
create
(
fun
create
(
appComponent
:
AppComponent
appComponent
:
AppComponent
,
@BindsInstance
activity
:
RoomParkMainActivity
,
@BindsInstance
activity
:
RoomParkMainActivity
):
Downloader
ScreenComponent
):
StartToursDownloadingDialog
ScreenComponent
}
}
fun
inject
(
controller
:
StartToursDownloadingDialogController
)
fun
inject
(
controller
:
StartToursDownloadingDialogController
)
...
@@ -159,7 +147,8 @@ interface StartToursDownloadingDialogComponent {
...
@@ -159,7 +147,8 @@ interface StartToursDownloadingDialogComponent {
@Module
@Module
abstract
class
StartToursDownloadingDialogScreenModule
{
abstract
class
StartToursDownloadingDialogScreenModule
{
@PerScreen
@PerScreen
@Binds
@Binds
abstract
fun
provide
Context
(
activity
:
RoomParkMainActivity
):
Context
abstract
fun
provide
Activity
(
activity
:
RoomParkMainActivity
):
BaseRoomParkActivity
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenContract.kt
View file @
d9a1127f
...
@@ -9,7 +9,7 @@ import io.reactivex.Observable
...
@@ -9,7 +9,7 @@ import io.reactivex.Observable
*/
*/
interface
SettingsScreen
:
BigantoBaseContract
<
SettingsScreenViewState
>
{
interface
SettingsScreen
:
BigantoBaseContract
<
SettingsScreenViewState
>
{
fun
downloadAllTours
():
Observable
<
Int
>
//
fun downloadAllTours(): Observable<Int>
fun
signOut
():
Observable
<
Int
>
fun
signOut
():
Observable
<
Int
>
fun
clearCache
():
Observable
<
Int
>
fun
clearCache
():
Observable
<
Int
>
fun
refreshCacheInfo
():
Observable
<
Int
>
fun
refreshCacheInfo
():
Observable
<
Int
>
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenController.kt
View file @
d9a1127f
...
@@ -55,9 +55,9 @@ class SettingsScreenController :
...
@@ -55,9 +55,9 @@ class SettingsScreenController :
.
map
{
Timber
.
d
(
"Clicked clear cache button"
);
1
}
.
map
{
Timber
.
d
(
"Clicked clear cache button"
);
1
}
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
override
fun
downloadAllTours
():
Observable
<
Int
>
=
//
override fun downloadAllTours(): Observable<Int> =
toursDownloaderButton
.
clicks
().
filter
{
false
}
//
toursDownloaderButton.clicks().filter { false }
.
map
{
1
}.
observeOn
(
AndroidSchedulers
.
mainThread
())
//
.map { 1 }.observeOn(AndroidSchedulers.mainThread())
private
val
refreshEmitter
=
BehaviorRelay
.
create
<
Int
>()
private
val
refreshEmitter
=
BehaviorRelay
.
create
<
Int
>()
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
d9a1127f
...
@@ -46,10 +46,10 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -46,10 +46,10 @@ class SettingsScreenPresenter @Inject constructor(
.
map
{
it
*
TYPICAL_PLAN_SIZE
}
.
map
{
it
*
TYPICAL_PLAN_SIZE
}
.
map
{
SettingsScreenViewState
.
OnPlanTypesPrefetch
(
it
)
}
.
map
{
SettingsScreenViewState
.
OnPlanTypesPrefetch
(
it
)
}
val
onDownloadTours
=
intent
(
SettingsScreen
::
downloadAllTours
)
//
val onDownloadTours = intent(SettingsScreen::downloadAllTours)
.
flatMap
{
interactor
.
startToursDownloading
()
//
.flatMap { interactor.startToursDownloading()
.
andThen
(
Observable
.
just
(
SettingsScreenViewState
.
Idle
()))
//
.andThen(Observable.just(SettingsScreenViewState.Idle()))
}
//
}
val
onSubChecked
=
intent
(
SettingsScreen
::
onSubscription
)
val
onSubChecked
=
intent
(
SettingsScreen
::
onSubscription
)
.
flatMap
{
sub
->
.
flatMap
{
sub
->
...
@@ -129,7 +129,7 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -129,7 +129,7 @@ class SettingsScreenPresenter @Inject constructor(
fetchSubscriptions
,
fetchSubscriptions
,
fetchCache
,
fetchCache
,
onSubChecked
,
onSubChecked
,
onDownloadTours
,
//
onDownloadTours,
fetchToursSize
fetchToursSize
)
)
)
)
...
...
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