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
f2a9e182
Commit
f2a9e182
authored
Apr 09, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tour launcher
parent
52cea639
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
DownloadTourDialogController.kt
...ctor/dialogs/tour_chooser/DownloadTourDialogController.kt
+7
-3
FileModule.kt
...iganto/visual/roompark/data/repository/file/FileModule.kt
+13
-6
DownloadUseCase.kt
...iganto/visual/roompark/domain/use_case/DownloadUseCase.kt
+5
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/DownloadTourDialogController.kt
View file @
f2a9e182
...
@@ -17,6 +17,7 @@ import com.biganto.visual.roompark.di.dagger.AppComponent
...
@@ -17,6 +17,7 @@ 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.ToursInteractor
import
com.biganto.visual.roompark.domain.interactor.ToursInteractor
import
com.biganto.visual.roompark.domain.model.TourModel
import
com.biganto.visual.roompark.domain.model.TourModel
import
com.biganto.visual.roompark.domain.model.fromEntity
import
com.biganto.visual.roompark.domain.use_case.DownloadUseCase
import
com.biganto.visual.roompark.domain.use_case.DownloadUseCase
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.TourPreviewEntity
import
com.biganto.visual.roomparkvr.data.repository.db.requery.model.TourPreviewEntity
...
@@ -100,8 +101,8 @@ class DownloadTourDialogController : Controller {
...
@@ -100,8 +101,8 @@ class DownloadTourDialogController : Controller {
downloadTourTitleText
.
text
=
tour
.
title
downloadTourTitleText
.
text
=
tour
.
title
Glide
.
with
(
view
)
Glide
.
with
(
view
)
.
load
(
tour
.
previewUrl
)
.
load
(
tour
.
previewUrl
)
.
transform
(
BlurTransformation
(
13
,
8
)
)
.
transform
(
BlurTransformation
(
13
,
8
)
.
transform
(
ColorFilterTransformation
(
0
x99000000
.
toInt
()))
,
ColorFilterTransformation
(
0
x99000000
.
toInt
()))
.
into
(
downloaderBg
)
.
into
(
downloaderBg
)
disposables
.
add
(
disposables
.
add
(
...
@@ -114,7 +115,10 @@ class DownloadTourDialogController : Controller {
...
@@ -114,7 +115,10 @@ class DownloadTourDialogController : Controller {
{
model
->
{
model
->
updateProgressBar
(
model
.
downloadedFiles
,
model
.
overallFiles
)
updateProgressBar
(
model
.
downloadedFiles
,
model
.
overallFiles
)
if
(
model
.
overallFiles
==
model
.
downloadedFiles
)
if
(
model
.
overallFiles
==
model
.
downloadedFiles
)
activity
?.
let
{
startPlayer
(
it
,
tour
)
}
activity
?.
let
{
startPlayer
(
it
,
fromEntity
(
model
))
handleBack
()
}
}
}
,{
error
->
,{
error
->
Timber
.
e
(
error
)
Timber
.
e
(
error
)
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/file/FileModule.kt
View file @
f2a9e182
...
@@ -33,9 +33,14 @@ class FileModule @Inject constructor(val context: Application) {
...
@@ -33,9 +33,14 @@ class FileModule @Inject constructor(val context: Application) {
fun
getFile
(
fileUri
:
String
):
File
{
fun
getFile
(
fileUri
:
String
):
File
{
try
{
try
{
val
fileName
=
if
(
fileUri
.
contains
(
"/"
))
fileUri
.
substring
(
fileUri
.
lastIndexOf
(
"/"
))
else
fileUri
val
fileName
=
val
fileDir
=
if
(
fileUri
.
contains
(
"/"
))
fileUri
.
substring
(
0
,
fileUri
.
lastIndexOf
(
"/"
))
else
""
if
(
fileUri
.
contains
(
"/"
))
fileUri
.
substring
(
fileUri
.
lastIndexOf
(
"/"
))
val
directory
=
File
(
rootFolder
,
fileDir
)
else
fileUri
val
fileDir
=
if
(
fileUri
.
contains
(
"/"
))
fileUri
.
substring
(
0
,
fileUri
.
lastIndexOf
(
"/"
))
else
""
val
directory
=
File
(
assetsFile
(
context
),
fileDir
)
directory
.
mkdirs
()
directory
.
mkdirs
()
val
file
=
File
(
directory
,
fileName
)
val
file
=
File
(
directory
,
fileName
)
...
@@ -61,7 +66,7 @@ class FileModule @Inject constructor(val context: Application) {
...
@@ -61,7 +66,7 @@ class FileModule @Inject constructor(val context: Application) {
file
.
writeText
(
content
)
//to json array because core unity method parse data like TourData[] Estate[] etc..
file
.
writeText
(
content
)
//to json array because core unity method parse data like TourData[] Estate[] etc..
}
}
fun
deleteFile
(
uri
:
String
)=
getFile
(
uri
).
delete
()
//
fun deleteFile(uri:String)= getFile(uri).delete()
fun
deleteAllCacheObservable
()
=
fun
deleteAllCacheObservable
()
=
Observable
.
create
<
Pair
<
Int
,
Int
>>
{
emitter
->
Observable
.
create
<
Pair
<
Int
,
Int
>>
{
emitter
->
...
@@ -89,9 +94,11 @@ class FileModule @Inject constructor(val context: Application) {
...
@@ -89,9 +94,11 @@ class FileModule @Inject constructor(val context: Application) {
fun
getDirectory
(
context
:
Context
,
dirType
:
FileDirectory
):
File
=
fun
getDirectory
(
context
:
Context
,
dirType
:
FileDirectory
):
File
=
File
(
context
.
filesDir
.
absolutePath
.
plus
(
dirType
.
dir
))
File
(
context
.
filesDir
.
absolutePath
.
plus
(
dirType
.
dir
))
fun
assetsDirectory
(
context
:
Context
):
String
=
context
.
filesDir
.
absolutePath
fun
assetsDirectory
(
context
:
Context
):
String
=
getDirectory
(
context
,
FileDirectory
.
ToursDir
(
"biganto"
)).
absolutePath
fun
assetsFile
(
context
:
Context
):
File
=
context
.
filesDir
.
absoluteFile
fun
assetsFile
(
context
:
Context
):
File
=
getDirectory
(
context
,
FileDirectory
.
ToursDir
(
"biganto"
))
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/DownloadUseCase.kt
View file @
f2a9e182
...
@@ -277,7 +277,11 @@ class DownloadUseCase @Inject constructor(
...
@@ -277,7 +277,11 @@ class DownloadUseCase @Inject constructor(
tour
.
let
{
tour
.
let
{
val
metaUri
=
RevisionString
(
"$META_PREDICTION${tour.id}$META_FILE_TYPE"
)
val
metaUri
=
RevisionString
(
"$META_PREDICTION${tour.id}$META_FILE_TYPE"
)
it
.
setMetaFileEntityId
(
metaUri
)
it
.
setMetaFileEntityId
(
metaUri
)
fileModule
.
saveFileToDisk
(
fileModule
.
getFile
(
metaUri
.
uri
()),
meta
)
fileModule
.
saveFileToDisk
(
File
(
FileModule
.
assetsDirectory
(
context
).
plus
(
metaUri
.
uri
())
),
meta
)
}
}
}
}
?.
map
{
tour
}
?.
map
{
tour
}
...
...
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