Skip to content

Commit

Permalink
fix(ProfileNetworkError): make dialog scrollable and add top/bottom p…
Browse files Browse the repository at this point in the history
…adding into dialog (#350)
  • Loading branch information
koimoee authored Dec 25, 2024
1 parent 0f556d8 commit 00e9008
Showing 1 changed file with 36 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import android.content.ClipboardManager
import android.content.Context
import androidx.compose.ui.platform.LocalContext
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.verticalScroll
import androidx.compose.foundation.rememberScrollState
import androidx.compose.runtime.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -59,27 +61,41 @@ fun ProfileNetworkError(
val context = LocalContext.current

if (showDialog) {
AlertDialog(
onDismissRequest = { showDialog = false },
confirmButton = {
TextButton(onClick = { showDialog = false }) {
Text("OK")
}
},
dismissButton = {
TextButton(
onClick = {
copyToClipboard(context, error)
showDialog = false
Box(
modifier = Modifier
.fillMaxSize()
.padding(vertical = 25.dp)
) {
AlertDialog(
onDismissRequest = { showDialog = false },
confirmButton = {
TextButton(onClick = { showDialog = false }) {
Text("OK")
}
) {
Text("Copy")
}
},
text = {
Text(text = error)
}
)
},
dismissButton = {
TextButton(
onClick = {
copyToClipboard(context, error)
showDialog = false
}
) {
Text("Copy")
}
},
text = {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.verticalScroll(rememberScrollState())
) {
Text(text = error)
}
},
modifier = Modifier.fillMaxWidth()
)
}
}

LaunchedEffect(Unit) {
Expand Down

0 comments on commit 00e9008

Please sign in to comment.