Relative Content

Tag Archive for androidkotlinandroid-jetpack-compose

How does SelectionContainer support long pressing to select all by default

SelectionContainer { Text( text = valueText, style = if (lowKey) MaterialTheme.typography.bodyMedium else MaterialTheme.typography.bodyLarge, lineHeight = MaterialTheme.typography.bodyMedium.lineHeight, color = if (lowKey) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onBackground, maxLines = 5, overflow = TextOverflow.Ellipsis, ) } The above code, if the text content is relatively long, such as 200 characters, I will only select a small portion of the text […]

How does SelectionContainer support long pressing to select all by default

SelectionContainer { Text( text = valueText, style = if (lowKey) MaterialTheme.typography.bodyMedium else MaterialTheme.typography.bodyLarge, lineHeight = MaterialTheme.typography.bodyMedium.lineHeight, color = if (lowKey) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onBackground, maxLines = 5, overflow = TextOverflow.Ellipsis, ) } The above code, if the text content is relatively long, such as 200 characters, I will only select a small portion of the text […]

VerticalPager in Jetpack Compose keeps scrolling without stopping between pages

I’m building a vertical video feed in Jetpack Compose using VerticalPager to display a list of video URLs. I want each video to play only when the corresponding page is visible. However, I am facing an issue where the pager keeps scrolling continuously without stopping, and it resets back to page 0 after scrolling.