mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Use different icon for live tv
This commit is contained in:
parent
aab70b7366
commit
fa3ba45fae
2 changed files with 22 additions and 8 deletions
|
|
@ -36,6 +36,7 @@ import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalView
|
import androidx.compose.ui.platform.LocalView
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
@ -400,6 +401,7 @@ fun NavigationDrawerScope.NavItem(
|
||||||
containerColor: Color = Color.Unspecified,
|
containerColor: Color = Color.Unspecified,
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
val useFont = library !is ServerNavDrawerItem || library.type != CollectionType.LIVETV
|
||||||
val icon =
|
val icon =
|
||||||
when (library) {
|
when (library) {
|
||||||
NavDrawerItem.Favorites -> R.string.fa_heart
|
NavDrawerItem.Favorites -> R.string.fa_heart
|
||||||
|
|
@ -410,7 +412,7 @@ fun NavigationDrawerScope.NavItem(
|
||||||
CollectionType.MOVIES -> R.string.fa_film
|
CollectionType.MOVIES -> R.string.fa_film
|
||||||
CollectionType.TVSHOWS -> R.string.fa_tv
|
CollectionType.TVSHOWS -> R.string.fa_tv
|
||||||
CollectionType.HOMEVIDEOS -> R.string.fa_video
|
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.MUSIC -> R.string.fa_music
|
||||||
CollectionType.BOXSETS -> R.string.fa_open_folder
|
CollectionType.BOXSETS -> R.string.fa_open_folder
|
||||||
CollectionType.PLAYLISTS -> R.string.fa_list_ul
|
CollectionType.PLAYLISTS -> R.string.fa_list_ul
|
||||||
|
|
@ -434,13 +436,20 @@ fun NavigationDrawerScope.NavItem(
|
||||||
),
|
),
|
||||||
leadingContent = {
|
leadingContent = {
|
||||||
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
Text(
|
if (useFont) {
|
||||||
text = stringResource(icon),
|
Text(
|
||||||
textAlign = TextAlign.Center,
|
text = stringResource(icon),
|
||||||
fontSize = 16.sp,
|
textAlign = TextAlign.Center,
|
||||||
fontFamily = FontAwesome,
|
fontSize = 16.sp,
|
||||||
color = color,
|
fontFamily = FontAwesome,
|
||||||
)
|
color = color,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(icon),
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
|
|
|
||||||
5
app/src/main/res/drawable/gf_dvr.xml
Normal file
5
app/src/main/res/drawable/gf_dvr.xml
Normal 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>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue