|
|
|
@ -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,7 +50,14 @@ fun UrlOptionDialog(openState: MutableState<Boolean>, confirm: (String) -> Unit) |
|
|
|
|
Text(text = "url参数") |
|
|
|
|
}, |
|
|
|
|
text = { |
|
|
|
|
UrlOptionView(urlOption = urlOption) |
|
|
|
|
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, |
|
|
|
@ -170,4 +181,10 @@ fun UrlOptionView(urlOption: AnalyzeUrl.UrlOption) { |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Preview |
|
|
|
|
@Composable |
|
|
|
|
fun PreviewUrlOption() { |
|
|
|
|
UrlOptionView(urlOption = AnalyzeUrl.UrlOption()) |
|
|
|
|
} |