From 4ecde9fc39a8385e89ed903614b24c8dd1e41ad1 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 10 Apr 2022 11:52:24 -0400 Subject: [PATCH] Gate update/download warnings to non-stable flavors --- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 4 +++- .../eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt | 4 +++- .../eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt | 1 - .../ui/base/controller/SearchableNucleusController.kt | 3 ++- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 3 ++- .../kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt | 3 ++- .../kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt | 3 ++- .../eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt | 3 ++- .../eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index a8d4f5a4b..a19aa187f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -6,6 +6,7 @@ import android.widget.Toast import com.hippo.unifile.UniFile import com.jakewharton.rxrelay.BehaviorRelay import com.jakewharton.rxrelay.PublishRelay +import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.cache.ChapterCache import eu.kanade.tachiyomi.data.database.models.Chapter @@ -278,7 +279,8 @@ class Downloader( .groupBy { it.source } .filterKeys { it !is UnmeteredSource } .maxOf { it.value.size } - if (maxDownloadsFromSource > CHAPTERS_PER_SOURCE_QUEUE_WARNING_THRESHOLD) { + // TODO: show warnings in stable + if (maxDownloadsFromSource > CHAPTERS_PER_SOURCE_QUEUE_WARNING_THRESHOLD && BuildConfig.FLAVOR != "stable") { withUIContext { context.toast(R.string.download_queue_size_warning, Toast.LENGTH_LONG) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index 22b4d7b13..137e47822 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -7,6 +7,7 @@ import android.os.IBinder import android.os.PowerManager import android.widget.Toast import androidx.core.content.ContextCompat +import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.database.DatabaseHelper @@ -270,7 +271,8 @@ class LibraryUpdateService( .groupBy { it.source } .filterKeys { sourceManager.get(it) !is UnmeteredSource } .maxOfOrNull { it.value.size } ?: 0 - if (maxUpdatesFromSource > MANGA_PER_SOURCE_QUEUE_WARNING_THRESHOLD) { + // TODO: show warnings in stable + if (maxUpdatesFromSource > MANGA_PER_SOURCE_QUEUE_WARNING_THRESHOLD && BuildConfig.FLAVOR != "stable") { toast(R.string.notification_size_warning, Toast.LENGTH_LONG) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index 19798d29e..115ff57a4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -126,5 +126,4 @@ private data class ExtensionSourceJsonObject( val name: String, val id: Long, val baseUrl: String, - ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt index 583437a9e..15f677bbc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt @@ -68,7 +68,8 @@ abstract class SearchableNucleusController() { override fun onStopTrackingTouch(slider: Slider) { isScrollingThroughPages = false } - },) + }, + ) binding.pageSlider.addOnChangeListener { slider, value, fromUser -> if (viewer != null && fromUser) { isScrollingThroughPages = true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt index 3c5f1109d..4e22f8418 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt @@ -54,7 +54,8 @@ class ReaderSettingsSheet( activity.setMenuVisibility(!isFilterTab) } } - },) + }, + ) if (showColorFilterSettings) { binding.tabs.getTabAt(filterTabIndex)?.select() diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt index 89e2fff3d..169dad27f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt @@ -120,7 +120,8 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor( currentAnimator = null postInvalidate() } - },) + }, + ) } internal class SavedState : AbsSavedState { diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt index ff07c56ed..e8769990a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt @@ -42,7 +42,8 @@ class ThemesPreference @JvmOverloads constructor(context: Context, attrs: Attrib super.onScrolled(recyclerView, dx, dy) lastScrollPosition = recyclerView.computeHorizontalScrollOffset() } - },) + }, + ) lastScrollPosition?.let { scrollToOffset(it) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt index ac982efcf..f72eb3112 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt @@ -49,6 +49,7 @@ class BottomSheetViewPager @JvmOverloads constructor( override fun onPageSelected(position: Int) { requestLayout() } - },) + }, + ) } }