@@ -13,14 +13,14 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
1313import androidx.compose.foundation.layout.Arrangement
1414import androidx.compose.foundation.layout.Box
1515import androidx.compose.foundation.layout.Column
16- import androidx.compose.foundation.layout.PaddingValues
1716import androidx.compose.foundation.layout.Row
1817import androidx.compose.foundation.layout.Spacer
1918import androidx.compose.foundation.layout.WindowInsets
2019import androidx.compose.foundation.layout.fillMaxWidth
2120import androidx.compose.foundation.layout.height
2221import androidx.compose.foundation.layout.padding
2322import androidx.compose.foundation.layout.size
23+ import androidx.compose.foundation.layout.width
2424import androidx.compose.foundation.lazy.LazyColumn
2525import androidx.compose.foundation.lazy.LazyRow
2626import androidx.compose.foundation.lazy.items
@@ -33,6 +33,8 @@ import androidx.compose.material3.ExperimentalMaterial3Api
3333import androidx.compose.material3.ExtendedFloatingActionButton
3434import androidx.compose.material3.Icon
3535import androidx.compose.material3.IconButton
36+ import androidx.compose.material3.LocalContentColor
37+ import androidx.compose.material3.LocalTextStyle
3638import androidx.compose.material3.MaterialTheme
3739import androidx.compose.material3.OutlinedTextField
3840import androidx.compose.material3.SmallFloatingActionButton
@@ -54,12 +56,14 @@ import androidx.compose.ui.Modifier
5456import androidx.compose.ui.draw.rotate
5557import androidx.compose.ui.graphics.Color
5658import androidx.compose.ui.input.nestedscroll.nestedScroll
59+ import androidx.compose.ui.platform.LocalDensity
5760import androidx.compose.ui.res.painterResource
5861import androidx.compose.ui.semantics.Role
5962import androidx.compose.ui.text.font.FontWeight
6063import androidx.compose.ui.text.style.TextOverflow
6164import androidx.compose.ui.unit.dp
6265import androidx.hilt.navigation.compose.hiltViewModel
66+ import com.dergoogler.mmrl.ext.iconSize
6367import com.dergoogler.mmrl.ext.none
6468import com.dergoogler.mmrl.platform.content.LocalModule
6569import com.dergoogler.mmrl.platform.file.SuFile
@@ -156,6 +160,7 @@ fun FileExplorerScreen(
156160 isSelectionMode = false
157161 selectedFiles = emptySet()
158162 }
163+
159164 state.canGoBack -> viewModel.navigateBack()
160165 else -> navigator.popBackStack()
161166 }
@@ -170,7 +175,24 @@ fun FileExplorerScreen(
170175 Toolbar (
171176 title = {
172177 ToolbarTitle (
173- title = if (isSelectionMode) " ${selectedFiles.size} selected" else module.name,
178+ titleContent = {
179+ Text (
180+ text = if (isSelectionMode) " ${selectedFiles.size} selected" else module.name,
181+ maxLines = 1 ,
182+ overflow = TextOverflow .Ellipsis ,
183+ color = LocalContentColor .current
184+ )
185+ },
186+ subtitleContent = {
187+ state.currentPath?.let { currentPath ->
188+ PathBreadcrumb (
189+ currentPath = currentPath,
190+ onPathClick = { path ->
191+ viewModel.navigateToPath(path)
192+ }
193+ )
194+ }
195+ }
174196 )
175197 },
176198 scrollBehavior = scrollBehavior,
@@ -264,16 +286,6 @@ fun FileExplorerScreen(
264286 List (
265287 modifier = Modifier .padding(innerPadding),
266288 ) {
267- // Path breadcrumb
268- state.currentPath?.let { currentPath ->
269- PathBreadcrumb (
270- currentPath = currentPath,
271- onPathClick = { path ->
272- viewModel.navigateToPath(path)
273- }
274- )
275- }
276-
277289 // Error message
278290 state.errorMessage?.let { error ->
279291 Card (
@@ -397,7 +409,7 @@ private fun ExpandableFab(
397409 onCreateFile : () -> Unit ,
398410 onImportFile : () -> Unit ,
399411 onImportMultipleFiles : () -> Unit ,
400- isLoading : Boolean
412+ isLoading : Boolean ,
401413) {
402414 val rotation by animateFloatAsState(
403415 targetValue = if (isExpanded) 45f else 0f ,
@@ -484,7 +496,7 @@ enum class CreateType {
484496private fun CreateDialog (
485497 type : CreateType ,
486498 onDismiss : () -> Unit ,
487- onConfirm : (String , String? ) -> Unit
499+ onConfirm : (String , String? ) -> Unit ,
488500) {
489501 var name by remember { mutableStateOf(" " ) }
490502 var content by remember { mutableStateOf(" " ) }
@@ -550,29 +562,35 @@ private fun PathBreadcrumb(
550562
551563 LazyRow (
552564 modifier = Modifier .fillMaxWidth(),
553- contentPadding = PaddingValues (
554- vertical = 8 .dp,
555- horizontal = 16 .dp
556- ),
557565 horizontalArrangement = Arrangement .spacedBy(4 .dp),
566+ verticalAlignment = Alignment .CenterVertically
558567 ) {
559568 itemsIndexed(
560569 items = pathParts,
561570 key = { index, item -> item.path + index }
562571
563572 ) { index, path ->
573+ val density = LocalDensity .current
574+ val textStyle = LocalTextStyle .current
575+ val iconSize = Modifier .iconSize(
576+ density = density,
577+ textStyle = textStyle,
578+ scaling = 1.0f
579+ )
580+
564581 if (index > 0 ) {
565582 Icon (
566583 painter = painterResource(R .drawable.chevron_right),
567584 contentDescription = null ,
568- modifier = Modifier .size( 16 .dp) ,
585+ modifier = iconSize ,
569586 tint = MaterialTheme .colorScheme.onSurfaceVariant
570587 )
588+
589+ Spacer (Modifier .width(4 .dp))
571590 }
572591
573592 Text (
574593 text = if (index == 0 && path.name.isEmpty()) " Root" else path.name,
575- style = MaterialTheme .typography.bodySmall,
576594 color = if (index == pathParts.lastIndex) {
577595 MaterialTheme .colorScheme.primary
578596 } else {
@@ -594,7 +612,7 @@ private fun ListScope.FileItemRow(
594612 isSelected : Boolean = false,
595613 isSelectionMode : Boolean = false,
596614 onClick : () -> Unit ,
597- onLongClick : () -> Unit = {}
615+ onLongClick : () -> Unit = {},
598616) {
599617 val interactionSource = remember { MutableInteractionSource () }
600618
0 commit comments