From 47f5ea881fdc2e49c076eebbcc3f7935d8134a64 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 2 Feb 2020 22:22:54 -0500 Subject: [PATCH] Reorganize other util files --- app/src/main/java/eu/kanade/tachiyomi/App.kt | 2 +- .../tachiyomi/data/backup/BackupManager.kt | 4 ++-- .../data/backup/BackupRestoreService.kt | 6 +++--- .../data/download/DownloadNotifier.kt | 4 ++-- .../tachiyomi/data/download/DownloadService.kt | 8 ++++---- .../tachiyomi/data/download/Downloader.kt | 6 +++++- .../data/library/LibraryUpdateService.kt | 6 +++++- .../data/notification/NotificationReceiver.kt | 4 ++-- .../data/notification/Notifications.kt | 4 ++-- .../data/track/myanimelist/MyAnimeListApi.kt | 4 ++-- .../tachiyomi/data/updater/UpdaterJob.kt | 2 +- .../tachiyomi/data/updater/UpdaterNotifier.kt | 2 +- .../tachiyomi/extension/ExtensionManager.kt | 2 +- .../extension/util/ExtensionInstallActivity.kt | 2 +- .../extension/util/ExtensionInstallReceiver.kt | 2 +- .../extension/util/ExtensionLoader.kt | 2 +- .../tachiyomi/network/CloudflareInterceptor.kt | 2 +- .../eu/kanade/tachiyomi/source/LocalSource.kt | 14 +++++++------- .../source/online/ParsedHttpSource.kt | 2 +- .../tachiyomi/ui/base/activity/BaseActivity.kt | 2 +- .../ui/base/activity/BaseRxActivity.kt | 2 +- .../tachiyomi/ui/base/holder/SlicedHolder.kt | 2 +- .../tachiyomi/ui/catalogue/CatalogueAdapter.kt | 2 +- .../tachiyomi/ui/catalogue/LangHolder.kt | 2 +- .../tachiyomi/ui/catalogue/SourceHolder.kt | 8 ++++---- .../browse/BrowseCatalogueController.kt | 7 ++++++- .../ui/catalogue/browse/CatalogueListHolder.kt | 2 +- .../browse/CatalogueNavigationView.kt | 2 +- .../tachiyomi/ui/catalogue/filter/GroupItem.kt | 2 +- .../tachiyomi/ui/catalogue/filter/SortGroup.kt | 2 +- .../tachiyomi/ui/catalogue/filter/SortItem.kt | 2 +- .../ui/catalogue/filter/TriStateItem.kt | 4 ++-- .../global_search/CatalogueSearchHolder.kt | 4 ++-- .../ui/category/CategoryController.kt | 2 +- .../tachiyomi/ui/category/CategoryHolder.kt | 2 +- .../tachiyomi/ui/download/DownloadAdapter.kt | 2 +- .../tachiyomi/ui/extension/ExtensionAdapter.kt | 2 +- .../ui/extension/ExtensionDetailsController.kt | 2 +- .../ui/extension/ExtensionFilterController.kt | 2 +- .../tachiyomi/ui/extension/ExtensionHolder.kt | 2 +- .../ui/extension/ExtensionPresenter.kt | 2 +- .../tachiyomi/ui/library/LibraryAdapter.kt | 4 ++-- .../ui/library/LibraryCategoryView.kt | 6 +++--- .../tachiyomi/ui/library/LibraryController.kt | 4 ++-- .../tachiyomi/ui/library/LibraryPresenter.kt | 4 ++-- .../kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../tachiyomi/ui/manga/MangaController.kt | 2 +- .../ui/manga/chapter/ChapterHolder.kt | 6 +++--- .../ui/manga/chapter/ChaptersAdapter.kt | 2 +- .../ui/manga/chapter/ChaptersController.kt | 6 +++--- .../ui/manga/chapter/ChaptersPresenter.kt | 4 ++-- .../ui/manga/info/MangaInfoController.kt | 6 +++--- .../ui/manga/info/MangaInfoPresenter.kt | 2 +- .../tachiyomi/ui/manga/track/TrackAdapter.kt | 2 +- .../ui/manga/track/TrackController.kt | 2 +- .../tachiyomi/ui/manga/track/TrackHolder.kt | 2 +- .../tachiyomi/ui/manga/track/TrackPresenter.kt | 2 +- .../ui/manga/track/TrackSearchAdapter.kt | 4 ++-- .../ui/manga/track/TrackSearchDialog.kt | 2 +- .../ui/migration/MigrationPresenter.kt | 4 ++-- .../tachiyomi/ui/migration/SourceAdapter.kt | 4 ++-- .../tachiyomi/ui/migration/SourceHolder.kt | 6 +++--- .../tachiyomi/ui/reader/ReaderActivity.kt | 6 +++++- .../ui/reader/ReaderColorFilterSheet.kt | 2 +- .../tachiyomi/ui/reader/ReaderPresenter.kt | 2 +- .../tachiyomi/ui/reader/ReaderSettingsSheet.kt | 2 +- .../tachiyomi/ui/reader/SaveImageNotifier.kt | 2 +- .../ui/reader/loader/DirectoryPageLoader.kt | 6 +++--- .../ui/reader/loader/HttpPageLoader.kt | 2 +- .../ui/reader/loader/RarPageLoader.kt | 6 +++--- .../ui/reader/loader/ZipPageLoader.kt | 6 +++--- .../ui/reader/viewer/ReaderProgressBar.kt | 2 +- .../ui/reader/viewer/pager/PagerConfig.kt | 2 +- .../ui/reader/viewer/pager/PagerPageHolder.kt | 8 ++++---- .../viewer/pager/PagerTransitionHolder.kt | 2 +- .../ui/reader/viewer/webtoon/WebtoonConfig.kt | 2 +- .../reader/viewer/webtoon/WebtoonPageHolder.kt | 8 ++++---- .../viewer/webtoon/WebtoonTransitionHolder.kt | 4 ++-- .../ui/recent_updates/RecentChapterHolder.kt | 6 +++--- .../recent_updates/RecentChaptersController.kt | 2 +- .../ui/recently_read/RecentlyReadController.kt | 2 +- .../ui/recently_read/RecentlyReadHolder.kt | 2 +- .../ui/setting/SettingsAboutController.kt | 4 ++-- .../ui/setting/SettingsAdvancedController.kt | 2 +- .../ui/setting/SettingsBackupController.kt | 5 ++++- .../ui/setting/SettingsDownloadController.kt | 2 +- .../ui/setting/SettingsGeneralController.kt | 2 +- .../ui/setting/SettingsMainController.kt | 2 +- .../ui/setting/SettingsSourcesController.kt | 2 +- .../ui/setting/SettingsTrackingController.kt | 2 +- .../tachiyomi/ui/webview/WebViewActivity.kt | 7 ++++++- .../eu/kanade/tachiyomi/util/ComparatorUtil.kt | 5 ----- .../util/{ => chapter}/ChapterRecognition.kt | 2 +- .../util/{ => chapter}/ChapterSourceSync.kt | 2 +- .../util/{ => lang}/CoroutinesExtensions.kt | 2 +- .../util/{ => lang}/DateExtensions.kt | 2 +- .../kanade/tachiyomi/util/{ => lang}/Hash.kt | 4 ++-- .../util/{ => lang}/RetryWithDelay.kt | 4 ++-- .../tachiyomi/util/{ => lang}/RxExtensions.kt | 2 +- .../util/{ => lang}/StringExtensions.kt | 18 ++++++++++++------ .../kanade/tachiyomi/util/storage/DiskUtil.kt | 2 +- .../util/{ => system}/ContextExtensions.kt | 2 +- .../tachiyomi/util/{ => system}/GLUtil.kt | 2 +- .../tachiyomi/util/{ => system}/ImageUtil.kt | 2 +- .../util/{ => system}/JsoupExtensions.kt | 2 +- .../util/{ => system}/LocaleHelper.kt | 2 +- .../util/{ => system}/WebViewClientCompat.kt | 2 +- .../util/{ => view}/ImageViewExtensions.kt | 2 +- .../util/{ => view}/ViewExtensions.kt | 2 +- .../util/{ => view}/ViewGroupExtensions.kt | 2 +- .../tachiyomi/widget/CustomLayoutPicker.kt | 2 +- .../tachiyomi/widget/DialogCheckboxView.kt | 2 +- .../widget/DialogCustomDownloadView.kt | 2 +- .../eu/kanade/tachiyomi/widget/EmptyView.kt | 4 ++-- .../tachiyomi/widget/ExtendedNavigationView.kt | 2 +- .../tachiyomi/widget/SimpleNavigationView.kt | 2 +- .../tachiyomi/widget/StateImageViewTarget.kt | 6 +++--- .../preference/LoginCheckBoxPreference.kt | 4 ++-- .../widget/preference/SourceLoginDialog.kt | 2 +- .../preference/SwitchPreferenceCategory.kt | 2 +- .../widget/preference/TrackLoginDialog.kt | 2 +- .../widget/preference/TrackLogoutDialog.kt | 2 +- .../data/database/ChapterRecognitionTest.kt | 2 +- 123 files changed, 218 insertions(+), 192 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/util/ComparatorUtil.kt rename app/src/main/java/eu/kanade/tachiyomi/util/{ => chapter}/ChapterRecognition.kt (99%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => chapter}/ChapterSourceSync.kt (99%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/CoroutinesExtensions.kt (90%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/DateExtensions.kt (87%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/Hash.kt (96%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/RetryWithDelay.kt (94%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/RxExtensions.kt (93%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => lang}/StringExtensions.kt (61%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/ContextExtensions.kt (99%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/GLUtil.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/ImageUtil.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/JsoupExtensions.kt (95%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/LocaleHelper.kt (99%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => system}/WebViewClientCompat.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => view}/ImageViewExtensions.kt (93%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => view}/ViewExtensions.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/util/{ => view}/ViewGroupExtensions.kt (92%) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 512c338d0e..c3a338a457 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.data.backup.BackupCreatorJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.updater.UpdaterJob -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import org.acra.ACRA import org.acra.annotation.ReportsCrashes import timber.log.Timber diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt index b5a8e53a22..cce57f7bf0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt @@ -30,8 +30,8 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.sendLocalBroadcast -import eu.kanade.tachiyomi.util.syncChaptersWithSource +import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource +import eu.kanade.tachiyomi.util.system.sendLocalBroadcast import rx.Observable import timber.log.Timber import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt index 87701c20d9..0b52bef4ff 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt @@ -23,9 +23,9 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.* import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.source.Source -import eu.kanade.tachiyomi.util.chop -import eu.kanade.tachiyomi.util.isServiceRunning -import eu.kanade.tachiyomi.util.sendLocalBroadcast +import eu.kanade.tachiyomi.util.lang.chop +import eu.kanade.tachiyomi.util.system.isServiceRunning +import eu.kanade.tachiyomi.util.system.sendLocalBroadcast import rx.Observable import rx.Subscription import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt index fcbb823397..ac63e70325 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt @@ -9,8 +9,8 @@ import eu.kanade.tachiyomi.data.download.model.DownloadQueue import eu.kanade.tachiyomi.data.notification.NotificationHandler import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.chop -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.lang.chop +import eu.kanade.tachiyomi.util.system.notificationManager import java.util.regex.Pattern /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt index 75676fcb83..04a53f88c0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt @@ -16,10 +16,10 @@ import com.jakewharton.rxrelay.BehaviorRelay import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.connectivityManager -import eu.kanade.tachiyomi.util.plusAssign -import eu.kanade.tachiyomi.util.powerManager -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.lang.plusAssign +import eu.kanade.tachiyomi.util.system.connectivityManager +import eu.kanade.tachiyomi.util.system.powerManager +import eu.kanade.tachiyomi.util.system.toast import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import rx.subscriptions.CompositeSubscription 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 a8d241a67d..e444ae4cf5 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 @@ -13,9 +13,13 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList -import eu.kanade.tachiyomi.util.* +import eu.kanade.tachiyomi.util.lang.RetryWithDelay +import eu.kanade.tachiyomi.util.lang.launchNow +import eu.kanade.tachiyomi.util.lang.launchUI +import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.saveTo +import eu.kanade.tachiyomi.util.system.ImageUtil import kotlinx.coroutines.async import okhttp3.Response import rx.Observable 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 688bb375da..d9fd9c3aef 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 @@ -29,7 +29,11 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.util.* +import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource +import eu.kanade.tachiyomi.util.lang.chop +import eu.kanade.tachiyomi.util.system.isServiceRunning +import eu.kanade.tachiyomi.util.system.notification +import eu.kanade.tachiyomi.util.system.notificationManager import rx.Observable import rx.Subscription import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt index 2ab3b0747a..bca35b4a7a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.getUriCompat -import eu.kanade.tachiyomi.util.notificationManager -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.notificationManager +import eu.kanade.tachiyomi.util.system.toast import uy.kohesive.injekt.injectLazy import java.io.File import eu.kanade.tachiyomi.BuildConfig.APPLICATION_ID as ID diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt index be537dd14f..1b3da06e84 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt @@ -5,7 +5,7 @@ import android.app.NotificationManager import android.content.Context import android.os.Build import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.system.notificationManager /** * Class to manage the basic information of all the notifications used in the app. @@ -51,4 +51,4 @@ object Notifications { ) context.notificationManager.createNotificationChannels(channels) } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index 65c16d0e25..23d2b36c13 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -8,8 +8,8 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservableSuccess -import eu.kanade.tachiyomi.util.selectInt -import eu.kanade.tachiyomi.util.selectText +import eu.kanade.tachiyomi.util.system.selectInt +import eu.kanade.tachiyomi.util.system.selectText import okhttp3.FormBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt index 3bcfe9fcf4..7522698118 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt @@ -8,7 +8,7 @@ import com.evernote.android.job.JobManager import com.evernote.android.job.JobRequest import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.system.notificationManager class UpdaterJob : Job() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterNotifier.kt index 74f1d64ba8..50e580a823 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterNotifier.kt @@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationHandler import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.system.notificationManager /** * DownloadNotifier is used to show notifications when downloading and update. diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt index 742c94828f..6cf1770a5d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.extension.util.ExtensionInstallReceiver import eu.kanade.tachiyomi.extension.util.ExtensionInstaller import eu.kanade.tachiyomi.extension.util.ExtensionLoader import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.launchNow +import eu.kanade.tachiyomi.util.lang.launchNow import kotlinx.coroutines.async import rx.Observable import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt index 5dcd6bb126..db2f726ea2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt @@ -4,7 +4,7 @@ import android.app.Activity import android.content.Intent import android.os.Bundle import eu.kanade.tachiyomi.extension.ExtensionManager -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt index 2c7bf9ef78..9f8083c42c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.content.IntentFilter import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.LoadResult -import eu.kanade.tachiyomi.util.launchNow +import eu.kanade.tachiyomi.util.lang.launchNow import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index 1fa963419c..35a5948f22 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.extension.model.LoadResult import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceFactory -import eu.kanade.tachiyomi.util.Hash +import eu.kanade.tachiyomi.util.lang.Hash import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import timber.log.Timber diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt index 7ce071db11..024253064c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt @@ -7,7 +7,7 @@ import android.os.Handler import android.os.Looper import android.webkit.WebSettings import android.webkit.WebView -import eu.kanade.tachiyomi.util.WebViewClientCompat +import eu.kanade.tachiyomi.util.system.WebViewClientCompat import okhttp3.Cookie import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.Interceptor diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt index 4ac38ad991..085e18d329 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -5,11 +5,11 @@ import com.google.gson.Gson import com.google.gson.JsonObject import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.* -import eu.kanade.tachiyomi.util.ChapterRecognition -import eu.kanade.tachiyomi.util.ComparatorUtil.CaseInsensitiveNaturalComparator +import eu.kanade.tachiyomi.util.chapter.ChapterRecognition +import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.EpubFile -import eu.kanade.tachiyomi.util.ImageUtil +import eu.kanade.tachiyomi.util.system.ImageUtil import junrar.Archive import junrar.rarfile.FileHeader import rx.Observable @@ -164,7 +164,7 @@ class LocalSource(private val context: Context) : CatalogueSource { } .sortedWith(Comparator { c1, c2 -> val c = c2.chapter_number.compareTo(c1.chapter_number) - if (c == 0) CaseInsensitiveNaturalComparator.compare(c2.name, c1.name) else c + if (c == 0) c2.name.compareToCaseInsensitiveNaturalOrder(c1.name) else c }) return Observable.just(chapters) @@ -210,7 +210,7 @@ class LocalSource(private val context: Context) : CatalogueSource { return when (format) { is Format.Directory -> { val entry = format.file.listFiles() - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.name, f2.name) }) + .sortedWith(Comparator { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }) .find { !it.isDirectory && ImageUtil.isImage(it.name) { FileInputStream(it) } } entry?.let { updateCover(context, manga, it.inputStream())} @@ -218,7 +218,7 @@ class LocalSource(private val context: Context) : CatalogueSource { is Format.Zip -> { ZipFile(format.file).use { zip -> val entry = zip.entries().toList() - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.name, f2.name) }) + .sortedWith(Comparator { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }) .find { !it.isDirectory && ImageUtil.isImage(it.name) { zip.getInputStream(it) } } entry?.let { updateCover(context, manga, zip.getInputStream(it) )} @@ -227,7 +227,7 @@ class LocalSource(private val context: Context) : CatalogueSource { is Format.Rar -> { Archive(format.file).use { archive -> val entry = archive.fileHeaders - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.fileNameString, f2.fileNameString) }) + .sortedWith(Comparator { f1, f2 -> f1.fileNameString.compareToCaseInsensitiveNaturalOrder(f2.fileNameString) }) .find { !it.isDirectory && ImageUtil.isImage(it.fileNameString) { archive.getInputStream(it) } } entry?.let { updateCover(context, manga, archive.getInputStream(it) )} diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt index 03d58d56a2..a80e3cf246 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/ParsedHttpSource.kt @@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.util.asJsoup +import eu.kanade.tachiyomi.util.system.asJsoup import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt index 80e7f2c7ed..b42d667150 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseActivity.kt @@ -4,7 +4,7 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import uy.kohesive.injekt.injectLazy abstract class BaseActivity : AppCompatActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt index 560fb01c8e..7d120f5cb1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.base.activity import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import nucleus.view.NucleusAppCompatActivity abstract class BaseRxActivity

> : NucleusAppCompatActivity

() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/SlicedHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/SlicedHolder.kt index 2d7efa2489..499c4056c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/SlicedHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/SlicedHolder.kt @@ -5,7 +5,7 @@ import android.view.ViewGroup import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.ISectionable -import eu.kanade.tachiyomi.util.dpToPx +import eu.kanade.tachiyomi.util.system.dpToPx import io.github.mthli.slice.Slice interface SlicedHolder { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt index 1b1f09d9ad..6c92007313 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.catalogue import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor /** * Adapter that holds the catalogue cards. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt index c82be06ad2..eae9e075a7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.catalogue import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import kotlinx.android.synthetic.main.catalogue_main_controller_card.title class LangHolder(view: View, adapter: FlexibleAdapter<*>) : diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt index 4366e6d35b..f29fff143c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt @@ -5,9 +5,9 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.online.LoginSource import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder -import eu.kanade.tachiyomi.util.getRound -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.view.getRound +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible import io.github.mthli.slice.Slice import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.* @@ -57,4 +57,4 @@ class SourceHolder(view: View, override val adapter: CatalogueAdapter) : } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt index 2c72322feb..7d69d2e6d0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt @@ -29,7 +29,12 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.webview.WebViewActivity -import eu.kanade.tachiyomi.util.* +import eu.kanade.tachiyomi.util.system.connectivityManager +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.inflate +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_controller.catalogue_view import kotlinx.android.synthetic.main.catalogue_controller.progress diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt index b47dee69e4..f691bf3cf0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt @@ -5,7 +5,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor import kotlinx.android.synthetic.main.catalogue_list_item.thumbnail import kotlinx.android.synthetic.main.catalogue_list_item.title diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt index baeee3b68a..f36f166227 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt @@ -6,7 +6,7 @@ import android.view.ViewGroup import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.widget.SimpleNavigationView import kotlinx.android.synthetic.main.catalogue_drawer_content.view.reset_btn import kotlinx.android.synthetic.main.catalogue_drawer_content.view.search_btn diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt index a8697a886b..7eefcca93c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt @@ -11,7 +11,7 @@ import eu.davidea.flexibleadapter.items.ISectionable import eu.davidea.viewholders.ExpandableViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.view.setVectorCompat class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem>() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt index 05a1abf5e7..1fe5603f14 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt @@ -8,7 +8,7 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.ISectionable import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.view.setVectorCompat class SortGroup(val filter: Filter.Sort) : AbstractExpandableHeaderItem>() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt index 0d2e4ad17a..358cfa1353 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.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.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor class SortItem(val name: String, val group: SortGroup) : AbstractSectionableItem(group) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt index 5289b640d5..16f76697ca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt @@ -10,8 +10,8 @@ import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.source.model.Filter -import eu.kanade.tachiyomi.util.dpToPx -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.R as TR open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt index 11f0c8de0f..91e441872c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt @@ -4,8 +4,8 @@ import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.progress import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.recycler import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.source_card diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt index 5de27f9d34..49d540c84b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt @@ -13,7 +13,7 @@ import eu.davidea.flexibleadapter.helpers.UndoHelper import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.ui.base.controller.NucleusController -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.categories_controller.empty_view import kotlinx.android.synthetic.main.categories_controller.fab import kotlinx.android.synthetic.main.categories_controller.recycler diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryHolder.kt index e8d1f867df..4b3da9ce26 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryHolder.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.category import android.view.View import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.getRound +import eu.kanade.tachiyomi.util.view.getRound import kotlinx.android.synthetic.main.categories_item.image import kotlinx.android.synthetic.main.categories_item.reorder import kotlinx.android.synthetic.main.categories_item.title diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt index 4844a79546..2738a765c5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt @@ -4,7 +4,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate /** * Adapter storing a list of downloads. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt index e8addfbae0..f8b1f56715 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionAdapter.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.extension import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor /** * Adapter that holds the catalogue cards. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt index 412f36c1b5..444923216c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDetailsController.kt @@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.online.LoginSource import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.setting.preferenceCategory -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.widget.preference.LoginPreference import eu.kanade.tachiyomi.widget.preference.SourceLoginDialog import kotlinx.android.synthetic.main.extension_detail_controller.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt index 8e955967a4..9f1cb210bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionFilterController.kt @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.ui.setting.onChange import eu.kanade.tachiyomi.ui.setting.switchPreference import eu.kanade.tachiyomi.ui.setting.titleRes -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt index a1425da46b..5e92335b4a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import io.github.mthli.slice.Slice import kotlinx.android.synthetic.main.extension_card_item.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt index 97997b55f1..d932ae0877 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryAdapter.kt index 061ac919aa..9eb0c9531b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryAdapter.kt @@ -4,7 +4,7 @@ import android.view.View import android.view.ViewGroup import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.widget.RecyclerViewPagerAdapter /** @@ -100,4 +100,4 @@ class LibraryAdapter(private val controller: LibraryController) : RecyclerViewPa } } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt index 1f33760ab8..441d03091b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt @@ -14,9 +14,9 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.library.LibraryUpdateService import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.util.inflate -import eu.kanade.tachiyomi.util.plusAssign -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.lang.plusAssign +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.library_category.view.swipe_refresh import rx.subscriptions.CompositeSubscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 10a4bafcd0..58f2cfee18 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -34,8 +34,8 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.migration.MigrationController -import eu.kanade.tachiyomi.util.inflate -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.inflate import kotlinx.android.synthetic.main.library_controller.empty_view import kotlinx.android.synthetic.main.library_controller.library_pager import kotlinx.android.synthetic.main.main_activity.drawer diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 967d35a123..73dd030168 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.combineLatest -import eu.kanade.tachiyomi.util.isNullOrUnsubscribed +import eu.kanade.tachiyomi.util.lang.combineLatest +import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 12c6879438..62cc5f61b4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -23,7 +23,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController import eu.kanade.tachiyomi.ui.recently_read.RecentlyReadController import eu.kanade.tachiyomi.ui.setting.SettingsMainController -import eu.kanade.tachiyomi.util.openInBrowser +import eu.kanade.tachiyomi.util.system.openInBrowser import kotlinx.android.synthetic.main.main_activity.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 2d427c07b9..cdd204990c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -26,7 +26,7 @@ import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersController import eu.kanade.tachiyomi.ui.manga.info.MangaInfoController import eu.kanade.tachiyomi.ui.manga.track.TrackController -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.main_activity.tabs import kotlinx.android.synthetic.main.manga_controller.manga_pager import rx.Subscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt index 99f2a8cf30..65288ee09f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterHolder.kt @@ -6,9 +6,9 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.setVectorCompat import kotlinx.android.synthetic.main.chapters_item.* import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt index 93c3bb0f58..6767db03e1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt @@ -6,7 +6,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor import uy.kohesive.injekt.injectLazy import java.text.DateFormat import java.text.DecimalFormat diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt index 9f9a8cac8a..c7fe29b758 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt @@ -23,9 +23,9 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.getCoordinates -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.getCoordinates +import eu.kanade.tachiyomi.util.view.snack import kotlinx.android.synthetic.main.chapters_controller.* import timber.log.Timber diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt index f42c6c86a7..e1c3229413 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt @@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.isNullOrUnsubscribed -import eu.kanade.tachiyomi.util.syncChaptersWithSource +import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource +import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 235303e965..74fca137cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -42,9 +42,9 @@ import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.webview.WebViewActivity -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.truncateCenter +import eu.kanade.tachiyomi.util.lang.truncateCenter +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.snack import jp.wasabeef.glide.transformations.CropSquareTransformation import jp.wasabeef.glide.transformations.MaskTransformation import kotlinx.android.synthetic.main.manga_info_controller.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt index 8bd98b157d..8e02f35de6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.MangaCategory import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.isNullOrUnsubscribed +import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt index d04dc752ef..3323c908c3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackAdapter.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.manga.track import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate class TrackAdapter(controller: TrackController) : RecyclerView.Adapter() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt index 2e56efe116..878644af78 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.manga.MangaController -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.track_controller.swipe_refresh import kotlinx.android.synthetic.main.track_controller.track_recycler import timber.log.Timber diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt index 1e72cf7fa4..fe6e683040 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackHolder.kt @@ -4,7 +4,7 @@ import android.annotation.SuppressLint import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.holder.BaseViewHolder -import eu.kanade.tachiyomi.util.visibleIf +import eu.kanade.tachiyomi.util.view.visibleIf import kotlinx.android.synthetic.main.track_item.* class TrackHolder(view: View, adapter: TrackAdapter) : BaseViewHolder(view) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt index 21b123c37f..32af5b0e94 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackPresenter.kt @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt index c5d0fbea14..05bbfc3d8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt @@ -8,8 +8,8 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.track.model.TrackSearch -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.inflate import kotlinx.android.synthetic.main.track_search_item.view.* import java.util.ArrayList diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt index 1233bebf3d..164ce7a01a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.ui.base.controller.DialogController -import eu.kanade.tachiyomi.util.plusAssign +import eu.kanade.tachiyomi.util.lang.plusAssign import kotlinx.android.synthetic.main.track_search_dialog.view.progress import kotlinx.android.synthetic.main.track_search_dialog.view.track_search import kotlinx.android.synthetic.main.track_search_dialog.view.track_search_list diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationPresenter.kt index e1a350c1ac..99a1286e87 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationPresenter.kt @@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.combineLatest -import eu.kanade.tachiyomi.util.syncChaptersWithSource +import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource +import eu.kanade.tachiyomi.util.lang.combineLatest import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt index 86df353f5a..8aa6ed7574 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.migration import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor /** * Adapter that holds the catalogue cards. @@ -39,4 +39,4 @@ class SourceAdapter(val controller: MigrationController) : super.updateDataSet(items) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt index fd644e385c..bec2dbe321 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt @@ -4,8 +4,8 @@ import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder -import eu.kanade.tachiyomi.util.getRound -import eu.kanade.tachiyomi.util.gone +import eu.kanade.tachiyomi.util.view.getRound +import eu.kanade.tachiyomi.util.view.gone import io.github.mthli.slice.Slice import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.* @@ -40,4 +40,4 @@ class SourceHolder(view: View, override val adapter: SourceAdapter) : image.setImageDrawable(image.getRound(source.name.take(1).toUpperCase(),false)) } } -} \ No newline at end of file +} 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 b02204a875..9f03bb9969 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 @@ -29,8 +29,12 @@ import eu.kanade.tachiyomi.ui.reader.viewer.pager.L2RPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.pager.VerticalPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer -import eu.kanade.tachiyomi.util.* +import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.util.storage.getUriCompat +import eu.kanade.tachiyomi.util.system.GLUtil +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.SimpleAnimationListener import eu.kanade.tachiyomi.widget.SimpleSeekBarListener import kotlinx.android.synthetic.main.reader_activity.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt index a69c91e181..bc1ba74abf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderColorFilterSheet.kt @@ -10,7 +10,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.util.plusAssign +import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import eu.kanade.tachiyomi.widget.SimpleSeekBarListener import kotlinx.android.synthetic.main.reader_color_filter.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index 86e694bb41..3238138514 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -22,7 +22,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.util.storage.DiskUtil -import eu.kanade.tachiyomi.util.ImageUtil +import eu.kanade.tachiyomi.util.system.ImageUtil import rx.Completable import rx.Observable import rx.Subscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index 3f9e96cc9f..9540da3b1e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import kotlinx.android.synthetic.main.reader_settings_sheet.* import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt index 11c918c57c..37bfdc6639 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.notification.NotificationHandler import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.system.notificationManager import java.io.File /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt index 8d70d4a760..ebbc3d2d37 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.reader.loader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import eu.kanade.tachiyomi.util.ComparatorUtil.CaseInsensitiveNaturalComparator -import eu.kanade.tachiyomi.util.ImageUtil +import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder +import eu.kanade.tachiyomi.util.system.ImageUtil import rx.Observable import java.io.File import java.io.FileInputStream @@ -20,7 +20,7 @@ class DirectoryPageLoader(val file: File) : PageLoader() { override fun getPages(): Observable> { return file.listFiles() .filter { !it.isDirectory && ImageUtil.isImage(it.name) { FileInputStream(it) } } - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.name, f2.name) }) + .sortedWith(Comparator { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }) .mapIndexed { i, file -> val streamFn = { FileInputStream(file) } ReaderPage(i).apply { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt index f7b30d4421..d6b37fb56f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt @@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import eu.kanade.tachiyomi.util.plusAssign +import eu.kanade.tachiyomi.util.lang.plusAssign import rx.Completable import rx.Observable import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt index 4a30378a6d..51f25da0d9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.reader.loader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import eu.kanade.tachiyomi.util.ComparatorUtil.CaseInsensitiveNaturalComparator -import eu.kanade.tachiyomi.util.ImageUtil +import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder +import eu.kanade.tachiyomi.util.system.ImageUtil import junrar.Archive import junrar.rarfile.FileHeader import rx.Observable @@ -44,7 +44,7 @@ class RarPageLoader(file: File) : PageLoader() { override fun getPages(): Observable> { return archive.fileHeaders .filter { !it.isDirectory && ImageUtil.isImage(it.fileNameString) { archive.getInputStream(it) } } - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.fileNameString, f2.fileNameString) }) + .sortedWith(Comparator { f1, f2 -> f1.fileNameString.compareToCaseInsensitiveNaturalOrder(f2.fileNameString) }) .mapIndexed { i, header -> val streamFn = { getStream(header) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt index 78d7488847..81524ffcbb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.reader.loader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import eu.kanade.tachiyomi.util.ComparatorUtil.CaseInsensitiveNaturalComparator -import eu.kanade.tachiyomi.util.ImageUtil +import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder +import eu.kanade.tachiyomi.util.system.ImageUtil import rx.Observable import java.io.File import java.util.zip.ZipEntry @@ -34,7 +34,7 @@ class ZipPageLoader(file: File) : PageLoader() { override fun getPages(): Observable> { return zip.entries().toList() .filter { !it.isDirectory && ImageUtil.isImage(it.name) { zip.getInputStream(it) } } - .sortedWith(Comparator { f1, f2 -> CaseInsensitiveNaturalComparator.compare(f1.name, f2.name) }) + .sortedWith(Comparator { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) }) .mapIndexed { i, entry -> val streamFn = { zip.getInputStream(entry) } ReaderPage(i).apply { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderProgressBar.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderProgressBar.kt index 16c0ae6343..704577bb2b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderProgressBar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderProgressBar.kt @@ -15,7 +15,7 @@ import android.view.animation.DecelerateInterpolator import android.view.animation.LinearInterpolator import android.view.animation.RotateAnimation import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor import kotlin.math.min /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt index c07c7b65fb..57ad3e79b6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerConfig.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import com.f2prateek.rx.preferences.Preference import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.addTo +import eu.kanade.tachiyomi.util.lang.addTo import rx.subscriptions.CompositeSubscription import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index 8ec0ead814..c89f0ef5af 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -32,10 +32,10 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressBar import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig.ZoomType -import eu.kanade.tachiyomi.util.ImageUtil -import eu.kanade.tachiyomi.util.dpToPx -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.system.ImageUtil +import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.ViewPagerAdapter import rx.Observable import rx.Subscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt index 911c5230bf..8764de1fa8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt @@ -17,7 +17,7 @@ import androidx.appcompat.widget.AppCompatTextView import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter -import eu.kanade.tachiyomi.util.dpToPx +import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.widget.ViewPagerAdapter import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt index 7ac8a220a6..b610e3b330 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon import com.f2prateek.rx.preferences.Preference import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.addTo +import eu.kanade.tachiyomi.util.lang.addTo import rx.subscriptions.CompositeSubscription import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index ae603a3ec0..f72685f417 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -29,10 +29,10 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressBar -import eu.kanade.tachiyomi.util.ImageUtil -import eu.kanade.tachiyomi.util.dpToPx -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.system.ImageUtil +import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt index 2ef3acb51e..9d033f6bfb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt @@ -15,8 +15,8 @@ import androidx.appcompat.widget.AppCompatTextView import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter -import eu.kanade.tachiyomi.util.dpToPx -import eu.kanade.tachiyomi.util.visibleIf +import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.view.visibleIf import rx.Subscription import rx.android.schedulers.AndroidSchedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt index 4a5f139d9a..38995ce49c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterHolder.kt @@ -7,8 +7,8 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.setVectorCompat import kotlinx.android.synthetic.main.recent_chapters_item.* /** @@ -149,4 +149,4 @@ class RecentChapterHolder(private val view: View, private val adapter: RecentCha // Finally show the PopupMenu popup.show() } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt index ba88e127ea..a5cc23e37c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt @@ -19,7 +19,7 @@ import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.recent_chapters_controller.empty_view import kotlinx.android.synthetic.main.recent_chapters_controller.recycler import kotlinx.android.synthetic.main.recent_chapters_controller.swipe_refresh diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt index 227598dc2f..2a54fade3a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.recently_read_controller.empty_view import kotlinx.android.synthetic.main.recently_read_controller.recycler diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadHolder.kt index f9ec9de94b..7e08ab6807 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadHolder.kt @@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.MangaChapterHistory import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.util.toTimestampString +import eu.kanade.tachiyomi.util.lang.toTimestampString import kotlinx.android.synthetic.main.recently_read_item.* import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt index 8b4fa56435..aa0e07d21f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutController.kt @@ -17,8 +17,8 @@ import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.data.updater.UpdaterService import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.main.ChangelogDialogController -import eu.kanade.tachiyomi.util.toTimestampString -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.lang.toTimestampString +import eu.kanade.tachiyomi.util.system.toast import rx.Subscription import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt index d1603e879b..c4a23f5825 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt @@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService.Target import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.library.LibraryController -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index 6f1a3ceefe..9ebf3339ca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -20,8 +20,11 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe -import eu.kanade.tachiyomi.util.* import eu.kanade.tachiyomi.util.storage.getUriCompat +import eu.kanade.tachiyomi.util.system.getFilePicker +import eu.kanade.tachiyomi.util.system.registerLocalReceiver +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.system.unregisterLocalReceiver import java.io.File import java.util.concurrent.TimeUnit import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt index 51e313e3c9..4c7e879262 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsDownloadController.kt @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.base.controller.DialogController -import eu.kanade.tachiyomi.util.getFilePicker +import eu.kanade.tachiyomi.util.system.getFilePicker import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index e1035fe035..2d589cd4e3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys class SettingsGeneralController : SettingsController() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt index e13e5cb55d..eb642f3245 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.setting import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor class SettingsMainController : SettingsController() { override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt index 5495f0d071..c20e877c4c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.LoginSource -import eu.kanade.tachiyomi.util.LocaleHelper +import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.widget.preference.LoginCheckBoxPreference import eu.kanade.tachiyomi.widget.preference.SourceLoginDialog import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt index 3142098783..08a1bd79bc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsTrackingController.kt @@ -10,7 +10,7 @@ import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.anilist.AnilistApi import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi import eu.kanade.tachiyomi.data.track.shikimori.ShikimoriApi -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.widget.preference.LoginPreference import eu.kanade.tachiyomi.widget.preference.TrackLoginDialog import eu.kanade.tachiyomi.widget.preference.TrackLogoutDialog diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index 06c7bf31c6..2658896c90 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -14,7 +14,12 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.activity.BaseActivity -import eu.kanade.tachiyomi.util.* +import eu.kanade.tachiyomi.util.system.WebViewClientCompat +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.system.openInBrowser +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.invisible +import eu.kanade.tachiyomi.util.view.visible import kotlinx.android.synthetic.main.webview_activity.* import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ComparatorUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ComparatorUtil.kt deleted file mode 100644 index aff3603b65..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ComparatorUtil.kt +++ /dev/null @@ -1,5 +0,0 @@ -package eu.kanade.tachiyomi.util - -object ComparatorUtil { - val CaseInsensitiveNaturalComparator = compareBy(String.CASE_INSENSITIVE_ORDER) { it }.then(naturalOrder()) -} diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt similarity index 99% rename from app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt index 742fa3e1a2..c1c001fcc1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterRecognition.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.chapter import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterSourceSync.kt b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSourceSync.kt similarity index 99% rename from app/src/main/java/eu/kanade/tachiyomi/util/ChapterSourceSync.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSourceSync.kt index 3f161d0782..79490ee76e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ChapterSourceSync.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSourceSync.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.chapter import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.Chapter diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt similarity index 90% rename from app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt index 93665ffbed..0965275485 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/CoroutinesExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import kotlinx.coroutines.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/DateExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt similarity index 87% rename from app/src/main/java/eu/kanade/tachiyomi/util/DateExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt index aaef304d7b..509d4c71cf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/DateExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import java.text.DateFormat import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/Hash.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt similarity index 96% rename from app/src/main/java/eu/kanade/tachiyomi/util/Hash.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt index eb89b04312..4410274276 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/Hash.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import java.security.MessageDigest @@ -39,4 +39,4 @@ object Hash { } return String(out) } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/RetryWithDelay.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/RetryWithDelay.kt similarity index 94% rename from app/src/main/java/eu/kanade/tachiyomi/util/RetryWithDelay.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/RetryWithDelay.kt index e2ef0d2a1b..7cdef09b13 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/RetryWithDelay.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/RetryWithDelay.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import rx.Observable import rx.Scheduler @@ -22,4 +22,4 @@ class RetryWithDelay( Observable.error(error as Throwable) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/RxExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/RxExtensions.kt similarity index 93% rename from app/src/main/java/eu/kanade/tachiyomi/util/RxExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/RxExtensions.kt index 8a0c965ffc..b9fb8e7eb2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/RxExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/RxExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import rx.Observable import rx.Subscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/StringExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt similarity index 61% rename from app/src/main/java/eu/kanade/tachiyomi/util/StringExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt index 1fb44d5aae..de83295a96 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/StringExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.lang import kotlin.math.floor @@ -11,18 +11,24 @@ fun String.chop(count: Int, replacement: String = "..."): String { take(count - replacement.length) + replacement else this - } /** * Replaces the given string to have at most [count] characters using [replacement] near the center. * If [replacement] is longer than [count] an exception will be thrown when `length > count`. */ -fun String.truncateCenter(count: Int, replacement: String = "..."): String{ - if(length <= count) +fun String.truncateCenter(count: Int, replacement: String = "..."): String { + if (length <= count) return this - val pieceLength:Int = floor((count - replacement.length).div(2.0)).toInt() + val pieceLength: Int = floor((count - replacement.length).div(2.0)).toInt() - return "${ take(pieceLength) }$replacement${ takeLast(pieceLength) }" + return "${take(pieceLength)}$replacement${takeLast(pieceLength)}" +} + +/** + * Case-insensitive natural comparator for strings. + */ +fun String.compareToCaseInsensitiveNaturalOrder(other: String): Int { + return String.CASE_INSENSITIVE_ORDER.then(naturalOrder()).compare(this, other) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt index 41dbea8301..d9f1772691 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt @@ -7,7 +7,7 @@ import android.os.Environment import androidx.core.content.ContextCompat import androidx.core.os.EnvironmentCompat import com.hippo.unifile.UniFile -import eu.kanade.tachiyomi.util.Hash +import eu.kanade.tachiyomi.util.lang.Hash import java.io.File object DiskUtil { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt similarity index 99% rename from app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt index fa39b97279..5f2accea28 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import android.app.ActivityManager import android.app.Notification diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/GLUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/GLUtil.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/util/GLUtil.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/GLUtil.kt index a481db3373..739ce709df 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/GLUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/GLUtil.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import javax.microedition.khronos.egl.EGL10 import javax.microedition.khronos.egl.EGLConfig diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ImageUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/util/ImageUtil.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt index 3e9344063a..9e345f3af7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ImageUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import java.io.InputStream import java.net.URLConnection diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/JsoupExtensions.kt similarity index 95% rename from app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/JsoupExtensions.kt index 2dc39e1094..48d05dcf5c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/JsoupExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import okhttp3.Response import org.jsoup.Jsoup diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt similarity index 99% rename from app/src/main/java/eu/kanade/tachiyomi/util/LocaleHelper.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index a9ec6b25d3..64264c87fb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import android.app.Application import android.content.Context diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/WebViewClientCompat.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/util/WebViewClientCompat.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt index 911a40714c..7e1f840cdc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/WebViewClientCompat.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.system import android.annotation.TargetApi import android.os.Build diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ImageViewExtensions.kt similarity index 93% rename from app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/view/ImageViewExtensions.kt index 431fcc1b26..69335bc5b5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ImageViewExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.view import android.widget.ImageView import androidx.annotation.DrawableRes diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index a0aebc4e32..f475592c2e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -1,6 +1,6 @@ @file:Suppress("NOTHING_TO_INLINE") -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.view import android.graphics.Color import android.graphics.Point diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewGroupExtensions.kt similarity index 92% rename from app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt rename to app/src/main/java/eu/kanade/tachiyomi/util/view/ViewGroupExtensions.kt index 266bf43980..64c71200a0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewGroupExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util +package eu.kanade.tachiyomi.util.view import android.view.LayoutInflater import android.view.View diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt index 11d9945f2e..2f71a21077 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt @@ -7,7 +7,7 @@ import com.nononsenseapps.filepicker.FilePickerActivity import com.nononsenseapps.filepicker.FilePickerFragment import com.nononsenseapps.filepicker.LogicHandler import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import java.io.File class CustomLayoutPickerActivity : FilePickerActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt index 8852a4960e..fd78941323 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt @@ -5,7 +5,7 @@ import android.util.AttributeSet import android.widget.LinearLayout import androidx.annotation.StringRes import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import kotlinx.android.synthetic.main.common_dialog_with_checkbox.view.checkbox_option import kotlinx.android.synthetic.main.common_dialog_with_checkbox.view.description diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt index 03896b9008..883755cff6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCustomDownloadView.kt @@ -6,7 +6,7 @@ import android.util.AttributeSet import android.view.View import android.widget.LinearLayout import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import kotlinx.android.synthetic.main.download_custom_amount.view.* import timber.log.Timber diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/EmptyView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/EmptyView.kt index cff8080f46..95d5c1f273 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/EmptyView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/EmptyView.kt @@ -5,8 +5,8 @@ import android.util.AttributeSet import android.view.View import android.widget.RelativeLayout import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.setVectorCompat import kotlinx.android.synthetic.main.common_view_empty.view.image_view import kotlinx.android.synthetic.main.common_view_empty.view.text_label diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt index 7353c83478..ee9e6d6d02 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt @@ -10,7 +10,7 @@ import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor /** * An alternative implementation of [com.google.android.material.navigation.NavigationView], without menu diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt index 9035296ea6..97fa8ce9cd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.material.R import com.google.android.material.internal.ScrimInsetsFrameLayout import com.google.android.material.textfield.TextInputLayout -import eu.kanade.tachiyomi.util.inflate +import eu.kanade.tachiyomi.util.view.inflate import kotlin.math.min import eu.kanade.tachiyomi.R as TR diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt index 8570109c9e..6bae31e257 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt @@ -8,9 +8,9 @@ import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import com.bumptech.glide.request.target.ImageViewTarget import com.bumptech.glide.request.transition.Transition import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.visible /** * A glide target to display an image with an optional view to show while loading and a configurable diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginCheckBoxPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginCheckBoxPreference.kt index 9c1d7c3f18..81f678d331 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginCheckBoxPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginCheckBoxPreference.kt @@ -9,8 +9,8 @@ import androidx.preference.PreferenceViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.LoginSource -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.setVectorCompat +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.setVectorCompat import kotlinx.android.synthetic.main.pref_item_source.view.login import kotlinx.android.synthetic.main.pref_item_source.view.login_frame diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SourceLoginDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SourceLoginDialog.kt index d45463b1fc..0aa7c3828a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SourceLoginDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SourceLoginDialog.kt @@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.LoginSource -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.pref_account_login.view.dialog_title import kotlinx.android.synthetic.main.pref_account_login.view.login import kotlinx.android.synthetic.main.pref_account_login.view.password diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SwitchPreferenceCategory.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SwitchPreferenceCategory.kt index 7cf2f872d7..325eeba58d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SwitchPreferenceCategory.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/SwitchPreferenceCategory.kt @@ -13,7 +13,7 @@ import androidx.appcompat.widget.SwitchCompat import androidx.preference.PreferenceCategory import androidx.preference.PreferenceViewHolder import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor class SwitchPreferenceCategory @JvmOverloads constructor( context: Context, diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLoginDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLoginDialog.kt index 7c34d75ce2..e6c6a32cb6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLoginDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLoginDialog.kt @@ -5,7 +5,7 @@ import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.pref_account_login.view.dialog_title import kotlinx.android.synthetic.main.pref_account_login.view.login import kotlinx.android.synthetic.main.pref_account_login.view.password diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt index 8f45fde241..a42a08c1d0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt @@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.ui.base.controller.DialogController -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt b/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt index 452da9b303..35715bf8ce 100644 --- a/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt +++ b/app/src/test/java/eu/kanade/tachiyomi/data/database/ChapterRecognitionTest.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.data.database import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.util.ChapterRecognition +import eu.kanade.tachiyomi.util.chapter.ChapterRecognition import org.assertj.core.api.Assertions.assertThat import org.junit.Before import org.junit.Test