MovieList.kt
1.93 KB
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
58
59
60
61
62
63
64
65
package com.apaas.bigscreem
object MovieList {
val MOVIE_CATEGORY = arrayOf(
"安徽华辰制药"
)
val list: List<Movie> by lazy {
setupMovies()
}
private var count: Long = 0
private fun setupMovies(): List<Movie> {
val title = arrayOf(
"设备大屏"
)
val description = ""
val studio = arrayOf(
"设备大屏"
)
val webUrl = arrayOf(
"https://public.qixiaocloud.com/webroot/decision/view/duchamp?viewlet=huainanhuachen%252F%25E6%25B6%2588%25E6%25AF%2592%25E5%2589%2582%25E8%25BD%25A6%25E9%2597%25B4%25E7%25AE%25A1%25E7%2590%2586%25E9%25A9%25BE%25E9%25A9%25B6%25E8%2588%25B1.fvs&ref_t=design&ref_c=ae6d387f-6bcc-4d77-87d3-8625e7e48f67&page_number=1",
)
val bgImageUrl = arrayOf(
"https://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search/bg.jpg"
)
val cardImageUrl = arrayOf(
"https://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search/card.jpg"
)
val list = title.indices.map {
buildMovieInfo(
title[it],
description,
studio[it],
cardImageUrl[it],
bgImageUrl[it],
webUrl[it],
)
}
return list
}
private fun buildMovieInfo(
title: String,
description: String,
studio: String,
cardImageUrl: String,
backgroundImageUrl: String,
webUrl: String
): Movie {
val movie = Movie()
movie.id = count++
movie.title = title
movie.description = description
movie.studio = studio
movie.cardImageUrl = cardImageUrl
movie.backgroundImageUrl = backgroundImageUrl
movie.webUrl = webUrl
return movie
}
}