Skip to content

Commit

Permalink
优化播放器菜单
Browse files Browse the repository at this point in the history
- 删除导致动画拖沓的 animateContentSize()
- 修复菜单按钮宽度不一致
  • Loading branch information
aaa1115910 committed Dec 22, 2024
1 parent af7c953 commit d5120bc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.aaa1115910.bv.component.controllers2

import android.content.Context
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.animateContentSize
import androidx.compose.animation.expandHorizontally
import androidx.compose.animation.shrinkHorizontally
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -217,8 +216,7 @@ private fun MenuList(
onFocusStateChange: (MenuFocusState) -> Unit
) {
Box(
modifier = modifier
.animateContentSize(),
modifier = modifier,
contentAlignment = Alignment.Center
) {
when (selectedNavMenu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fun ClosedCaptionMenuList(
verticalAlignment = Alignment.CenterVertically
) {
val menuItemsModifier = Modifier
.width(200.dp)
.width(216.dp)
.padding(horizontal = 8.dp)
AnimatedVisibility(visible = focusState.focusState != MenuFocusState.MenuNav) {
when (selectedClosedCaptionMenuItem) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.aaa1115910.bv.component.controllers2.playermenu

import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.lazy.LazyColumn
Expand All @@ -26,7 +25,6 @@ fun MenuNavList(

LazyColumn(
modifier = modifier
.animateContentSize()
.then(focusRestorerModifiers.parentModifier),
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(16.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun PictureMenuList(
verticalAlignment = Alignment.CenterVertically
) {
val menuItemsModifier = Modifier
.width(200.dp)
.width(216.dp)
.padding(horizontal = 8.dp)
AnimatedVisibility(visible = focusState.focusState != MenuFocusState.MenuNav) {
when (selectedPictureMenuItem) {
Expand Down

0 comments on commit d5120bc

Please sign in to comment.