floating nav bar interraction
This commit is contained in:
@@ -21,8 +21,6 @@ import androidx.compose.foundation.lazy.items
|
|||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.DriveFileMove
|
|
||||||
import androidx.compose.material.icons.filled.MergeType
|
|
||||||
import androidx.compose.material.icons.filled.Search
|
import androidx.compose.material.icons.filled.Search
|
||||||
import androidx.compose.material3.Card
|
import androidx.compose.material3.Card
|
||||||
import androidx.compose.material3.CardDefaults
|
import androidx.compose.material3.CardDefaults
|
||||||
@@ -68,6 +66,7 @@ import com.vaultdrop.mobile.ui.components.icon
|
|||||||
import com.vaultdrop.mobile.ui.components.rememberSelectionState
|
import com.vaultdrop.mobile.ui.components.rememberSelectionState
|
||||||
import com.vaultdrop.mobile.ui.navigation.FloatingNavBar
|
import com.vaultdrop.mobile.ui.navigation.FloatingNavBar
|
||||||
import com.vaultdrop.mobile.ui.navigation.NavTab
|
import com.vaultdrop.mobile.ui.navigation.NavTab
|
||||||
|
import com.vaultdrop.mobile.ui.navigation.SelectionNavBar
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@@ -123,30 +122,7 @@ fun SearchScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
if (selection.active) {
|
if (!selection.active) {
|
||||||
IconButton(
|
|
||||||
onClick = { showMoveDialog = true },
|
|
||||||
enabled = selection.ids.isNotEmpty(),
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
Icons.Filled.DriveFileMove,
|
|
||||||
contentDescription = stringResource(R.string.move_files),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
IconButton(
|
|
||||||
onClick = {
|
|
||||||
val ids = selection.ids.toList()
|
|
||||||
selection.clear()
|
|
||||||
onBuildPdf(ids)
|
|
||||||
},
|
|
||||||
enabled = selection.ids.isNotEmpty(),
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
Icons.Filled.MergeType,
|
|
||||||
contentDescription = stringResource(R.string.selection_assemble),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ServerStatusBadge(
|
ServerStatusBadge(
|
||||||
status = connectionStatus,
|
status = connectionStatus,
|
||||||
onClick = connectionStatusViewModel::checkNow,
|
onClick = connectionStatusViewModel::checkNow,
|
||||||
@@ -156,7 +132,19 @@ fun SearchScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
FloatingNavBar(selected = selectedTab, onSelect = onTabSelected)
|
if (selection.active) {
|
||||||
|
SelectionNavBar(
|
||||||
|
onMove = { showMoveDialog = true },
|
||||||
|
onBuildPdf = {
|
||||||
|
val ids = selection.ids.toList()
|
||||||
|
selection.clear()
|
||||||
|
onBuildPdf(ids)
|
||||||
|
},
|
||||||
|
enabled = selection.ids.isNotEmpty(),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
FloatingNavBar(selected = selectedTab, onSelect = onTabSelected)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
|
snackbarHost = { SnackbarHost(hostState = snackbarHostState) },
|
||||||
) { padding ->
|
) { padding ->
|
||||||
|
|||||||
Reference in New Issue
Block a user