From 70d9b0c390be46152139551a0783297b80389355 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 24 May 2021 12:34:54 -0400 Subject: [PATCH] Organize some classes --- .../java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt | 2 +- .../main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt | 2 ++ .../network/{ => interceptor}/CloudflareInterceptor.kt | 3 ++- .../network/{ => interceptor}/RateLimitInterceptor.kt | 3 +-- .../{ => interceptor}/SpecificHostRateLimitInterceptor.kt | 2 +- .../network/{ => interceptor}/UserAgentInterceptor.kt | 2 +- .../eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 4 ++-- .../tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt | 2 +- .../kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt | 2 +- app/src/main/java/eu/kanade/tachiyomi/widget/ActionToolbar.kt | 1 + .../widget/{ => listener}/IgnoreFirstSpinnerListener.kt | 2 +- .../widget/{ => listener}/SimpleAnimationListener.kt | 2 +- .../tachiyomi/widget/{ => listener}/SimpleSeekBarListener.kt | 2 +- .../widget/{ => listener}/SimpleTabSelectedListener.kt | 2 +- 15 files changed, 18 insertions(+), 15 deletions(-) rename app/src/main/java/eu/kanade/tachiyomi/network/{ => interceptor}/CloudflareInterceptor.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/network/{ => interceptor}/RateLimitInterceptor.kt (96%) rename app/src/main/java/eu/kanade/tachiyomi/network/{ => interceptor}/SpecificHostRateLimitInterceptor.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/network/{ => interceptor}/UserAgentInterceptor.kt (93%) rename app/src/main/java/eu/kanade/tachiyomi/widget/{ => listener}/IgnoreFirstSpinnerListener.kt (92%) rename app/src/main/java/eu/kanade/tachiyomi/widget/{ => listener}/SimpleAnimationListener.kt (86%) rename app/src/main/java/eu/kanade/tachiyomi/widget/{ => listener}/SimpleSeekBarListener.kt (88%) rename app/src/main/java/eu/kanade/tachiyomi/widget/{ => listener}/SimpleTabSelectedListener.kt (87%) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 6b0ae76fa1..fcc4cdc27b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -8,8 +8,8 @@ import com.afollestad.date.year import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.network.POST -import eu.kanade.tachiyomi.network.RateLimitInterceptor import eu.kanade.tachiyomi.network.await +import eu.kanade.tachiyomi.network.interceptor.RateLimitInterceptor import eu.kanade.tachiyomi.network.jsonMime import eu.kanade.tachiyomi.network.parseAs import eu.kanade.tachiyomi.util.lang.withIOContext diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt index 4d26a8d4ce..d67d819515 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt @@ -4,6 +4,8 @@ import android.content.Context import coil.util.CoilUtils import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.data.preference.PreferencesHelper +import eu.kanade.tachiyomi.network.interceptor.CloudflareInterceptor +import eu.kanade.tachiyomi.network.interceptor.UserAgentInterceptor import okhttp3.Cache import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt rename to app/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt index d26b3a0e22..ab1666b222 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.network +package eu.kanade.tachiyomi.network.interceptor import android.annotation.SuppressLint import android.content.Context @@ -8,6 +8,7 @@ import android.webkit.WebSettings import android.webkit.WebView import android.widget.Toast import eu.kanade.tachiyomi.R +import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.lang.launchUI import eu.kanade.tachiyomi.util.system.WebViewClientCompat diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/RateLimitInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt similarity index 96% rename from app/src/main/java/eu/kanade/tachiyomi/network/RateLimitInterceptor.kt rename to app/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt index f17f4bcb46..b212c2f11d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/RateLimitInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt @@ -1,9 +1,8 @@ -package eu.kanade.tachiyomi.network +package eu.kanade.tachiyomi.network.interceptor import android.os.SystemClock import okhttp3.Interceptor import okhttp3.Response -import timber.log.Timber import java.util.concurrent.TimeUnit /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/SpecificHostRateLimitInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/network/SpecificHostRateLimitInterceptor.kt rename to app/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt index 58920f6247..88f97e7453 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/SpecificHostRateLimitInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.network +package eu.kanade.tachiyomi.network.interceptor import android.os.SystemClock import okhttp3.HttpUrl diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/UserAgentInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt similarity index 93% rename from app/src/main/java/eu/kanade/tachiyomi/network/UserAgentInterceptor.kt rename to app/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt index e1669472de..5a3789eeca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/UserAgentInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.network +package eu.kanade.tachiyomi.network.interceptor import eu.kanade.tachiyomi.source.online.HttpSource import okhttp3.Interceptor diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt index 101c322863..d94ee0e9cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/filter/SelectItem.kt @@ -11,7 +11,7 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter -import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener +import eu.kanade.tachiyomi.widget.listener.IgnoreFirstSpinnerListener open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 8596adc6cd..1de5b17df5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -61,8 +61,8 @@ import eu.kanade.tachiyomi.util.view.isDefaultBar import eu.kanade.tachiyomi.util.view.popupMenu import eu.kanade.tachiyomi.util.view.setTooltip import eu.kanade.tachiyomi.util.view.showBar -import eu.kanade.tachiyomi.widget.SimpleAnimationListener -import eu.kanade.tachiyomi.widget.SimpleSeekBarListener +import eu.kanade.tachiyomi.widget.listener.SimpleAnimationListener +import eu.kanade.tachiyomi.widget.listener.SimpleSeekBarListener import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt index 2985cdd3bf..f491049d65 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt @@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.databinding.ReaderColorFilterSettingsBinding import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.util.preference.bindToPreference -import eu.kanade.tachiyomi.widget.SimpleSeekBarListener +import eu.kanade.tachiyomi.widget.listener.SimpleSeekBarListener import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.sample 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 12c6e37684..a600f23c15 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 @@ -4,7 +4,7 @@ import android.os.Bundle import com.google.android.material.tabs.TabLayout import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.widget.SimpleTabSelectedListener +import eu.kanade.tachiyomi.widget.listener.SimpleTabSelectedListener import eu.kanade.tachiyomi.widget.sheet.TabbedBottomSheetDialog class ReaderSettingsSheet( diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/ActionToolbar.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/ActionToolbar.kt index 2260cd7bd9..6b4778ea95 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ActionToolbar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ActionToolbar.kt @@ -13,6 +13,7 @@ import androidx.appcompat.view.ActionMode import androidx.core.view.isVisible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.databinding.ActionToolbarBinding +import eu.kanade.tachiyomi.widget.listener.SimpleAnimationListener /** * A toolbar holding only menu items. diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/IgnoreFirstSpinnerListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/IgnoreFirstSpinnerListener.kt similarity index 92% rename from app/src/main/java/eu/kanade/tachiyomi/widget/IgnoreFirstSpinnerListener.kt rename to app/src/main/java/eu/kanade/tachiyomi/widget/listener/IgnoreFirstSpinnerListener.kt index 107e6fa558..38c946e017 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/IgnoreFirstSpinnerListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/IgnoreFirstSpinnerListener.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.widget +package eu.kanade.tachiyomi.widget.listener import android.view.View import android.widget.AdapterView diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleAnimationListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleAnimationListener.kt similarity index 86% rename from app/src/main/java/eu/kanade/tachiyomi/widget/SimpleAnimationListener.kt rename to app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleAnimationListener.kt index 853e8ba0bf..d06ef6443b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleAnimationListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleAnimationListener.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.widget +package eu.kanade.tachiyomi.widget.listener import android.view.animation.Animation diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleSeekBarListener.kt similarity index 88% rename from app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt rename to app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleSeekBarListener.kt index fdade75f19..5eafe42d35 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleSeekBarListener.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.widget +package eu.kanade.tachiyomi.widget.listener import android.widget.SeekBar diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleTabSelectedListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleTabSelectedListener.kt similarity index 87% rename from app/src/main/java/eu/kanade/tachiyomi/widget/SimpleTabSelectedListener.kt rename to app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleTabSelectedListener.kt index c30af3e78c..68a226466a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleTabSelectedListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/listener/SimpleTabSelectedListener.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.widget +package eu.kanade.tachiyomi.widget.listener import com.google.android.material.tabs.TabLayout