输入url参数对话框

pull/1705/head
kunfei 3 years ago
parent bceb7e0838
commit aad42a44a0
  1. 27
      app/src/main/java/io/legado/app/ui/widget/UrlOptionDialog.kt

@ -2,19 +2,20 @@ package io.legado.app.ui.widget
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.AlertDialog
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material.TextField
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import io.legado.app.R
import io.legado.app.model.analyzeRule.AnalyzeUrl
import io.legado.app.ui.theme.AppTheme
@ -49,8 +50,15 @@ fun UrlOptionDialog(openState: MutableState<Boolean>, confirm: (String) -> Unit)
Text(text = "url参数")
},
text = {
Surface(
modifier = Modifier
.fillMaxSize()
.wrapContentSize(align = Alignment.Center),
color = MaterialTheme.colors.background
) {
UrlOptionView(urlOption = urlOption)
}
}
)
}
}
@ -95,7 +103,10 @@ fun UrlOptionView(urlOption: AnalyzeUrl.UrlOption) {
}
urlOption.setJs(js.value)
Column(Modifier.verticalScroll(rememberScrollState())) {
Column(
Modifier
.verticalScroll(rememberScrollState())
) {
Row {
LabelledCheckBox(
checked = useWebView.value,
@ -171,3 +182,9 @@ fun UrlOptionView(urlOption: AnalyzeUrl.UrlOption) {
)
}
}
@Preview
@Composable
fun PreviewUrlOption() {
UrlOptionView(urlOption = AnalyzeUrl.UrlOption())
}
Loading…
Cancel
Save