-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreviews.kt
57 lines (51 loc) · 1.62 KB
/
Previews.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.github.jetbrains.rssreader.androidApp.composeui
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.github.jetbrains.rssreader.core.entity.Feed
import com.github.jetbrains.rssreader.core.entity.Post
@Preview
@Composable
private fun FeedItemPreview() {
AppTheme {
FeedItem(feed = PreviewData.feed) {}
}
}
@Preview
@Composable
private fun PostPreview() {
AppTheme {
PostItem(item = PreviewData.post, onClick = {})
}
}
@Preview
@Composable
private fun FeedIconPreview() {
AppTheme {
FeedIcon(feed = PreviewData.feed)
}
}
@Preview
@Composable
private fun FeedIconSelectedPreview() {
AppTheme {
FeedIcon(feed = PreviewData.feed, true)
}
}
private object PreviewData {
val post = Post(
title = "Productive Server-Side Development With Kotlin: Stories From The Industry",
desc = "Kotlin was created as an alternative to Java, meaning that its application area within the JVM ecosystem was meant to be the same as Java’s. Obviously, this includes server-side development. We would love...",
imageUrl = "https://blog.jetbrains.com/wp-content/uploads/2020/11/server.png",
link = "https://blog.jetbrains.com/kotlin/2020/11/productive-server-side-development-with-kotlin-stories/",
date = 42L
)
val feed = Feed(
title = "Kotlin Blog",
link = "blog.jetbrains.com/kotlin/",
desc = "blog.jetbrains.com/kotlin/",
imageUrl = null,
posts = listOf(post),
sourceUrl = "https://blog.jetbrains.com/feed/",
isDefault = true
)
}