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
598c2505
Commit
598c2505
authored
Dec 13, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fix layout and added header adapter
parent
a098be97
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
144 additions
and
21 deletions
+144
-21
response.kt
...ual/roompark/data/repository/api/retrofit/raw/response.kt
+1
-1
GalleryPhoto.kt
...roompark/data/repository/db/requrey/model/GalleryPhoto.kt
+2
-4
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+0
-2
albums.kt
...n/java/com/biganto/visual/roompark/domain/model/albums.kt
+3
-1
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+4
-4
AlbumHeaderAdapter.kt
...ark/presentation/screen/albums/util/AlbumHeaderAdapter.kt
+52
-0
AlbumListAdapter.kt
...mpark/presentation/screen/albums/util/AlbumListAdapter.kt
+9
-7
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+6
-1
DevProgressPreviewAdapter.kt
...sentation/screen/feeds/utils/DevProgressPreviewAdapter.kt
+7
-1
album_header_preview_viewholder.xml
app/src/main/res/layout/album_header_preview_viewholder.xml
+60
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/raw/response.kt
View file @
598c2505
...
@@ -122,7 +122,7 @@ data class ImageAlbumRaw(
...
@@ -122,7 +122,7 @@ data class ImageAlbumRaw(
data class
GalleryImageRaw
(
data class
GalleryImageRaw
(
val
id
:
Int
,
val
id
:
Int
,
val
title
:
String
,
val
title
:
String
,
val
description
:
String
,
val
description
:
String
?
,
val
sort
:
Int
,
val
sort
:
Int
,
val
album_id
:
Int
,
val
album_id
:
Int
,
val
resolutions
:
List
<
ResolutionRaw
>
val
resolutions
:
List
<
ResolutionRaw
>
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/GalleryPhoto.kt
View file @
598c2505
...
@@ -2,10 +2,7 @@ package com.biganto.visual.roompark.data.repository.db.requrey.model
...
@@ -2,10 +2,7 @@ package com.biganto.visual.roompark.data.repository.db.requrey.model
import
com.biganto.visual.roompark.data.repository.db.requrey.PhotoResolutions
import
com.biganto.visual.roompark.data.repository.db.requrey.PhotoResolutions
import
com.biganto.visual.roompark.data.repository.db.requrey.utils.PhotoResolutionsConverter
import
com.biganto.visual.roompark.data.repository.db.requrey.utils.PhotoResolutionsConverter
import
io.requery.Convert
import
io.requery.*
import
io.requery.Entity
import
io.requery.Key
import
io.requery.Persistable
/**
/**
* Created by Vladislav Bogdashkin on 29.10.2019.
* Created by Vladislav Bogdashkin on 29.10.2019.
...
@@ -17,6 +14,7 @@ interface GalleryPhoto : Persistable {
...
@@ -17,6 +14,7 @@ interface GalleryPhoto : Persistable {
@get
:
Key
@get
:
Key
val
id
:
Int
val
id
:
Int
val
title
:
String
val
title
:
String
@get
:
Nullable
val
description
:
String
val
description
:
String
val
sort
:
Int
val
sort
:
Int
val
album_id
:
Int
val
album_id
:
Int
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
598c2505
...
@@ -43,7 +43,6 @@ import javax.inject.Singleton
...
@@ -43,7 +43,6 @@ import javax.inject.Singleton
AppActivityModule
::
class
])
AppActivityModule
::
class
])
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
fun
authC
():
AuthContract
fun
authC
():
AuthContract
fun
feedsC
():
FeedsContract
fun
feedsC
():
FeedsContract
...
@@ -51,7 +50,6 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
...
@@ -51,7 +50,6 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun
feedsAlb
():
DevProgressContract
fun
feedsAlb
():
DevProgressContract
fun
provideLocal
():
ILocalStore
fun
provideLocal
():
ILocalStore
fun
provideApi
():
IRoomParkApi
fun
provideApi
():
IRoomParkApi
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/albums.kt
View file @
598c2505
...
@@ -14,6 +14,7 @@ data class AlbumPreviewModel(
...
@@ -14,6 +14,7 @@ data class AlbumPreviewModel(
val
parentId
:
Int
,
val
parentId
:
Int
,
val
title
:
String
,
val
title
:
String
,
val
published
:
Date
,
val
published
:
Date
,
val
previewUrl
:
String
,
val
isRead
:
Boolean
val
isRead
:
Boolean
)
)
...
@@ -39,7 +40,7 @@ data class PhotoListModel(val items:List<PhotoModel>)
...
@@ -39,7 +40,7 @@ data class PhotoListModel(val items:List<PhotoModel>)
data class
PhotoModel
(
data class
PhotoModel
(
val
photoId
:
Int
,
val
photoId
:
Int
,
val
albumId
:
Int
,
val
albumId
:
Int
,
val
description
:
String
,
val
description
:
String
?
,
val
sort
:
Int
,
val
sort
:
Int
,
val
resolutionList
:
List
<
PhotoResolutionModel
>
val
resolutionList
:
List
<
PhotoResolutionModel
>
...
@@ -59,6 +60,7 @@ fun fromEntity(entity: ImageAlbumEntity):AlbumPreviewModel =
...
@@ -59,6 +60,7 @@ fun fromEntity(entity: ImageAlbumEntity):AlbumPreviewModel =
parentId
=
-
1
,
parentId
=
-
1
,
title
=
entity
.
title
,
title
=
entity
.
title
,
published
=
entity
.
published
,
published
=
entity
.
published
,
previewUrl
=
entity
.
preview
,
isRead
=
false
isRead
=
false
)
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
598c2505
...
@@ -11,8 +11,8 @@ import com.biganto.visual.roompark.base.IBottomNavigation
...
@@ -11,8 +11,8 @@ import com.biganto.visual.roompark.base.IBottomNavigation
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.BigantoBaseController
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.presentation.screen.albums.util.AlbumsHeaderAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.AlbumListAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.AlbumListAdapter
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.AlbumsPreviewAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
javax.inject.Inject
import
javax.inject.Inject
...
@@ -46,7 +46,7 @@ class AlbumsScreenController :
...
@@ -46,7 +46,7 @@ class AlbumsScreenController :
headersRecyclerView
.
isNestedScrollingEnabled
=
true
headersRecyclerView
.
isNestedScrollingEnabled
=
true
headersRecyclerView
.
layoutManager
=
headersRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
headersRecyclerView
.
adapter
=
Albums
Preview
Adapter
()
headersRecyclerView
.
adapter
=
Albums
Header
Adapter
()
headersRecyclerView
.
itemAnimator
=
null
headersRecyclerView
.
itemAnimator
=
null
if
(
headersRecyclerView
.
itemDecorationCount
==
0
)
if
(
headersRecyclerView
.
itemDecorationCount
==
0
)
...
@@ -111,11 +111,11 @@ class AlbumsScreenController :
...
@@ -111,11 +111,11 @@ class AlbumsScreenController :
showError
(
viewState
.
exception
)
showError
(
viewState
.
exception
)
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
AlbumsListLoaded
)
{
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
AlbumsListLoaded
)
{
(
headersRecyclerView
.
adapter
as
Albums
Preview
Adapter
).
setItems
(
viewState
.
list
)
(
headersRecyclerView
.
adapter
as
Albums
Header
Adapter
).
setItems
(
viewState
.
list
)
headersRecyclerView
.
let
{
headersRecyclerView
.
let
{
it
.
scrollToPosition
(
it
.
scrollToPosition
(
(
it
.
adapter
as
Albums
Preview
Adapter
).
getItemPosition
(
viewState
.
selectedAlbumId
)
(
it
.
adapter
as
Albums
Header
Adapter
).
getItemPosition
(
viewState
.
selectedAlbumId
)
)
)
}
}
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumHeaderAdapter.kt
0 → 100644
View file @
598c2505
package
com.biganto.visual.roompark.presentation.screen.albums.util
import
android.view.View
import
android.widget.ImageView
import
android.widget.TextView
import
butterknife.BindView
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.squareup.picasso.Picasso
import
java.text.SimpleDateFormat
import
java.util.*
/**
* Created by Vladislav Bogdashkin on 15.10.2019.
*/
class
AlbumsHeaderAdapter
:
CommonRecyclerAdapter
<
AlbumsHeaderViewHolder
,
AlbumPreviewModel
>()
{
override
val
vhKlazz
=
AlbumsHeaderViewHolder
::
class
override
fun
getVhLayout
():
Int
=
R
.
layout
.
album_header_preview_viewholder
fun
getItemPosition
(
model
:
AlbumPreviewModel
)
=
getItemPosition
(
model
.
albumId
)
fun
getItemPosition
(
modelId
:
Int
)
=
list
.
indexOfFirst
{
it
.
albumId
==
modelId
}
}
class
AlbumsHeaderViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
AlbumPreviewModel
>(
itemView
)
{
private
val
dateFormatter
=
SimpleDateFormat
(
"dd MMMM yyyy"
,
Locale
(
"ru"
))
@BindView
(
R
.
id
.
preview
)
lateinit
var
preview
:
ImageView
@BindView
(
R
.
id
.
card_title
)
lateinit
var
articleTitle
:
TextView
@BindView
(
R
.
id
.
card_updated
)
lateinit
var
articleDate
:
TextView
override
fun
onViewBound
(
model
:
AlbumPreviewModel
)
{
// articleDate.text = dateFormatter.format(model.published)
articleTitle
.
text
=
model
.
title
Picasso
.
get
()
.
load
(
model
.
previewUrl
)
.
centerCrop
()
.
fit
()
.
into
(
preview
)
//
}
}
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumListAdapter.kt
View file @
598c2505
...
@@ -19,16 +19,18 @@ import com.squareup.picasso.Picasso
...
@@ -19,16 +19,18 @@ import com.squareup.picasso.Picasso
*/
*/
class
AlbumListAdapter
:
CommonRecyclerAdapter
<
AlbumViewHolder
,
AlbumSortedModel
>()
{
class
AlbumListAdapter
:
CommonRecyclerAdapter
<
AlbumViewHolder
,
AlbumSortedModel
>()
{
override
val
vhKlazz
=
AlbumViewHolder
::
class
override
val
vhKlazz
=
AlbumViewHolder
::
class
override
fun
getVhLayout
():
Int
=
R
.
layout
.
date_album_viewholder
override
fun
getVhLayout
():
Int
=
R
.
layout
.
date_album_viewholder
}
}
class
AlbumViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
AlbumSortedModel
>(
itemView
)
{
class
AlbumViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
AlbumSortedModel
>(
itemView
)
{
@BindView
(
R
.
id
.
date_title_textview
)
lateinit
var
albumTitle
:
MaterialTextView
@BindView
(
R
.
id
.
date_title_textview
)
@BindView
(
R
.
id
.
photos_recyclerview
)
lateinit
var
photosRecyclerView
:
RecyclerView
lateinit
var
albumTitle
:
MaterialTextView
@BindView
(
R
.
id
.
photos_recyclerview
)
lateinit
var
photosRecyclerView
:
RecyclerView
// @BindView(R.id.camStatusIcon) lateinit var camStatusIcon:ImageView
// @BindView(R.id.camStatusIcon) lateinit var camStatusIcon:ImageView
override
fun
onViewBound
(
model
:
AlbumSortedModel
)
{
override
fun
onViewBound
(
model
:
AlbumSortedModel
)
{
...
@@ -58,7 +60,7 @@ class PhotosViewHolder(itemView: View) : CommonViewHolder<PhotoModel>(itemView)
...
@@ -58,7 +60,7 @@ class PhotosViewHolder(itemView: View) : CommonViewHolder<PhotoModel>(itemView)
model
.
resolutionList
.
lowelest
()
?.
let
{
model
.
resolutionList
.
lowelest
()
?.
let
{
Picasso
.
get
()
Picasso
.
get
()
.
load
(
it
.
url
)
.
load
(
it
.
url
)
.
onlyScaleDown
()
.
centerCrop
()
.
fit
()
.
fit
()
.
into
(
photoPreview
)
.
into
(
photoPreview
)
}}
}}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
598c2505
...
@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.domain.model.AlbumPreviewModel
...
@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.domain.model.ArticlePreviewModel
import
com.biganto.visual.roompark.domain.model.ArticlePreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.WebCamModel
import
com.biganto.visual.roompark.domain.model.WebCamModel
import
com.biganto.visual.roompark.presentation.screen.albums.AlbumsScreenController
import
com.biganto.visual.roompark.presentation.screen.article.ArticleScreenController
import
com.biganto.visual.roompark.presentation.screen.article.ArticleScreenController
import
com.biganto.visual.roompark.presentation.screen.feed_list.ArticlesScreenController
import
com.biganto.visual.roompark.presentation.screen.feed_list.ArticlesScreenController
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.AlbumsPreviewAdapter
import
com.biganto.visual.roompark.presentation.screen.feeds.utils.AlbumsPreviewAdapter
...
@@ -194,7 +195,11 @@ class FeedsScreenController :
...
@@ -194,7 +195,11 @@ class FeedsScreenController :
}
}
private
fun
render
(
viewState
:
FeedsScreenViewState
.
ToAlbum
)
{
private
fun
render
(
viewState
:
FeedsScreenViewState
.
ToAlbum
)
{
TODO
(
"to album screen"
)
router
.
pushController
(
RouterTransaction
.
with
(
AlbumsScreenController
(
viewState
.
albumId
))
.
popChangeHandler
(
FadeChangeHandler
())
.
pushChangeHandler
(
FadeChangeHandler
())
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/utils/DevProgressPreviewAdapter.kt
View file @
598c2505
...
@@ -8,6 +8,7 @@ import com.biganto.visual.roompark.R
...
@@ -8,6 +8,7 @@ import com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.domain.model.AlbumPreviewModel
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
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.presentation.screen.settings.util.CommonViewHolder
import
com.squareup.picasso.Picasso
import
java.text.SimpleDateFormat
import
java.text.SimpleDateFormat
import
java.util.*
import
java.util.*
...
@@ -39,6 +40,11 @@ class AlbumCardViewHolder(itemView: View) : CommonViewHolder<AlbumPreviewModel>(
...
@@ -39,6 +40,11 @@ class AlbumCardViewHolder(itemView: View) : CommonViewHolder<AlbumPreviewModel>(
// articleDate.text = dateFormatter.format(model.published)
// articleDate.text = dateFormatter.format(model.published)
articleTitle
.
text
=
model
.
title
articleTitle
.
text
=
model
.
title
// Picasso.ge1preview)
articleTitle
.
text
=
model
.
title
Picasso
.
get
()
.
load
(
model
.
previewUrl
)
.
centerCrop
()
.
fit
()
.
into
(
preview
)
}
}
}
}
app/src/main/res/layout/album_header_preview_viewholder.xml
0 → 100644
View file @
598c2505
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"142dp"
android:layout_height=
"94dp"
android:layout_margin=
"16dp"
app:cardElevation=
"4dp"
app:cardMaxElevation=
"6dp"
app:cardForegroundColor=
"#00000000"
app:cardPreventCornerOverlap=
"false"
app:cardUseCompatPadding=
"false"
>
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
android:id=
"@+id/preview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:adjustViewBounds=
"true"
android:background=
"@drawable/default_image_placeholder"
android:cropToPadding=
"true"
android:foreground=
"@color/colorOpacityBackground"
android:scaleType=
"centerCrop"
app:image_corner_radius=
"4dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/card_title"
style=
"@style/Default_TextView.Inverted_Text"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:layout_marginBottom=
"4dp"
android:includeFontPadding=
"false"
android:text=
"Дом №1"
android:textAlignment=
"center"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/card_updated"
style=
"@style/Accent_Minor_TextView.Inverted"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"12dp"
android:layout_marginEnd=
"8dp"
android:gravity=
"center"
android:includeFontPadding=
"false"
android:maxLines=
"1"
android:text=
"14 декабря 2019г"
android:textAlignment=
"center"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</FrameLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
\ 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