mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Move default category into database (#7676)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package eu.kanade.presentation.category
|
||||
|
||||
import android.content.Context
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.tachiyomi.R
|
||||
|
||||
val Category.visualName: String
|
||||
@Composable
|
||||
get() = when (id) {
|
||||
Category.UNCATEGORIZED_ID -> stringResource(id = R.string.label_default)
|
||||
else -> name
|
||||
}
|
||||
|
||||
fun Category.visualName(context: Context): String =
|
||||
when (id) {
|
||||
Category.UNCATEGORIZED_ID -> context.getString(R.string.label_default)
|
||||
else -> name
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.google.accompanist.pager.PagerState
|
||||
import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.presentation.category.visualName
|
||||
import eu.kanade.presentation.components.DownloadedOnlyModeBanner
|
||||
import eu.kanade.presentation.components.IncognitoModeBanner
|
||||
import eu.kanade.presentation.components.Pill
|
||||
@@ -67,7 +68,7 @@ fun LibraryTabs(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
text = category.name,
|
||||
text = category.visualName,
|
||||
color = if (state.currentPage == index) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onBackground,
|
||||
)
|
||||
if (count != null) {
|
||||
|
||||
Reference in New Issue
Block a user