This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ticker { | |
val lastClosePrice = ... | |
fun refreshRealTimePrice(price: Double) { | |
val displayColor = when { | |
price < lastClosePrice: Colors.GREE | |
price > lastClosePrice: Colors.RED | |
price = lastClosePrice: Colors.WHITE | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MovieInfoWidget( | |
posterUrl: String? = null, | |
movieName: String? = null, | |
isBookmark: Boolean = false, | |
rating: Float = 0.0f, | |
ratingTotalCountText: String? = null, | |
genres: String? = null, | |
releaseDateText: String? = null, | |
runtimeText: String? = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MovieRatingWidget( | |
rating: Float = 0.0f, | |
textRating: String? = null | |
) { | |
Row( | |
verticalAlignment = Alignment.CenterVertically, | |
modifier = Modifier.padding(top = 8.dp) | |
) { | |
RatingBar( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MovieInfoWidget( | |
posterUrl: String? = null, | |
movieName: String? = null, | |
isBookmark: Boolean = false, | |
rating: Float = 0.0f, | |
ratingTotalCountText: String? = null, | |
genres: String? = null, | |
releaseDateText: String? = null, | |
runtimeText: String? = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Preview | |
@Composable | |
fun MovieInfoWidgetPreview() { | |
MovieInfoWidget( | |
posterUrl = "https://image.tmdb.org/t/p/w780//or06FN3Dka5tukK1e9sl16pB3iy.jpg", | |
movieName = "Star Wars", | |
isBookmark = false, | |
rating = 4.3f, | |
ratingTotalCountText = "10 k", | |
genres = "Action, Science Fictions, Adventure", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MovieInfoWidget( | |
posterUrl: String? = null, | |
movieName: String? = null, | |
isBookmark: Boolean = false, | |
rating: Float = 0.0f, | |
ratingTotalCountText: String? = null, | |
genres: String? = null, | |
releaseDateText: String? = null, | |
runtimeText: String? = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MovieInfoWidget( | |
posterUrl: String? = null, | |
movieName: String? = null, | |
isBookmark: Boolean = false, | |
rating: Float = 0.0f, | |
ratingTotalCountText: String? = null, | |
genres: String? = null, | |
releaseDateText: String? = null, | |
runtimeText: String? = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Preview | |
@Composable | |
fun MovieInfoWidgetPreview() { | |
MovieInfoWidget( | |
posterUrl = "https://image.tmdb.org/t/p/w780//or06FN3Dka5tukK1e9sl16pB3iy.jpg", | |
movieName = "Star Wars", | |
isBookmark = false, | |
rating = 4.3f, | |
ratingTotalCountText = "10 k", | |
genres = "Action, Science Fictions, Adventure", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun bindData(movie: MovieDetail) { | |
val textMovieName = findViewById(R.id.textMovieName) | |
textMovieName.text = movie.name | |
val ratingBar = findViewById(R.id.movieRatingBar) | |
ratingBar.rating = movie.rating | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.enginebai.moviehunt # Root Package | |
├── data # For data modeling layer | |
│ ├── local # Local persistence database | |
| │ ├── dao # Data Access Object for Room | |
| | ├── model # Model classes | |
│ ├── remote # Remote data source | |
│ └── repo # Repositories for single source of data | |
| | |
├── di # Dependency injection modules | |
│ |