|
|
@@ -1,10 +1,15 @@
|
|
|
package org.sirekanyan.outline.ui
|
|
|
|
|
|
+import android.widget.Toast
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
+import androidx.compose.foundation.layout.Row
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.text.KeyboardActions
|
|
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
|
+import androidx.compose.material3.Checkbox
|
|
|
+import androidx.compose.material3.LocalContentColor
|
|
|
+import androidx.compose.material3.MaterialTheme
|
|
|
import androidx.compose.material3.OutlinedTextField
|
|
|
import androidx.compose.material3.Text
|
|
|
import androidx.compose.runtime.Composable
|
|
|
@@ -13,9 +18,11 @@ import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
|
import androidx.compose.runtime.setValue
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.focus.FocusRequester
|
|
|
import androidx.compose.ui.focus.focusRequester
|
|
|
+import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.compose.ui.text.input.ImeAction
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import kotlinx.coroutines.launch
|
|
|
@@ -56,7 +63,7 @@ fun AddServerContent(dao: ApiUrlDao, state: MainState) {
|
|
|
onValueChange = { draft = it.trim() },
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
- .padding(horizontal = 16.dp, vertical = 24.dp)
|
|
|
+ .padding(16.dp, 24.dp, 16.dp, 8.dp)
|
|
|
.focusRequester(focusRequester),
|
|
|
label = { Text("Management API URL") },
|
|
|
placeholder = { Text("https://xx.xx.xx.xx:xxx/xxxxx") },
|
|
|
@@ -69,5 +76,20 @@ fun AddServerContent(dao: ApiUrlDao, state: MainState) {
|
|
|
LaunchedEffect(Unit) {
|
|
|
focusRequester.requestFocus()
|
|
|
}
|
|
|
+ Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
+ val context = LocalContext.current
|
|
|
+ Checkbox(
|
|
|
+ checked = true,
|
|
|
+ onCheckedChange = {
|
|
|
+ Toast.makeText(context, "Cannot be changed for now", Toast.LENGTH_SHORT).show()
|
|
|
+ },
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ text = "Trust self-signed certificates",
|
|
|
+ modifier = Modifier.padding(end = 16.dp),
|
|
|
+ style = MaterialTheme.typography.bodySmall,
|
|
|
+ color = LocalContentColor.current.copy(alpha = 0.66f),
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|