mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 06:43:45 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c8d983dd24
3 changed files with 18 additions and 20 deletions
|
@ -8,8 +8,6 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Build
|
||||
import android.os.StrictMode
|
||||
import android.os.StrictMode.VmPolicy
|
||||
import android.webkit.WebView
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
|
|
|
@ -42,9 +42,12 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.onEach
|
||||
import reactivecircus.flowbinding.android.view.clicks
|
||||
import reactivecircus.flowbinding.viewpager.pageSelections
|
||||
import rx.Observable
|
||||
import rx.Subscription
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class AnimelibController(
|
||||
bundle: Bundle? = null,
|
||||
|
@ -199,10 +202,12 @@ class AnimelibController(
|
|||
is AnimelibSettingsSheet.Filter.FilterGroup -> onFilterChanged()
|
||||
is AnimelibSettingsSheet.Sort.SortGroup -> onSortChanged()
|
||||
is AnimelibSettingsSheet.Display.DisplayGroup -> {
|
||||
if (!preferences.categorisedDisplaySettings().get() || activeCategory == 0) {
|
||||
// Reattach adapter when flow preference change
|
||||
reattachAdapter()
|
||||
}
|
||||
val delay = if (preferences.categorisedDisplaySettings().get()) 125L else 0L
|
||||
|
||||
Observable.timer(delay, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
reattachAdapter()
|
||||
}
|
||||
}
|
||||
is AnimelibSettingsSheet.Display.BadgeGroup -> onBadgeSettingChanged()
|
||||
is AnimelibSettingsSheet.Display.TabsGroup -> onTabsSettingsChanged()
|
||||
|
@ -299,11 +304,6 @@ class AnimelibController(
|
|||
.map { (it.id ?: -1) to (animeMap[it.id]?.size ?: 0) }
|
||||
.toMap()
|
||||
|
||||
if (preferences.categorisedDisplaySettings().get()) {
|
||||
// Reattach adapter so it doesn't get de-synced
|
||||
reattachAdapter()
|
||||
}
|
||||
|
||||
// Restore active category.
|
||||
binding.libraryPager.setCurrentItem(activeCat, false)
|
||||
|
||||
|
|
|
@ -42,9 +42,12 @@ import kotlinx.coroutines.flow.launchIn
|
|||
import kotlinx.coroutines.flow.onEach
|
||||
import reactivecircus.flowbinding.android.view.clicks
|
||||
import reactivecircus.flowbinding.viewpager.pageSelections
|
||||
import rx.Observable
|
||||
import rx.Subscription
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class LibraryController(
|
||||
bundle: Bundle? = null,
|
||||
|
@ -199,10 +202,12 @@ class LibraryController(
|
|||
is LibrarySettingsSheet.Filter.FilterGroup -> onFilterChanged()
|
||||
is LibrarySettingsSheet.Sort.SortGroup -> onSortChanged()
|
||||
is LibrarySettingsSheet.Display.DisplayGroup -> {
|
||||
if (!preferences.categorisedDisplaySettings().get() || activeCategory == 0) {
|
||||
// Reattach adapter when flow preference change
|
||||
reattachAdapter()
|
||||
}
|
||||
val delay = if (preferences.categorisedDisplaySettings().get()) 125L else 0L
|
||||
|
||||
Observable.timer(delay, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
reattachAdapter()
|
||||
}
|
||||
}
|
||||
is LibrarySettingsSheet.Display.BadgeGroup -> onBadgeSettingChanged()
|
||||
is LibrarySettingsSheet.Display.TabsGroup -> onTabsSettingsChanged()
|
||||
|
@ -299,11 +304,6 @@ class LibraryController(
|
|||
.map { (it.id ?: -1) to (mangaMap[it.id]?.size ?: 0) }
|
||||
.toMap()
|
||||
|
||||
if (preferences.categorisedDisplaySettings().get()) {
|
||||
// Reattach adapter so it doesn't get de-synced
|
||||
reattachAdapter()
|
||||
}
|
||||
|
||||
// Restore active category.
|
||||
binding.libraryPager.setCurrentItem(activeCat, false)
|
||||
|
||||
|
|
Loading…
Reference in a new issue