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 showGoogleAppsMenu by remember { mutableStateOf(false) }
|
||||||
var showSettingsMenu by remember { mutableStateOf(false) }
|
var showSettingsMenu by remember { mutableStateOf(false) }
|
||||||
var showAccountScreen by remember { mutableStateOf(false) }
|
var showAccountScreen by remember { mutableStateOf(false) }
|
||||||
|
var chatInput by remember { mutableStateOf("") } // [BARU] State diangkat ke sini
|
||||||
|
|
||||||
if (showAccountScreen) {
|
if (showAccountScreen) {
|
||||||
AccountScreen(onDismiss = { showAccountScreen = false })
|
AccountScreen(onDismiss = { showAccountScreen = false })
|
||||||
@ -70,7 +71,6 @@ fun NotebookApp() {
|
|||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = { Text("NoteBook") },
|
title = { Text("NoteBook") },
|
||||||
actions = {
|
actions = {
|
||||||
// [DIHAPUS] Tombol Share
|
|
||||||
Box {
|
Box {
|
||||||
IconButton(onClick = { showSettingsMenu = true }) {
|
IconButton(onClick = { showSettingsMenu = true }) {
|
||||||
Icon(Icons.Filled.Settings, contentDescription = "Settings")
|
Icon(Icons.Filled.Settings, contentDescription = "Settings")
|
||||||
@ -96,6 +96,24 @@ fun NotebookApp() {
|
|||||||
Spacer(modifier = Modifier.width(8.dp))
|
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 ->
|
) { innerPadding ->
|
||||||
Column(modifier = Modifier.padding(innerPadding)) {
|
Column(modifier = Modifier.padding(innerPadding)) {
|
||||||
@ -428,16 +446,12 @@ fun AddSourcesSheet(onDismiss: () -> Unit) {
|
|||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text("Perpustakaan Foto") },
|
text = { Text("Perpustakaan Foto") },
|
||||||
onClick = {
|
onClick = {
|
||||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo))
|
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
|
||||||
showUploadMenu = false
|
showUploadMenu = false
|
||||||
},
|
},
|
||||||
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
// [DIHAPUS] Opsi Ambil Video
|
||||||
text = { Text("Ambil Video") },
|
|
||||||
onClick = { /* TODO: Implement Camera Launcher */ showUploadMenu = false },
|
|
||||||
leadingIcon = { Icon(Icons.Default.PhotoCamera, contentDescription = null) }
|
|
||||||
)
|
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text("Pilih File") },
|
text = { Text("Pilih File") },
|
||||||
onClick = {
|
onClick = {
|
||||||
@ -480,32 +494,15 @@ fun AddSourcesSheet(onDismiss: () -> Unit) {
|
|||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun ChatScreen() {
|
fun ChatScreen() {
|
||||||
|
// [DIUBAH] Scaffold dan state teks sudah tidak ada di sini lagi
|
||||||
var showAddSourcesSheet by remember { mutableStateOf(false) }
|
var showAddSourcesSheet by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
if (showAddSourcesSheet) {
|
if (showAddSourcesSheet) {
|
||||||
AddSourcesSheet(onDismiss = { showAddSourcesSheet = false })
|
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(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(innerPadding)
|
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
@ -525,7 +522,6 @@ fun ChatScreen() {
|
|||||||
Text("Upload a source")
|
Text("Upload a source")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@ -559,16 +555,12 @@ fun StudioScreen() {
|
|||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text("Perpustakaan Foto") },
|
text = { Text("Perpustakaan Foto") },
|
||||||
onClick = {
|
onClick = {
|
||||||
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo))
|
photoPickerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) // Hanya gambar
|
||||||
showUploadMenu = false
|
showUploadMenu = false
|
||||||
},
|
},
|
||||||
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
leadingIcon = { Icon(Icons.Default.PhotoLibrary, contentDescription = null) }
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
// [DIHAPUS] Opsi Ambil Video
|
||||||
text = { Text("Ambil Video") },
|
|
||||||
onClick = { /* TODO: Implement Camera Launcher */ showUploadMenu = false },
|
|
||||||
leadingIcon = { Icon(Icons.Default.PhotoCamera, contentDescription = null) }
|
|
||||||
)
|
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text("Pilih File") },
|
text = { Text("Pilih File") },
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user