Skip to content

Commit 329b5ff

Browse files
committed
Move Import/Export buttons to top of profile editor form
1 parent c0fc742 commit 329b5ff

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

android/app/src/main/java/com/gooserelay/gooserelayvpn/ui/profiles/ProfilesScreen.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import androidx.compose.material3.Card
3131
import androidx.compose.material3.CardDefaults
3232
import androidx.compose.material3.Icon
3333
import androidx.compose.material3.IconButton
34+
import androidx.compose.material3.OutlinedButton
3435
import androidx.compose.material3.OutlinedTextField
3536
import androidx.compose.material3.Scaffold
3637
import androidx.compose.material3.Switch
@@ -255,6 +256,10 @@ private fun ProfileEditorDialog(
255256
modifier = Modifier.verticalScroll(rememberScrollState()),
256257
verticalArrangement = Arrangement.spacedBy(8.dp)
257258
) {
259+
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.fillMaxWidth()) {
260+
OutlinedButton(onClick = { importLauncher.launch(arrayOf("application/json", "text/plain", "*/*")) }, modifier = Modifier.weight(1f)) { Text("Import JSON") }
261+
OutlinedButton(onClick = { exportLauncher.launch("goose_profile.json") }, modifier = Modifier.weight(1f)) { Text("Export JSON") }
262+
}
258263
OutlinedTextField(value = name, onValueChange = { name = it }, label = { Text("Profile Name") })
259264
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
260265
Text("Debug Timing")
@@ -266,10 +271,6 @@ private fun ProfileEditorDialog(
266271
OutlinedTextField(value = sniCsv, onValueChange = { sniCsv = it }, label = { Text("sni (comma separated)") })
267272
OutlinedTextField(value = scriptKeysText, onValueChange = { scriptKeysText = it }, label = { Text("script_keys (one per line)") }, minLines = 3)
268273
OutlinedTextField(value = tunnelKey, onValueChange = { tunnelKey = it }, label = { Text("tunnel_key") })
269-
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
270-
Button(onClick = { importLauncher.launch(arrayOf("application/json", "text/plain", "*/*")) }) { Text("Import JSON") }
271-
Button(onClick = { exportLauncher.launch("goose_profile.json") }) { Text("Export JSON") }
272-
}
273274
validationError?.let {
274275
Spacer(Modifier.height(8.dp))
275276
Text(it, color = MdvColor.Error)

0 commit comments

Comments
 (0)