Use different icon for live tv

This commit is contained in:
Damontecres 2025-10-23 20:45:16 -04:00
parent aab70b7366
commit fa3ba45fae
No known key found for this signature in database
2 changed files with 22 additions and 8 deletions

View file

@ -36,6 +36,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
@ -400,6 +401,7 @@ fun NavigationDrawerScope.NavItem(
containerColor: Color = Color.Unspecified,
) {
val context = LocalContext.current
val useFont = library !is ServerNavDrawerItem || library.type != CollectionType.LIVETV
val icon =
when (library) {
NavDrawerItem.Favorites -> R.string.fa_heart
@ -410,7 +412,7 @@ fun NavigationDrawerScope.NavItem(
CollectionType.MOVIES -> R.string.fa_film
CollectionType.TVSHOWS -> R.string.fa_tv
CollectionType.HOMEVIDEOS -> R.string.fa_video
CollectionType.LIVETV -> R.string.fa_tv
CollectionType.LIVETV -> R.drawable.gf_dvr
CollectionType.MUSIC -> R.string.fa_music
CollectionType.BOXSETS -> R.string.fa_open_folder
CollectionType.PLAYLISTS -> R.string.fa_list_ul
@ -434,6 +436,7 @@ fun NavigationDrawerScope.NavItem(
),
leadingContent = {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
if (useFont) {
Text(
text = stringResource(icon),
textAlign = TextAlign.Center,
@ -441,6 +444,12 @@ fun NavigationDrawerScope.NavItem(
fontFamily = FontAwesome,
color = color,
)
} else {
Icon(
painter = painterResource(icon),
contentDescription = null,
)
}
}
},
trailingContent = {

View file

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="64dp" android:viewportHeight="960" android:viewportWidth="960" android:width="64dp">
<path android:fillColor="#5f6368" android:pathData="M279.98,553q14.02,0 23.52,-9.48t9.5,-23.5q0,-14.02 -9.48,-23.52t-23.5,-9.5q-14.02,0 -23.52,9.48t-9.5,23.5q0,14.02 9.48,23.52t23.5,9.5ZM279.98,393q14.02,0 23.52,-9.48t9.5,-23.5q0,-14.02 -9.48,-23.52t-23.5,-9.5q-14.02,0 -23.52,9.48t-9.5,23.5q0,14.02 9.48,23.52t23.5,9.5ZM360,550h360v-60L360,490v60ZM360,390h360v-60L360,330v60ZM330,840v-80L140,760q-24,0 -42,-18t-18,-42v-520q0,-24 18,-42t42,-18h680q24,0 42,18t18,42v520q0,24 -18,42t-42,18L630,760v80L330,840ZM140,700h680v-520L140,180v520ZM140,700v-520,520Z"/>
</vector>