Fix plugin sdk visibility modifiers
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package de.mm20.launcher2.plugin.config
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
fun SearchPluginConfig(bundle: Bundle): SearchPluginConfig? {
|
||||
return SearchPluginConfig(
|
||||
storageStrategy = valueOfOrElse(
|
||||
bundle.getString(
|
||||
"storageStrategy",
|
||||
StorageStrategy.StoreCopy.name
|
||||
),
|
||||
StorageStrategy.StoreCopy,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun valueOfOrElse(value: String, default: StorageStrategy): StorageStrategy {
|
||||
return try {
|
||||
StorageStrategy.valueOf(value)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
default
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package de.mm20.launcher2.plugin.config
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
fun WeatherPluginConfig(bundle: Bundle): WeatherPluginConfig {
|
||||
return WeatherPluginConfig(
|
||||
minUpdateInterval = bundle.getLong(
|
||||
"minUpdateInterval",
|
||||
60 * 60 * 1000L
|
||||
),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user