Fix plugin sdk visibility modifiers
This commit is contained in:
@@ -8,6 +8,7 @@ import android.os.Bundle
|
||||
import android.os.CancellationSignal
|
||||
import de.mm20.launcher2.plugin.config.SearchPluginConfig
|
||||
import de.mm20.launcher2.plugin.contracts.SearchPluginContract
|
||||
import de.mm20.launcher2.sdk.config.toBundle
|
||||
import de.mm20.launcher2.sdk.utils.launchWithCancellationSignal
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package de.mm20.launcher2.sdk.config
|
||||
|
||||
import android.os.Bundle
|
||||
import de.mm20.launcher2.plugin.config.SearchPluginConfig
|
||||
|
||||
internal fun SearchPluginConfig.toBundle(): Bundle {
|
||||
return Bundle().apply {
|
||||
putString("storageStrategy", storageStrategy.name)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package de.mm20.launcher2.sdk.config
|
||||
|
||||
import android.os.Bundle
|
||||
import de.mm20.launcher2.plugin.config.WeatherPluginConfig
|
||||
|
||||
internal fun WeatherPluginConfig.toBundle(): Bundle {
|
||||
return Bundle().apply {
|
||||
putLong("minUpdateInterval", minUpdateInterval)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@ package de.mm20.launcher2.sdk.permissions
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class PermissionData(
|
||||
internal data class PermissionData(
|
||||
val granted: Set<String> = emptySet(),
|
||||
)
|
||||
+1
-1
@@ -10,7 +10,7 @@ import de.mm20.launcher2.sdk.databinding.ActivityRequestPermissionBinding
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class RequestPermissionActivity: Activity() {
|
||||
internal class RequestPermissionActivity: Activity() {
|
||||
|
||||
private lateinit var binding: ActivityRequestPermissionBinding
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
fun <T> launchWithCancellationSignal(
|
||||
internal fun <T> launchWithCancellationSignal(
|
||||
cancellationSignal: CancellationSignal?,
|
||||
block: suspend CoroutineScope.() -> T
|
||||
): T {
|
||||
|
||||
@@ -12,6 +12,7 @@ import de.mm20.launcher2.plugin.PluginType
|
||||
import de.mm20.launcher2.plugin.config.WeatherPluginConfig
|
||||
import de.mm20.launcher2.plugin.contracts.WeatherPluginContract
|
||||
import de.mm20.launcher2.sdk.base.BasePluginProvider
|
||||
import de.mm20.launcher2.sdk.config.toBundle
|
||||
import de.mm20.launcher2.sdk.ktx.formatToString
|
||||
import de.mm20.launcher2.sdk.utils.launchWithCancellationSignal
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -22,7 +23,7 @@ import kotlin.math.absoluteValue
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
abstract class WeatherProvider(
|
||||
val config: WeatherPluginConfig,
|
||||
private val config: WeatherPluginConfig,
|
||||
) : BasePluginProvider() {
|
||||
override fun getPluginType(): PluginType {
|
||||
return PluginType.Weather
|
||||
@@ -32,6 +33,10 @@ abstract class WeatherProvider(
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getPluginConfig(): Bundle {
|
||||
return config.toBundle()
|
||||
}
|
||||
|
||||
override fun query(
|
||||
uri: Uri,
|
||||
projection: Array<out String>?,
|
||||
|
||||
Reference in New Issue
Block a user