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
95b43e29
Commit
95b43e29
authored
Oct 14, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
articles mock
parent
d9511b06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
8 deletions
+113
-8
feeds.kt
...va/com/biganto/visual/roompark/domain/interactor/feeds.kt
+109
-2
feeds_screen.xml
app/src/main/res/layout/feeds_screen.xml
+4
-6
No files found.
app/src/main/java/com/biganto/visual/roompark/domain/interactor/feeds.kt
View file @
95b43e29
package
com.biganto.visual.roompark.domain.interactor
import
com.biganto.visual.roompark.domain.use_case.AuthUseCase
import
com.biganto.visual.roompark.domain.model.ArticlePreviewModel
import
com.biganto.visual.roompark.domain.model.ArticlesPreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.FeedsHeaderModel
import
io.reactivex.Single
import
java.util.*
import
javax.inject.Inject
/**
...
...
@@ -9,4 +14,106 @@ import javax.inject.Inject
class
FeedsInteractor
@Inject
constructor
(
){
}
\ No newline at end of file
fun
fetchTopFeeds
():
Single
<
FeedsHeaderModel
>
=
Single
.
just
(
testFeeds
)
fun
fetchArticles
(
feedId
:
Int
):
Single
<
ArticlesPreviewModel
>
=
Single
.
just
(
when
(
feedId
)
{
1
->
testNewsArticles
2
->
testBlogsArticles
3
->
testDevArticles
else
->
error
(
"unknown feedId"
)
})
private
companion
object
{
private
const
val
sampleUrl
:
String
=
"https://room-park.ru/assets/news_articles/preview/00/00/00/109-8c9b72.jpeg"
private
const
val
sampleUrlB
=
"https://room-park.ru/assets/news_articles/preview/00/00/00/104-2b4eff.jpeg"
private
const
val
sampleUrlDev
=
"https://room-park.ru/assets/news_articles/preview/00/00/00/96-a972cd.jpeg"
val
testFeeds
=
FeedsHeaderModel
(
listOf
(
FeedModel
(
1
,
"НОВОСТИ"
),
FeedModel
(
2
,
"БЛОГИ"
),
FeedModel
(
2
,
"БЛОГ СТРОИТЕЛЬСТВА"
)
)
)
val
testNewsArticles
=
ArticlesPreviewModel
(
1
,
listOf
(
ArticlePreviewModel
(
1
,
Date
()
,
"Первая новость"
,
"Самый очаровательной анонс в мире"
,
sampleUrl
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"Первая новость"
,
"Самый очаровательной анонс в мире"
,
sampleUrl
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"Первая новость"
,
"Самый очаровательной анонс в мире"
,
sampleUrl
,
false
)
)
)
val
testBlogsArticles
=
ArticlesPreviewModel
(
2
,
listOf
(
ArticlePreviewModel
(
1
,
Date
()
,
"Первая новость"
,
"Самый очаровательной анонс в мире"
,
sampleUrlB
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"НОВЫЙ ОФИС ПРОДАЖ ЖК «РУМЯНЦЕВО-ПАРК»"
,
"Самый очаровательной анонс в мире"
,
sampleUrlB
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"В «РУМЯНЦЕВО-ПАРК» ПРИСТУПИЛИ К МОНТАЖУ ОКОННЫХ БЛОКОВ"
,
"Самый очаровательной анонс в мире"
,
sampleUrlB
,
false
)
)
)
val
testDevArticles
=
ArticlesPreviewModel
(
3
,
listOf
(
ArticlePreviewModel
(
1
,
Date
()
,
"Ход1"
,
"Самый очаровательной анонс в мире"
,
sampleUrlDev
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"Ход2"
,
"Самый очаровательной анонс в мире"
,
sampleUrlDev
,
false
),
ArticlePreviewModel
(
1
,
Date
()
,
"Ход3"
,
"Самый очаровательной анонс в мире"
,
sampleUrlDev
,
false
)
)
)
}
}
}
app/src/main/res/layout/feeds_screen.xml
View file @
95b43e29
...
...
@@ -5,12 +5,10 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
android:id=
"@+id/include"
...
...
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