|
@@ -0,0 +1,152 @@
|
|
|
+package io.nexilis.alpha.ui.main
|
|
|
+
|
|
|
+import androidx.compose.foundation.Image
|
|
|
+import androidx.compose.foundation.background
|
|
|
+import androidx.compose.foundation.layout.Arrangement
|
|
|
+import androidx.compose.foundation.layout.Box
|
|
|
+import androidx.compose.foundation.layout.Column
|
|
|
+import androidx.compose.foundation.layout.Row
|
|
|
+import androidx.compose.foundation.layout.fillMaxSize
|
|
|
+import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
+import androidx.compose.foundation.layout.padding
|
|
|
+import androidx.compose.foundation.layout.size
|
|
|
+import androidx.compose.foundation.shape.CircleShape
|
|
|
+import androidx.compose.material.icons.Icons
|
|
|
+import androidx.compose.material.icons.automirrored.filled.VolumeUp
|
|
|
+import androidx.compose.material.icons.filled.CallEnd
|
|
|
+import androidx.compose.material.icons.filled.Mic
|
|
|
+import androidx.compose.material.icons.filled.Person
|
|
|
+import androidx.compose.material3.Icon
|
|
|
+import androidx.compose.material3.IconButton
|
|
|
+import androidx.compose.material3.Text
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.draw.clip
|
|
|
+import androidx.compose.ui.graphics.Color
|
|
|
+import androidx.compose.ui.graphics.vector.ImageVector
|
|
|
+import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
|
|
+import androidx.compose.ui.text.font.FontWeight
|
|
|
+import androidx.compose.ui.tooling.preview.Preview
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
+import androidx.compose.ui.unit.sp
|
|
|
+import io.nexilis.service.ui.RemoteView
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun CallLayoutScreen() {
|
|
|
+ Box(modifier = Modifier.fillMaxSize()) {
|
|
|
+ RemoteView(modifier = Modifier.fillMaxSize())
|
|
|
+ Column(
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxSize()
|
|
|
+ .background(Color.Transparent)
|
|
|
+ .padding(16.dp),
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
+ verticalArrangement = Arrangement.SpaceBetween
|
|
|
+ ) {
|
|
|
+ // Caller Info Section
|
|
|
+ CallerInfoSection()
|
|
|
+
|
|
|
+ // Call Status Section
|
|
|
+ CallStatusSection()
|
|
|
+
|
|
|
+ // Call Action Buttons Section
|
|
|
+ CallActionButtonsSection()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun CallerInfoSection() {
|
|
|
+ Column(
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
+ modifier = Modifier.padding(top = 50.dp)
|
|
|
+ ) {
|
|
|
+ // Caller Avatar
|
|
|
+ Image(
|
|
|
+ painter = rememberVectorPainter(Icons.Default.Person), // Replace with your drawable
|
|
|
+ contentDescription = "Caller Avatar",
|
|
|
+ modifier = Modifier
|
|
|
+ .size(120.dp)
|
|
|
+ .clip(CircleShape),
|
|
|
+ )
|
|
|
+
|
|
|
+ // Caller Name
|
|
|
+ Text(
|
|
|
+ text = "John Doe",
|
|
|
+ color = Color.White,
|
|
|
+ fontSize = 24.sp,
|
|
|
+ fontWeight = FontWeight.Bold,
|
|
|
+ modifier = Modifier.padding(top = 16.dp)
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun CallStatusSection() {
|
|
|
+ Text(
|
|
|
+ text = "Calling...",
|
|
|
+ color = Color.Gray,
|
|
|
+ fontSize = 18.sp,
|
|
|
+ modifier = Modifier.padding(vertical = 8.dp)
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun CallActionButtonsSection() {
|
|
|
+ Row(
|
|
|
+ horizontalArrangement = Arrangement.SpaceEvenly,
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxWidth()
|
|
|
+ .padding(bottom = 50.dp)
|
|
|
+ ) {
|
|
|
+ // Mute Button
|
|
|
+ CallActionButton(
|
|
|
+ icon = Icons.Default.Mic, // Replace with your drawable
|
|
|
+ onClick = { /* Handle mute action */ },
|
|
|
+ backgroundColor = Color.Gray
|
|
|
+ )
|
|
|
+
|
|
|
+ // Speaker Button
|
|
|
+ CallActionButton(
|
|
|
+ icon = Icons.AutoMirrored.Filled.VolumeUp, // Replace with your drawable
|
|
|
+ onClick = { /* Handle speaker action */ },
|
|
|
+ backgroundColor = Color.Gray
|
|
|
+ )
|
|
|
+
|
|
|
+ // End Call Button
|
|
|
+ CallActionButton(
|
|
|
+ icon = Icons.Default.CallEnd, // Replace with your drawable
|
|
|
+ onClick = { /* Handle end call action */ },
|
|
|
+ backgroundColor = Color.Red
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun CallActionButton(
|
|
|
+ icon: ImageVector,
|
|
|
+ onClick: () -> Unit,
|
|
|
+ backgroundColor: Color
|
|
|
+) {
|
|
|
+ IconButton(
|
|
|
+ onClick = onClick,
|
|
|
+ modifier = Modifier
|
|
|
+ .size(64.dp)
|
|
|
+ .clip(CircleShape)
|
|
|
+ .background(backgroundColor)
|
|
|
+ ) {
|
|
|
+ Icon(
|
|
|
+ painter = rememberVectorPainter(icon),
|
|
|
+ contentDescription = null,
|
|
|
+ tint = Color.White,
|
|
|
+ modifier = Modifier.size(32.dp)
|
|
|
+ )
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Preview(showBackground = true)
|
|
|
+@Composable
|
|
|
+fun PreviewCallLayoutScreen() {
|
|
|
+ CallLayoutScreen()
|
|
|
+}
|