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
e8efc237
Commit
e8efc237
authored
Oct 15, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added camslist
finish feeds screen pattern design
parent
56eaee29
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
129 additions
and
21 deletions
+129
-21
feeds.kt
...va/com/biganto/visual/roompark/domain/interactor/feeds.kt
+20
-0
webCamList.kt
...va/com/biganto/visual/roompark/domain/model/webCamList.kt
+1
-1
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+16
-1
ScreenPresenter.kt
...ual/roompark/presentation/screen/feeds/ScreenPresenter.kt
+3
-0
ScreenViewState.kt
...ual/roompark/presentation/screen/feeds/ScreenViewState.kt
+2
-0
CamsLIstAdapter.kt
...ompark/presentation/screen/feeds/utils/CamsLIstAdapter.kt
+55
-0
DevProgressPreviewAdapter.kt
...sentation/screen/feeds/utils/DevProgressPreviewAdapter.kt
+1
-1
estate_card_viewholder.xml
app/src/main/res/layout-v23/estate_card_viewholder.xml
+2
-1
cam_button_viewholder.xml
app/src/main/res/layout/cam_button_viewholder.xml
+16
-3
estate_card_viewholder.xml
app/src/main/res/layout/estate_card_viewholder.xml
+2
-2
feeds_screen.xml
app/src/main/res/layout/feeds_screen.xml
+11
-12
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/feeds.kt
View file @
e8efc237
...
...
@@ -25,6 +25,8 @@ class FeedsInteractor @Inject constructor(
fun
fetchAlbums
():
Single
<
List
<
AlbumPreviewModel
>>
=
Single
.
just
(
albumsPreviews
)
fun
fetchCams
():
Single
<
WebCamListModel
>
=
Single
.
just
(
camsList
)
private
companion
object
{
...
...
@@ -159,6 +161,24 @@ class FeedsInteractor @Inject constructor(
false
)
)
val
camsList
=
WebCamListModel
(
arrayListOf
(
WebCamModel
(
"Камера Дом №1"
,
1
,
"blob:https://room-park.ru/fd579683-4bda-4f87-8663-dfe6c02af2f1"
),
WebCamModel
(
"Камера Дом №2"
,
2
,
"blob:https://room-park.ru/58956693-f36d-4f8a-bc89-9bded955dfdd"
),
WebCamModel
(
"Камера Дом №3"
,
3
,
"blob:https://room-park.ru/19d41d5a-565b-4fc9-a72f-06fbe87e8fb6"
)
))
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/webCamList.kt
View file @
e8efc237
...
...
@@ -10,4 +10,4 @@ data class WebCamModel(
val
streamUrl
:
String
)
data class
WebCamListModel
(
val
items
:
List
<
WebCamListModel
>)
\ No newline at end of file
data class
WebCamListModel
(
val
items
:
List
<
WebCamModel
>)
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
e8efc237
...
...
@@ -12,6 +12,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.AlbumsPreviewAdapter
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.ArticlesPreviewAdapter
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.CamsListAdapter
import
com.google.android.material.tabs.TabLayout
import
com.jakewharton.rxbinding3.material.selections
import
io.reactivex.Observable
...
...
@@ -48,6 +49,9 @@ class FeedsScreenController :
@BindView
(
R
.
id
.
dev_progress_recycler_view
)
lateinit
var
devProgressRecyclerView
:
RecyclerView
@BindView
(
R
.
id
.
cams_recycler_view
)
lateinit
var
camsRecyclerView
:
RecyclerView
private
fun
bindRecycler
(){
feedsRecyclerView
.
isNestedScrollingEnabled
=
true
...
...
@@ -62,6 +66,12 @@ class FeedsScreenController :
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
devProgressRecyclerView
.
adapter
=
AlbumsPreviewAdapter
()
devProgressRecyclerView
.
itemAnimator
=
null
camsRecyclerView
.
isNestedScrollingEnabled
=
true
camsRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
camsRecyclerView
.
adapter
=
CamsListAdapter
()
camsRecyclerView
.
itemAnimator
=
null
}
private
var
storedFeedsList
:
List
<
FeedModel
>
=
arrayListOf
()
...
...
@@ -79,7 +89,8 @@ class FeedsScreenController :
when
(
viewState
){
is
FeedsScreenViewState
.
Idle
->
render
(
viewState
)
is
FeedsScreenViewState
.
FeedsPages
->
render
(
viewState
)
is
FeedsScreenViewState
.
AlbumsPages
->
render
(
viewState
)
is
FeedsScreenViewState
.
AlbumsPages
->
render
(
viewState
)
is
FeedsScreenViewState
.
CamsList
->
render
(
viewState
)
is
FeedsScreenViewState
.
GetFeedArticlesPreview
->
render
(
viewState
)
}
}
...
...
@@ -115,6 +126,10 @@ class FeedsScreenController :
(
feedsRecyclerView
.
adapter
as
ArticlesPreviewAdapter
).
addItems
(
viewState
.
items
)
}
private
fun
render
(
viewState
:
FeedsScreenViewState
.
CamsList
){
(
camsRecyclerView
.
adapter
as
CamsListAdapter
).
addItems
(
viewState
.
items
)
}
private
fun
getComponent
()
=
DaggerFeedsScreenComponent
.
factory
()
.
create
(
RoomParkApplication
.
component
,
activity
as
RoomParkMainActivity
)
.
inject
(
this
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenPresenter.kt
View file @
e8efc237
...
...
@@ -20,6 +20,8 @@ class FeedsScreenPresenter @Inject constructor(
override
fun
bindIntents
()
{
val
fetchCams
=
interactor
.
fetchCams
()
.
map
{
FeedsScreenViewState
.
CamsList
(
it
.
items
)
}
val
fetchAlbums
=
interactor
.
fetchAlbums
()
.
map
{
FeedsScreenViewState
.
AlbumsPages
(
it
)
}
...
...
@@ -35,6 +37,7 @@ class FeedsScreenPresenter @Inject constructor(
.
mergeWith
(
fetchFeeds
)
.
mergeWith
(
getFeedArticlesPreview
)
.
mergeWith
(
fetchAlbums
)
.
mergeWith
(
fetchCams
)
.
doOnError
{
Timber
.
e
(
it
)}
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenViewState.kt
View file @
e8efc237
...
...
@@ -4,6 +4,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseViewState
import
com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.domain.model.ArticlePreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.WebCamModel
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
...
...
@@ -14,6 +15,7 @@ sealed class FeedsScreenViewState : BigantoBaseViewState() {
class
Idle
:
FeedsScreenViewState
()
class
FeedsPages
(
val
items
:
List
<
FeedModel
>)
:
FeedsScreenViewState
()
class
AlbumsPages
(
val
items
:
List
<
AlbumPreviewModel
>)
:
FeedsScreenViewState
()
class
CamsList
(
val
items
:
List
<
WebCamModel
>)
:
FeedsScreenViewState
()
class
GetFeedArticlesPreview
(
val
items
:
List
<
ArticlePreviewModel
>)
:
FeedsScreenViewState
()
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/utils/CamsLIstAdapter.kt
0 → 100644
View file @
e8efc237
package
com.biganto.visual.roompark.presentation.screen.feeds.utils
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
butterknife.ButterKnife
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.WebCamModel
/**
* Created by Vladislav Bogdashkin on 15.10.2019.
*/
class
CamsListAdapter
:
RecyclerView
.
Adapter
<
CamListViewHolder
>()
{
private
var
list
:
MutableList
<
WebCamModel
>
=
mutableListOf
()
fun
addItems
(
list
:
List
<
WebCamModel
>){
this
.
list
.
clear
()
this
.
list
.
addAll
(
list
)
notifyDataSetChanged
()
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
CamListViewHolder
=
CamListViewHolder
(
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
cam_button_viewholder
,
parent
,
false
)
)
override
fun
getItemCount
():
Int
=
list
.
size
override
fun
onBindViewHolder
(
holder
:
CamListViewHolder
,
position
:
Int
)
{
holder
.
bindModel
(
list
[
position
])
}
}
class
CamListViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
@BindView
(
R
.
id
.
camTitle
)
lateinit
var
camTitle
:
TextView
@BindView
(
R
.
id
.
camStatus
)
lateinit
var
camStatus
:
View
init
{
ButterKnife
.
bind
(
this
,
itemView
)
}
fun
bindModel
(
model
:
WebCamModel
)
{
camTitle
.
text
=
model
.
title
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/utils/DevProgressPreviewAdapter.kt
View file @
e8efc237
...
...
@@ -31,7 +31,7 @@ class AlbumsPreviewAdapter : RecyclerView.Adapter<AlbumCardViewHolder>() {
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
AlbumCardViewHolder
=
AlbumCardViewHolder
(
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
album_preview
_card_viewholder
,
parent
,
false
)
.
inflate
(
R
.
layout
.
estate
_card_viewholder
,
parent
,
false
)
)
override
fun
getItemCount
():
Int
=
list
.
size
...
...
app/src/main/res/layout-v23/estate_card_viewholder.xml
View file @
e8efc237
...
...
@@ -3,6 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"284dp"
android:layout_height=
"189dp"
android:layout_margin=
"16dp"
app:cardElevation=
"0dp"
app:cardForegroundColor=
"#00000000"
app:cardPreventCornerOverlap=
"false"
...
...
@@ -15,7 +16,7 @@
android:adjustViewBounds=
"true"
android:background=
"@drawable/default_image_placeholder"
android:cropToPadding=
"true"
android:foreground=
"@
drawable/catalog_item_mask
"
android:foreground=
"@
color/colorOpacityBackground
"
android:scaleType=
"centerCrop"
app:image_corner_radius=
"4dp"
/>
...
...
app/src/main/res/layout/cam_button_viewholder.xml
View file @
e8efc237
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<include
layout=
"@layout/horizontal_divider"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"46dp"
xmlns:style=
"http://schemas.android.com/tools"
android:orientation=
"horizontal"
>
<ImageView
...
...
@@ -16,7 +26,7 @@
app:srcCompat=
"@drawable/ic_webcam"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/
textView7
"
android:id=
"@+id/
camTitle
"
style=
"@style/Accent_Minor_TextView.Default"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
...
...
@@ -37,12 +47,15 @@
app:srcCompat=
"@drawable/new_feed_icon"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/
textView8
"
android:id=
"@+id/
camStatus
"
style=
"@style/Feed.Notice"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginTop=
"2dp"
android:layout_marginEnd=
"16dp"
android:layout_weight=
"0"
android:gravity=
"center_vertical|fill_vertical"
android:text=
"ОНЛАЙН"
android:textAlignment=
"viewStart"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/estate_card_viewholder.xml
View file @
e8efc237
...
...
@@ -4,7 +4,7 @@
android:layout_width=
"284dp"
android:layout_height=
"189dp"
android:layout_margin=
"16dp"
app:cardElevation=
"
0
dp"
app:cardElevation=
"
2
dp"
app:cardForegroundColor=
"#00000000"
app:cardPreventCornerOverlap=
"false"
app:cardUseCompatPadding=
"false"
>
...
...
@@ -16,7 +16,7 @@
android:adjustViewBounds=
"true"
android:background=
"@drawable/default_image_placeholder"
android:cropToPadding=
"true"
android:foreground=
"@
drawable/catalog_item_mask
"
android:foreground=
"@
color/colorOpacityBackground
"
android:scaleType=
"centerCrop"
app:image_corner_radius=
"4dp"
/>
...
...
app/src/main/res/layout/feeds_screen.xml
View file @
e8efc237
...
...
@@ -35,8 +35,6 @@
android:id=
"@+id/dev_progress_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -48,13 +46,14 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/cams_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"16dp
"
android:layout_height=
"wrap_content
"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/dev_progress_recycler_view"
/>
app:layout_constraintTop_toBottomOf=
"@+id/dev_progress_recycler_view"
tools:listitem=
"@layout/cam_button_viewholder"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
\ No newline at end of file
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