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 6b0ae76fa..fcc4cdc27 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 4d26a8d4c..d67d81951 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 d26b3a0e2..ab1666b22 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 f17f4bcb4..b212c2f11 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 58920f624..88f97e745 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 e1669472d..5a3789eec 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 101c32286..d94ee0e9c 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 8596adc6c..1de5b17df 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 2985cdd3b..f491049d6 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 12c6e3768..a600f23c1 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 2260cd7bd..6b4778ea9 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 107e6fa55..38c946e01 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 853e8ba0b..d06ef6443 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 fdade75f1..5eafe42d3 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 c30af3e78..68a226466 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