Implement plugin weather provider
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package de.mm20.launcher2.plugin.config
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
data class WeatherPluginConfig(
|
||||
/**
|
||||
* Minimum time (in ms) that needs to pass before the provider can be queried again.
|
||||
@@ -7,4 +9,22 @@ data class WeatherPluginConfig(
|
||||
* or weather provider.
|
||||
*/
|
||||
val minUpdateInterval: Long = 60 * 60 * 1000L,
|
||||
)
|
||||
) {
|
||||
|
||||
fun toBundle(): Bundle {
|
||||
return Bundle().apply {
|
||||
putLong("minUpdateInterval", minUpdateInterval)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
operator fun invoke(bundle: Bundle): WeatherPluginConfig {
|
||||
return WeatherPluginConfig(
|
||||
minUpdateInterval = bundle.getLong(
|
||||
"minUpdateInterval",
|
||||
60 * 60 * 1000L
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ package de.mm20.launcher2.plugin.contracts
|
||||
|
||||
object WeatherPluginContract {
|
||||
object Paths {
|
||||
const val Weather = "weather"
|
||||
const val Forecasts = "forecasts"
|
||||
const val Locations = "locations"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user