fix(core/scripting): ff menu theme

This commit is contained in:
rhunk
2024-02-05 21:50:38 +01:00
parent c3015928d1
commit 284317c67c
2 changed files with 17 additions and 8 deletions

View File

@@ -31,8 +31,8 @@ abstract class ConfigInterface : AbstractBinding("config", BindingSide.COMMON) {
@JSFunction fun getDouble(key: String): Double? = getDouble(key, null)
@JSFunction fun getDouble(key: String, defaultValue: Double?): Double? = get(key, defaultValue.toString())?.toDoubleOrNull() ?: defaultValue
@JSFunction fun getBoolean(key: String): Boolean? = getBoolean(key, null)
@JSFunction fun getBoolean(key: String, defaultValue: Boolean?): Boolean? = get(key, defaultValue.toString())?.toBoolean() ?: defaultValue
@JSFunction fun getBoolean(key: String): Boolean = getBoolean(key, false)
@JSFunction fun getBoolean(key: String, defaultValue: Boolean): Boolean = get(key, defaultValue.toString())?.toBoolean() ?: defaultValue
@JSFunction fun getLong(key: String): Long? = getLong(key, null)
@JSFunction fun getLong(key: String, defaultValue: Long?): Long? = get(key, defaultValue.toString())?.toLongOrNull() ?: defaultValue

View File

@@ -12,7 +12,11 @@ import android.widget.CompoundButton
import android.widget.LinearLayout
import android.widget.ProgressBar
import android.widget.Switch
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@@ -373,12 +377,17 @@ class FriendFeedInfoMenu : AbstractMenu() {
orientation = LinearLayout.VERTICAL
addView(createComposeView(view.context) {
ScriptInterface(interfaceBuilder = remember {
interfaceManager.buildInterface(EnumScriptInterface.FRIEND_FEED_CONTEXT_MENU, mapOf(
"conversationId" to conversationId,
"userId" to targetUser
))
} ?: return@createComposeView)
Surface(
modifier = Modifier.fillMaxWidth(),
color = MaterialTheme.colorScheme.surface
) {
ScriptInterface(interfaceBuilder = remember {
interfaceManager.buildInterface(EnumScriptInterface.FRIEND_FEED_CONTEXT_MENU, mapOf(
"conversationId" to conversationId,
"userId" to targetUser
))
} ?: return@Surface)
}
})
})
}