This repository was archived by the owner on Nov 11, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
app/src/main/java/eu/kanade/tachiyomi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class ExtensionUpdateNotifier(
1616 private val securityPreferences : SecurityPreferences = Injekt .get(),
1717) {
1818
19- fun promptUpdates (names : List <String >) {
19+ fun promptUpdates (names : List <String >, anime : Boolean = false ) {
2020 context.notify(
2121 Notifications .ID_UPDATES_TO_EXTS ,
2222 Notifications .CHANNEL_EXTENSIONS_UPDATE ,
@@ -34,7 +34,11 @@ class ExtensionUpdateNotifier(
3434 setStyle(NotificationCompat .BigTextStyle ().bigText(extNames))
3535 }
3636 setSmallIcon(R .drawable.ic_extension_24dp)
37- setContentIntent(NotificationReceiver .openExtensionsPendingActivity(context))
37+ if (! anime) {
38+ setContentIntent(NotificationReceiver .openExtensionsPendingActivity(context))
39+ } else {
40+ setContentIntent(NotificationReceiver .openAnimeExtensionsPendingActivity(context))
41+ }
3842 setAutoCancel(true )
3943 }
4044 }
Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ internal class AnimeExtensionApi {
104104 }
105105
106106 if (extensionsWithUpdate.isNotEmpty()) {
107- ExtensionUpdateNotifier (context).promptUpdates(extensionsWithUpdate.map { it.name })
107+ ExtensionUpdateNotifier (context).promptUpdates(
108+ names = extensionsWithUpdate.map { it.name },
109+ anime = true ,
110+ )
108111 }
109112
110113 return extensionsWithUpdate
Original file line number Diff line number Diff line change @@ -53,10 +53,14 @@ data object BrowseTab : Tab {
5353 navigator.push(GlobalAnimeSearchScreen ())
5454 }
5555
56- private val switchToExtensionTabChannel = Channel <Unit >(1 , BufferOverflow .DROP_OLDEST )
56+ private val switchToTabNumberChannel = Channel <Int >(1 , BufferOverflow .DROP_OLDEST )
5757
5858 fun showExtension () {
59- switchToExtensionTabChannel.trySend(Unit )
59+ switchToTabNumberChannel.trySend(3 ) // Manga extensions: tab no. 3
60+ }
61+
62+ fun showAnimeExtension () {
63+ switchToTabNumberChannel.trySend(2 ) // Anime extensions: tab no. 2
6064 }
6165
6266 @Composable
@@ -92,8 +96,8 @@ data object BrowseTab : Tab {
9296 scrollable = true ,
9397 )
9498 LaunchedEffect (Unit ) {
95- switchToExtensionTabChannel .receiveAsFlow()
96- .collectLatest { state.scrollToPage(1 ) }
99+ switchToTabNumberChannel .receiveAsFlow()
100+ .collectLatest { state.scrollToPage(it ) }
97101 }
98102
99103 LaunchedEffect (Unit ) {
Original file line number Diff line number Diff line change @@ -175,7 +175,11 @@ object HomeScreen : Screen() {
175175 is Tab .History -> HistoriesTab
176176 is Tab .Browse -> {
177177 if (it.toExtensions) {
178- BrowseTab .showExtension()
178+ if (! it.anime) {
179+ BrowseTab .showExtension()
180+ } else {
181+ BrowseTab .showAnimeExtension()
182+ }
179183 }
180184 BrowseTab
181185 }
@@ -333,7 +337,7 @@ object HomeScreen : Screen() {
333337 data class Library (val mangaIdToOpen : Long? = null ) : Tab
334338 data object Updates : Tab
335339 data object History : Tab
336- data class Browse (val toExtensions : Boolean = false ) : Tab
340+ data class Browse (val toExtensions : Boolean = false , val anime : Boolean = false ) : Tab
337341 data class More (val toDownloads : Boolean ) : Tab
338342 }
339343}
Original file line number Diff line number Diff line change @@ -448,6 +448,7 @@ class MainActivity : BaseActivity() {
448448 Constants .SHORTCUT_UPDATES -> HomeScreen .Tab .Updates
449449 Constants .SHORTCUT_HISTORY -> HomeScreen .Tab .History
450450 Constants .SHORTCUT_SOURCES -> HomeScreen .Tab .Browse (false )
451+ Constants .SHORTCUT_ANIMEEXTENSIONS -> HomeScreen .Tab .Browse (true , true )
451452 Constants .SHORTCUT_EXTENSIONS -> HomeScreen .Tab .Browse (true )
452453 Constants .SHORTCUT_DOWNLOADS -> {
453454 navigator.popUntilRoot()
You can’t perform that action at this time.
0 commit comments