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
a9d211a1
Commit
a9d211a1
authored
Mar 10, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move slider to correct index
parent
c6397e8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
ScreenController.kt
...al/roompark/presentation/screen/photo/ScreenController.kt
+5
-2
PhotoPreviewSlider.kt
...park/presentation/screen/photo/util/PhotoPreviewSlider.kt
+1
-0
PhotoViewAdapter.kt
...ompark/presentation/screen/photo/util/PhotoViewAdapter.kt
+2
-0
photo_view_screen.xml
app/src/main/res/layout/photo_view_screen.xml
+2
-2
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/photo/ScreenController.kt
View file @
a9d211a1
...
@@ -113,10 +113,12 @@ class PhotoScreenController :
...
@@ -113,10 +113,12 @@ class PhotoScreenController :
(
photoViewPager
.
adapter
as
PhotosAdapter
).
setItems
(
(
photoViewPager
.
adapter
as
PhotosAdapter
).
setItems
(
viewState
.
list
.
asSequence
().
sortedBy
{
it
.
sort
}.
toList
()
viewState
.
list
.
asSequence
().
sortedBy
{
it
.
sort
}.
toList
()
)
)
photoViewPager
.
currentItem
=
viewState
.
selectedId
slider
.
visibility
=
View
.
VISIBLE
slider
.
visibility
=
View
.
VISIBLE
slider
.
setUpViewPager
(
photoViewPager
)
slider
.
setUpViewPager
(
photoViewPager
)
photoViewPager
.
currentItem
=
(
photoViewPager
.
adapter
as
PhotosAdapter
).
indexById
(
viewState
.
selectedId
)
}
}
private
fun
render
(
viewState
:
PhotoScreenViewState
.
AldumFetched
)
{
private
fun
render
(
viewState
:
PhotoScreenViewState
.
AldumFetched
)
{
...
@@ -127,11 +129,12 @@ class PhotoScreenController :
...
@@ -127,11 +129,12 @@ class PhotoScreenController :
private
fun
render
(
viewState
:
PhotoScreenViewState
.
PhotoFetched
){
private
fun
render
(
viewState
:
PhotoScreenViewState
.
PhotoFetched
){
(
photoViewPager
.
adapter
as
PhotosAdapter
).
setItems
(
arrayListOf
(
viewState
.
model
))
(
photoViewPager
.
adapter
as
PhotosAdapter
).
setItems
(
arrayListOf
(
viewState
.
model
))
}
}
private
fun
render
(
viewState
:
PhotoScreenViewState
.
PhotoSelected
){
private
fun
render
(
viewState
:
PhotoScreenViewState
.
PhotoSelected
){
// (photoViewPager.adapter as PhotoViewerAdapter).setItems(arrayListOf(viewState.model))
// (photoViewPager.adapter as PhotoViewerAdapter).setItems(arrayListOf(viewState.model))
}
}
override
fun
handleBack
():
Boolean
{
router
.
popController
(
this
);
return
true
}
override
fun
getLayoutId
():
Int
=
R
.
layout
.
photo_view_screen
override
fun
getLayoutId
():
Int
=
R
.
layout
.
photo_view_screen
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/photo/util/PhotoPreviewSlider.kt
View file @
a9d211a1
...
@@ -177,6 +177,7 @@ class PhotoPreviewSlider @JvmOverloads constructor(
...
@@ -177,6 +177,7 @@ class PhotoPreviewSlider @JvmOverloads constructor(
texThread
?.
start
()
texThread
?.
start
()
adapter
?.
let
{
adapter
->
adapter
?.
let
{
adapter
->
texThread
?.
setAdapter
(
adapter
.
photosPreviewList
)
texThread
?.
setAdapter
(
adapter
.
photosPreviewList
)
texThread
?.
setIndex
(
vp
?.
currentItem
?:
0
)
// texThread?.setIndex(min(_l.size,2))
// texThread?.setIndex(min(_l.size,2))
}
?:
error
(
"adapter not ready!"
)
}
?:
error
(
"adapter not ready!"
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/photo/util/PhotoViewAdapter.kt
View file @
a9d211a1
...
@@ -25,6 +25,8 @@ class PhotosAdapter : CommonRecyclerAdapter<PhotosViewHolder, PhotoModel>() {
...
@@ -25,6 +25,8 @@ class PhotosAdapter : CommonRecyclerAdapter<PhotosViewHolder, PhotoModel>() {
}
}
fun
indexById
(
id
:
Int
):
Int
=
list
.
indexOfFirst
{
it
.
photoId
==
id
}
override
val
vhKlazz
=
PhotosViewHolder
::
class
override
val
vhKlazz
=
PhotosViewHolder
::
class
...
...
app/src/main/res/layout/photo_view_screen.xml
View file @
a9d211a1
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
android:id=
"@+id/linearLayout6"
android:id=
"@+id/linearLayout6"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"
@color/colorOpacityBackground
"
>
android:background=
"
#000000
"
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/photoTitle"
android:id=
"@+id/photoTitle"
...
@@ -61,8 +61,8 @@
...
@@ -61,8 +61,8 @@
android:id=
"@+id/change_size_button"
android:id=
"@+id/change_size_button"
android:layout_width=
"24dp"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_height=
"24dp"
android:layout_marginEnd=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/guideline2"
app:layout_constraintTop_toTopOf=
"@+id/guideline2"
app:srcCompat=
"@drawable/iic_full_view"
/>
app:srcCompat=
"@drawable/iic_full_view"
/>
...
...
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