feat():build in local Android and run in honor pad.
This commit is contained in:
@@ -2,8 +2,11 @@ package io.github.miuzarte.scrcpyforandroid.pages
|
|||||||
|
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
|
import androidx.compose.foundation.horizontalScroll
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.lazy.LazyListState
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
@@ -706,3 +709,43 @@ private fun buildDetailsText(
|
|||||||
}
|
}
|
||||||
return details.toString()
|
return details.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private data class BreadcrumbItem(
|
||||||
|
val path: String,
|
||||||
|
val text: String,
|
||||||
|
)
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun BreadcrumbBar(
|
||||||
|
items: List<BreadcrumbItem>,
|
||||||
|
onItemClick: (Int) -> Unit,
|
||||||
|
highlightIndex: Int,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.horizontalScroll(rememberScrollState())
|
||||||
|
.padding(horizontal = UiSpacing.Medium),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
items.forEachIndexed { index, item ->
|
||||||
|
if (index > 0) {
|
||||||
|
Text(
|
||||||
|
text = " / ",
|
||||||
|
color = colorScheme.onSurface.copy(alpha = 0.5f),
|
||||||
|
fontSize = 12.sp,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val isHighlighted = index == highlightIndex
|
||||||
|
Text(
|
||||||
|
text = item.text,
|
||||||
|
color = if (isHighlighted) colorScheme.primary else colorScheme.onSurface,
|
||||||
|
fontSize = 12.sp,
|
||||||
|
modifier = Modifier
|
||||||
|
.clickable(onClick = { onItemClick(index) })
|
||||||
|
.padding(vertical = 4.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user