mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2025-12-06 06:41:54 +00:00
Change cityName parameter to location in WeatherForecastData.kt
This commit is contained in:
parent
08abaebbd8
commit
34dbbf2af3
@ -5,8 +5,8 @@ import java.time.LocalDateTime
|
|||||||
/**
|
/**
|
||||||
* Data class representing weather information to be displayed in the Weather Card.
|
* Data class representing weather information to be displayed in the Weather Card.
|
||||||
*/
|
*/
|
||||||
data class WeatherForecastData(
|
internal data class WeatherForecastData(
|
||||||
val cityName: String,
|
val location: Location,
|
||||||
val temperature: Float,
|
val temperature: Float,
|
||||||
val currentTime: LocalDateTime,
|
val currentTime: LocalDateTime,
|
||||||
val windSpeed: Float,
|
val windSpeed: Float,
|
||||||
@ -16,7 +16,7 @@ data class WeatherForecastData(
|
|||||||
) {
|
) {
|
||||||
companion object Companion {
|
companion object Companion {
|
||||||
val EMPTY: WeatherForecastData = WeatherForecastData(
|
val EMPTY: WeatherForecastData = WeatherForecastData(
|
||||||
"",
|
Location("", ""),
|
||||||
0f,
|
0f,
|
||||||
LocalDateTime.now(),
|
LocalDateTime.now(),
|
||||||
0f,
|
0f,
|
||||||
|
|||||||
@ -46,7 +46,7 @@ internal class WeatherForecastService(private val cs: CoroutineScope) {
|
|||||||
delay(100)
|
delay(100)
|
||||||
|
|
||||||
return WeatherForecastData(
|
return WeatherForecastData(
|
||||||
cityName = location.name,
|
location = location,
|
||||||
temperature = temperature,
|
temperature = temperature,
|
||||||
currentTime = LocalDateTime.of(LocalDate.now(), getRandomTime()),
|
currentTime = LocalDateTime.of(LocalDate.now(), getRandomTime()),
|
||||||
windSpeed = windSpeed,
|
windSpeed = windSpeed,
|
||||||
|
|||||||
@ -60,7 +60,7 @@ internal fun WeatherDetailsCard(
|
|||||||
) {
|
) {
|
||||||
// City name
|
// City name
|
||||||
Text(
|
Text(
|
||||||
text = weatherForecastData.cityName,
|
text = weatherForecastData.location.id,
|
||||||
color = textColor,
|
color = textColor,
|
||||||
fontSize = 28.sp,
|
fontSize = 28.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user