Gate update/download warnings to non-stable flavors

This commit is contained in:
arkon 2022-04-10 11:52:24 -04:00
parent 445ee274c5
commit 4ecde9fc39
9 changed files with 18 additions and 9 deletions

View File

@ -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)
}

View File

@ -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)
}
}

View File

@ -126,5 +126,4 @@ private data class ExtensionSourceJsonObject(
val name: String,
val id: Long,
val baseUrl: String,
)

View File

@ -68,7 +68,8 @@ abstract class SearchableNucleusController<VB : ViewBinding, P : BasePresenter<*
editable.getSpans(0, editable.length, CharacterStyle::class.java)
.forEach { editable.removeSpan(it) }
}
},)
},
)
searchView.queryTextEvents()
.onEach {

View File

@ -363,7 +363,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
override fun onStopTrackingTouch(slider: Slider) {
isScrollingThroughPages = false
}
},)
},
)
binding.pageSlider.addOnChangeListener { slider, value, fromUser ->
if (viewer != null && fromUser) {
isScrollingThroughPages = true

View File

@ -54,7 +54,8 @@ class ReaderSettingsSheet(
activity.setMenuVisibility(!isFilterTab)
}
}
},)
},
)
if (showColorFilterSettings) {
binding.tabs.getTabAt(filterTabIndex)?.select()

View File

@ -120,7 +120,8 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor(
currentAnimator = null
postInvalidate()
}
},)
},
)
}
internal class SavedState : AbsSavedState {

View File

@ -42,7 +42,8 @@ class ThemesPreference @JvmOverloads constructor(context: Context, attrs: Attrib
super.onScrolled(recyclerView, dx, dy)
lastScrollPosition = recyclerView.computeHorizontalScrollOffset()
}
},)
},
)
lastScrollPosition?.let { scrollToOffset(it) }
}

View File

@ -49,6 +49,7 @@ class BottomSheetViewPager @JvmOverloads constructor(
override fun onPageSelected(position: Int) {
requestLayout()
}
},)
},
)
}
}