Apis benerin pitur
This commit is contained in:
parent
6420bda378
commit
18926eb3e2
@ -60,6 +60,7 @@ fun NotebookApp() {
|
||||
var showGoogleAppsMenu by remember { mutableStateOf(false) }
|
||||
var showSettingsMenu by remember { mutableStateOf(false) }
|
||||
var showAccountScreen by remember { mutableStateOf(false) }
|
||||
var chatInput by remember { mutableStateOf("") } // [BARU] State diangkat ke sini
|
||||
|
||||
if (showAccountScreen) {
|
||||
AccountScreen(onDismiss = { showAccountScreen = false })
|
||||
@ -70,7 +71,6 @@ fun NotebookApp() {
|
||||
TopAppBar(
|
||||
title = { Text("NoteBook") },
|
||||
actions = {
|
||||
// [DIHAPUS] Tombol Share
|
||||
Box {
|
||||
IconButton(onClick = { showSettingsMenu = true }) {
|
||||
Icon(Icons.Filled.Settings, contentDescription = "Settings")
|
||||
@ -96,6 +96,24 @@ fun NotebookApp() {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
}
|
||||
)
|
||||
},
|
||||
// [DIUBAH] Bottom bar sekarang menjadi bagian dari Scaffold utama
|
||||
bottomBar = {
|
||||
if (selectedTabIndex == 1) { // Hanya tampil jika tab "Chat" aktif
|
||||
BottomAppBar {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding(horizontal = 8.dp)) {
|
||||
OutlinedTextField(
|
||||
value = chatInput,
|
||||
onValueChange = { chatInput = it },
|
||||
placeholder = { Text("Message...") },
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
IconButton(onClick = { /* Kirim pesan, TODO */ }) {
|
||||
Icon(Icons.AutoMirrored.Filled.Send, contentDescription = "Send")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
) { innerPadding ->
|
||||
Column(modifier = Modifier.padding(innerPadding)) {
|
||||
@ -428,16 +446,12 @@ fun AddSourcesSheet(onDismiss: () -> Unit) {
|
||||
DropdownMenuItem(
|
||||
text = { Text("Perpustakaan Foto") },
|
||||
onClick = {
|
||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo))
|
||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
|
||||
showUploadMenu = false
|
||||
},
|
||||
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Ambil Video") },
|
||||
onClick = { /* TODO: Implement Camera Launcher */ showUploadMenu = false },
|
||||
leadingIcon = { Icon(Icons.Default.PhotoCamera, contentDescription = null) }
|
||||
)
|
||||
// [DIHAPUS] Opsi Ambil Video
|
||||
DropdownMenuItem(
|
||||
text = { Text("Pilih File") },
|
||||
onClick = {
|
||||
@ -480,32 +494,15 @@ fun AddSourcesSheet(onDismiss: () -> Unit) {
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ChatScreen() {
|
||||
// [DIUBAH] Scaffold dan state teks sudah tidak ada di sini lagi
|
||||
var showAddSourcesSheet by remember { mutableStateOf(false) }
|
||||
|
||||
if (showAddSourcesSheet) {
|
||||
AddSourcesSheet(onDismiss = { showAddSourcesSheet = false })
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
bottomBar = {
|
||||
BottomAppBar {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding(horizontal = 8.dp)) {
|
||||
OutlinedTextField(
|
||||
value = "",
|
||||
onValueChange = {},
|
||||
placeholder = { Text("Upload a source to get started") },
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
IconButton(onClick = { /* do something */ }) {
|
||||
Icon(Icons.AutoMirrored.Filled.Send, contentDescription = "Send")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
) { innerPadding ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(innerPadding)
|
||||
.fillMaxSize(),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
@ -525,7 +522,6 @@ fun ChatScreen() {
|
||||
Text("Upload a source")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@ -559,16 +555,12 @@ fun StudioScreen() {
|
||||
DropdownMenuItem(
|
||||
text = { Text("Perpustakaan Foto") },
|
||||
onClick = {
|
||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo))
|
||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) // Hanya gambar
|
||||
showUploadMenu = false
|
||||
},
|
||||
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text("Ambil Video") },
|
||||
onClick = { /* TODO: Implement Camera Launcher */ showUploadMenu = false },
|
||||
leadingIcon = { Icon(Icons.Default.PhotoCamera, contentDescription = null) }
|
||||
)
|
||||
// [DIHAPUS] Opsi Ambil Video
|
||||
DropdownMenuItem(
|
||||
text = { Text("Pilih File") },
|
||||
onClick = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user