1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-07-06 03:52:58 +00:00

Improved PlaylistHeader

This commit is contained in:
Isira Seneviratne 2024-07-16 19:13:02 +05:30
parent 9dfd064d86
commit b9556a1331

View File

@ -57,23 +57,21 @@ fun PlaylistHeader(playlistInfo: PlaylistInfo, totalDuration: Long) {
Text(text = playlistInfo.name, style = MaterialTheme.typography.titleMedium) Text(text = playlistInfo.name, style = MaterialTheme.typography.titleMedium)
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) { Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
val clickable = playlistInfo.uploaderName != null && playlistInfo.uploaderUrl != null
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = Modifier.let { modifier = Modifier.clickable(clickable) {
if (playlistInfo.uploaderName != null && playlistInfo.uploaderUrl != null) { try {
it.clickable { NavigationHelper.openChannelFragment(
try { (context as FragmentActivity).supportFragmentManager,
NavigationHelper.openChannelFragment( playlistInfo.serviceId, playlistInfo.uploaderUrl,
(context as FragmentActivity).supportFragmentManager, playlistInfo.uploaderName
playlistInfo.serviceId, playlistInfo.uploaderUrl, )
playlistInfo.uploaderName } catch (e: Exception) {
) ErrorUtil.showUiErrorSnackbar(context, "Opening channel fragment", e)
} catch (e: Exception) { }
ErrorUtil.showUiErrorSnackbar(context, "Opening channel fragment", e)
}
}
} else it
} }
) { ) {
val imageModifier = Modifier val imageModifier = Modifier