Skip to content

Commit

Permalink
Merge pull request #5031 from aneesh1122/master
Browse files Browse the repository at this point in the history
Removed 'Expanded Lyrics' option
  • Loading branch information
fast4x authored Dec 22, 2024
2 parents 3127450 + b7f06e9 commit 5b31e37
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fun Controls(
modifier = Modifier
.animateContentSize()
) {
if ((!isLandscape) and (expandedplayer && !showlyricsthumbnail))
if ((!isLandscape) and ((expandedplayer || isShowingLyrics) && !showlyricsthumbnail))
Column(
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Bottom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ import it.fast4x.rimusic.utils.coverThumbnailAnimationKey
import it.fast4x.rimusic.utils.disableScrollingTextKey
import it.fast4x.rimusic.utils.discoverKey
import it.fast4x.rimusic.utils.doubleShadowDrop
import it.fast4x.rimusic.utils.expandedlyricsKey
import it.fast4x.rimusic.utils.extraspaceKey
import it.fast4x.rimusic.utils.fadingedgeKey
import it.fast4x.rimusic.utils.horizontalFadingEdge
Expand Down Expand Up @@ -352,7 +351,6 @@ fun Player(
var isShowingVisualizer by remember {
mutableStateOf(false)
}
val expandedlyrics by rememberPreference(expandedlyricsKey, true)

if (showBlurPlayerDialog) {

Expand Down Expand Up @@ -478,10 +476,6 @@ fun Player(

var updateBrush by remember { mutableStateOf(false) }

if (expandedlyrics && !isLandscape) {
if ((isShowingLyrics && !showlyricsthumbnail) || (isShowingVisualizer && !showvisthumbnail)) expandedplayer = true
else expandedplayer = false
}
if (showlyricsthumbnail) expandedplayer = false

LaunchedEffect(mediaItem.mediaId) {
Expand Down Expand Up @@ -1180,7 +1174,7 @@ fun Player(
!expandedplayertoggle &&
!showButtonPlayerDiscover &&
!showButtonPlayerVideo) ||
(expandedplayer && isShowingLyrics && !actionExpanded)
(!showlyricsthumbnail && isShowingLyrics && !actionExpanded)
) {
Row(
) {
Expand All @@ -1189,7 +1183,7 @@ fun Player(
Row(
modifier = Modifier
.align(if (isLandscape) Alignment.BottomEnd else Alignment.BottomCenter)
.requiredHeight(if (showNextSongsInPlayer && (!expandedplayer || !isShowingLyrics || miniQueueExpanded)) 90.dp else 50.dp)
.requiredHeight(if (showNextSongsInPlayer && (showlyricsthumbnail || (!isShowingLyrics || miniQueueExpanded))) 90.dp else 50.dp)
.fillMaxWidth(if (isLandscape) 0.8f else 1f)
.conditional(tapqueue) { clickable { showQueue = true } }
.background(
Expand All @@ -1213,7 +1207,7 @@ fun Player(
modifier = Modifier.fillMaxSize()
) {
if (showNextSongsInPlayer) {
if (!expandedplayer || !isShowingLyrics || miniQueueExpanded) {
if (showlyricsthumbnail || !isShowingLyrics || miniQueueExpanded) {
Row(
verticalAlignment = Alignment.Bottom,
horizontalArrangement = Arrangement.SpaceBetween,
Expand Down Expand Up @@ -1584,7 +1578,7 @@ fun Player(
.size(24.dp),
)
if (!isLandscape || ((playerType == PlayerType.Essential) && !showthumbnail))
if (expandedplayertoggle && (!showlyricsthumbnail) && !expandedlyrics)
if (expandedplayertoggle && !showlyricsthumbnail)
IconButton(
icon = R.drawable.minmax,
color = if (expandedplayer) colorPalette().accent else Color.Gray,
Expand Down Expand Up @@ -2517,8 +2511,8 @@ fun Player(
BoxWithConstraints(
contentAlignment = Alignment.Center,
modifier = Modifier
.conditional((screenWidth <= (screenHeight / 2)) && !expandedplayer) {height(screenWidth)}
.conditional((screenWidth > (screenHeight / 2)) || expandedplayer) {weight(1f)}
.conditional((screenWidth <= (screenHeight / 2)) && (showlyricsthumbnail || (!expandedplayer && !isShowingLyrics))) {height(screenWidth)}
.conditional((screenWidth > (screenHeight / 2)) || expandedplayer || (isShowingLyrics && !showlyricsthumbnail)) {weight(1f)}
) {

if (showthumbnail) {
Expand Down Expand Up @@ -2550,17 +2544,11 @@ fun Player(
beyondViewportPageCount = 2,
flingBehavior = fling,
modifier = modifier
//.padding(top = if (expandedplayer) 0.dp else 8.dp)
.padding(
all = (if (expandedplayer) 0.dp else if (thumbnailType == ThumbnailType.Modern) -(10.dp) else 0.dp).coerceAtLeast(
0.dp
)
)
/*.conditional(fadingedge && !expandedplayer) {
padding(
vertical = 2.5.dp
)
}*/
.conditional(fadingedge) {
VerticalfadingEdge2(fade = (if (expandedplayer) thumbnailFadeEx else thumbnailFade)*0.05f,showTopActionsBar,topPadding,expandedplayer)
}
Expand Down Expand Up @@ -2681,94 +2669,6 @@ fun Player(
}
}
}
/*
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(binder.player.getMediaItemAt(it).mediaMetadata.artworkUri.toString().resize(1200, 1200))
.build(),
contentDescription = "",
contentScale = ContentScale.Fit,
modifier = Modifier
.fillMaxWidth()
.padding(all = if (expandedplayer) carouselSize.size.dp else playerThumbnailSize.size.dp)
.zIndex(
if (it == pagerState.currentPage) 1f
else if (it == (pagerState.currentPage + 1) || it == (pagerState.currentPage - 1)) 0.85f
else if (it == (pagerState.currentPage + 2) || it == (pagerState.currentPage - 2)) 0.78f
else if (it == (pagerState.currentPage + 3) || it == (pagerState.currentPage - 3)) 0.73f
else if (it == (pagerState.currentPage + 4) || it == (pagerState.currentPage - 4)) 0.68f
else if (it == (pagerState.currentPage + 5) || it == (pagerState.currentPage - 5)) 0.63f
else 0.57f
)
.conditional(carousel)
{
graphicsLayer {
val pageOffSet =
((pagerState.currentPage - it) + pagerState.currentPageOffsetFraction).absoluteValue
alpha = lerp(
start = 0.9f,
stop = 1f,
fraction = 1f - pageOffSet.coerceIn(0f, 1f)
)
scaleY = lerp(
start = if (it == (pagerState.currentPage + 1) || it == (pagerState.currentPage - 1)) 0.85f
else if (it == (pagerState.currentPage + 2) || it == (pagerState.currentPage - 2)) 0.78f
else if (it == (pagerState.currentPage + 3) || it == (pagerState.currentPage - 3)) 0.73f
else if (it == (pagerState.currentPage + 4) || it == (pagerState.currentPage - 4)) 0.68f
else if (it == (pagerState.currentPage + 5) || it == (pagerState.currentPage - 5)) 0.63f
else 0.57f,
stop = 1f,
fraction = 1f - pageOffSet.coerceIn(0f, 1f)
)
scaleX = lerp(
start = if (it == (pagerState.currentPage + 1) || it == (pagerState.currentPage - 1)) 0.85f
else if (it == (pagerState.currentPage + 2) || it == (pagerState.currentPage - 2)) 0.78f
else if (it == (pagerState.currentPage + 3) || it == (pagerState.currentPage - 3)) 0.73f
else if (it == (pagerState.currentPage + 4) || it == (pagerState.currentPage - 4)) 0.68f
else if (it == (pagerState.currentPage + 5) || it == (pagerState.currentPage - 5)) 0.63f
else 0.57f,
stop = 1f,
fraction = 1f - pageOffSet.coerceIn(0f, 1f)
)
}
}
.conditional(thumbnailType == ThumbnailType.Modern) {
padding(
all = 10.dp
)
}
.conditional(thumbnailType == ThumbnailType.Modern) {
doubleShadowDrop(
thumbnailRoundness.shape(),
4.dp,
8.dp
)
}
.clip(thumbnailRoundness.shape())
.combinedClickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = {
if (it == pagerState.settledPage && thumbnailTapEnabled) {
if (isShowingVisualizer) isShowingVisualizer =
false
isShowingLyrics = !isShowingLyrics
}
if (it != pagerState.settledPage) {
binder.player.forcePlayAtIndex(
mediaItems,
it
)
}
},
onLongClick = {
if (it == pagerState.settledPage)
showThumbnailOffsetDialog = true
}
)
)
*/
}
} else {
thumbnailContent()
Expand Down Expand Up @@ -2824,7 +2724,7 @@ fun Player(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.conditional(!expandedplayer){weight(1f)}
.conditional(!expandedplayer && (!isShowingLyrics || showlyricsthumbnail)){weight(1f)}
){
if (!expandedplayer || !isShowingLyrics || queueDurationExpanded) {
if (showTotalTimeQueue)
Expand Down Expand Up @@ -2885,7 +2785,7 @@ fun Player(
)
}
Box(modifier = Modifier
.conditional(!expandedplayer){weight(1f)}) {
.conditional(!expandedplayer && (!isShowingLyrics || showlyricsthumbnail)){weight(1f)}) {
if (playerType == PlayerType.Essential || isShowingLyrics || isShowingVisualizer) {
controlsContent(
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import it.fast4x.rimusic.utils.disablePlayerHorizontalSwipeKey
import it.fast4x.rimusic.utils.disableScrollingTextKey
import it.fast4x.rimusic.utils.effectRotationKey
import it.fast4x.rimusic.utils.enableWallpaperKey
import it.fast4x.rimusic.utils.expandedlyricsKey
import it.fast4x.rimusic.utils.expandedplayerKey
import it.fast4x.rimusic.utils.expandedplayertoggleKey
import it.fast4x.rimusic.utils.fadingedgeKey
Expand Down Expand Up @@ -294,8 +293,6 @@ fun DefaultAppearanceSettings() {
thumbnailType = ThumbnailType.Modern
var showvisthumbnail by rememberPreference(showvisthumbnailKey, false)
showvisthumbnail = false
var expandedlyrics by rememberPreference(expandedlyricsKey, true)
expandedlyrics = true
var buttonzoomout by rememberPreference(buttonzoomoutKey, false)
buttonzoomout = false
var thumbnailpause by rememberPreference(thumbnailpauseKey, false)
Expand Down Expand Up @@ -464,7 +461,6 @@ fun AppearanceSettings(
var actionspacedevenly by rememberPreference(actionspacedevenlyKey, false)
var thumbnailType by rememberPreference(thumbnailTypeKey, ThumbnailType.Modern)
var showvisthumbnail by rememberPreference(showvisthumbnailKey, false)
var expandedlyrics by rememberPreference(expandedlyricsKey, true)
var buttonzoomout by rememberPreference(buttonzoomoutKey, false)
var thumbnailpause by rememberPreference(thumbnailpauseKey, false)
var showsongs by rememberPreference(showsongsKey, SongsNumber.`2`)
Expand Down Expand Up @@ -549,8 +545,6 @@ fun AppearanceSettings(
//keepPlayerMinimized = false
}

if (showlyricsthumbnail) expandedlyrics = false

if (!isLandscape) {
if (search.input.isBlank() || stringResource(R.string.show_player_top_actions_bar).contains(
search.input,
Expand Down Expand Up @@ -879,19 +873,6 @@ fun AppearanceSettings(
)
}

if (!showlyricsthumbnail && !isLandscape)
if (search.input.isBlank() || stringResource(R.string.expandedlyrics).contains(
search.input,
true
)
)
SwitchSettingEntry(
title = stringResource(R.string.expandedlyrics),
text = stringResource(R.string.expandedlyricsinfo),
isChecked = expandedlyrics,
onCheckedChange = { expandedlyrics = it }
)

if (search.input.isBlank() || stringResource(R.string.timelinesize).contains(
search.input,
true
Expand Down Expand Up @@ -1503,7 +1484,7 @@ fun AppearanceSettings(
onCheckedChange = { showButtonPlayerLyrics = it }
)
if (!isLandscape || !showthumbnail) {
if (!showlyricsthumbnail and !expandedlyrics) {
if (!showlyricsthumbnail) {
if (search.input.isBlank() || stringResource(R.string.expandedplayer).contains(
search.input,
true
Expand Down Expand Up @@ -1578,7 +1559,7 @@ fun AppearanceSettings(
onCheckedChange = { showButtonPlayerMenu = it }
)

if (!showlyricsthumbnail && (expandedplayertoggle || expandedplayer || expandedlyrics)) {
if (!showlyricsthumbnail) {
SettingsGroupSpacer()
SettingsEntryGroupText(title = stringResource(R.string.full_screen_lyrics_components))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ import it.fast4x.rimusic.utils.enablePictureInPictureAutoKey
import it.fast4x.rimusic.utils.enablePictureInPictureKey
import it.fast4x.rimusic.utils.excludeSongsWithDurationLimitKey
import it.fast4x.rimusic.utils.exoPlayerMinTimeForEventKey
import it.fast4x.rimusic.utils.expandedlyricsKey
import it.fast4x.rimusic.utils.expandedplayertoggleKey
import it.fast4x.rimusic.utils.fadingedgeKey
import it.fast4x.rimusic.utils.fontTypeKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ import it.fast4x.rimusic.utils.enablePictureInPictureAutoKey
import it.fast4x.rimusic.utils.enablePictureInPictureKey
import it.fast4x.rimusic.utils.excludeSongsWithDurationLimitKey
import it.fast4x.rimusic.utils.exoPlayerMinTimeForEventKey
import it.fast4x.rimusic.utils.expandedlyricsKey
import it.fast4x.rimusic.utils.expandedplayertoggleKey
import it.fast4x.rimusic.utils.fadingedgeKey
import it.fast4x.rimusic.utils.fontTypeKey
Expand Down Expand Up @@ -436,8 +435,6 @@ fun DefaultUiSettings() {
carouselSize = CarouselSize.Biggest
var thumbnailType by rememberPreference(thumbnailTypeKey, ThumbnailType.Modern)
thumbnailType = ThumbnailType.Modern
var expandedlyrics by rememberPreference(expandedlyricsKey, true)
expandedlyrics = true
var playerTimelineType by rememberPreference(playerTimelineTypeKey, PlayerTimelineType.FakeAudioBar)
playerTimelineType = PlayerTimelineType.Default
var playerThumbnailSize by rememberPreference(
Expand Down Expand Up @@ -661,7 +658,6 @@ fun UiSettings(
var carousel by rememberPreference(carouselKey, true)
var carouselSize by rememberPreference(carouselSizeKey, CarouselSize.Biggest)
var thumbnailType by rememberPreference(thumbnailTypeKey, ThumbnailType.Modern)
var expandedlyrics by rememberPreference(expandedlyricsKey, true)
var playerTimelineType by rememberPreference(playerTimelineTypeKey, PlayerTimelineType.FakeAudioBar)
var playerThumbnailSize by rememberPreference(
playerThumbnailSizeKey,
Expand Down Expand Up @@ -856,7 +852,6 @@ fun UiSettings(
carousel = true
carouselSize = CarouselSize.Medium
thumbnailType = ThumbnailType.Essential
expandedlyrics = false
playerTimelineSize = PlayerTimelineSize.Medium
playerInfoShowIcons = true
miniPlayerType = MiniPlayerType.Modern
Expand Down

0 comments on commit 5b31e37

Please sign in to comment.