From 54f798c9d2d618104fb00ba99295aa2ccff3905c 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 ++-- .../data/download/DownloadService.kt | 8 +++---- .../tachiyomi/data/download/Downloader.kt | 10 ++++----- .../data/library/LibraryUpdateService.kt | 10 ++++----- .../data/notification/NotificationReceiver.kt | 4 ++-- .../data/notification/Notifications.kt | 4 ++-- .../data/track/myanimelist/MyAnimeListApi.kt | 6 ++--- .../tachiyomi/data/updater/UpdaterJob.kt | 2 +- .../tachiyomi/data/updater/UpdaterNotifier.kt | 3 +-- .../tachiyomi/extension/ExtensionManager.kt | 2 +- .../util/ExtensionInstallActivity.kt | 2 +- .../util/ExtensionInstallReceiver.kt | 2 +- .../extension/util/ExtensionLoader.kt | 2 +- .../network/CloudflareInterceptor.kt | 2 +- .../eu/kanade/tachiyomi/source/LocalSource.kt | 15 ++++++------- .../source/online/ParsedHttpSource.kt | 2 +- .../ui/base/activity/BaseActivity.kt | 2 +- .../ui/base/activity/BaseRxActivity.kt | 2 +- .../tachiyomi/ui/base/holder/SlicedHolder.kt | 2 +- .../ui/catalogue/CatalogueAdapter.kt | 2 +- .../tachiyomi/ui/catalogue/LangHolder.kt | 4 ++-- .../tachiyomi/ui/catalogue/SourceHolder.kt | 8 +++---- .../browse/BrowseCatalogueController.kt | 20 ++++++++--------- .../catalogue/browse/CatalogueListHolder.kt | 5 +++-- .../browse/CatalogueNavigationView.kt | 2 +- .../ui/catalogue/filter/GroupItem.kt | 2 +- .../ui/catalogue/filter/SortGroup.kt | 2 +- .../tachiyomi/ui/catalogue/filter/SortItem.kt | 2 +- .../ui/catalogue/filter/TriStateItem.kt | 4 ++-- .../global_search/CatalogueSearchHolder.kt | 11 +++++----- .../ui/category/CategoryController.kt | 16 ++++++++------ .../tachiyomi/ui/category/CategoryHolder.kt | 6 +++-- .../ui/extension/ExtensionAdapter.kt | 2 +- .../extension/ExtensionDetailsController.kt | 4 ++-- .../tachiyomi/ui/extension/ExtensionHolder.kt | 2 +- .../ui/extension/ExtensionPresenter.kt | 2 +- .../extension/SettingsExtensionsController.kt | 2 +- .../tachiyomi/ui/library/LibraryAdapter.kt | 4 ++-- .../ui/library/LibraryCategoryView.kt | 14 ++++++------ .../tachiyomi/ui/library/LibraryController.kt | 15 ++++++------- .../tachiyomi/ui/library/LibraryPresenter.kt | 12 ++++------ .../kanade/tachiyomi/ui/main/MainActivity.kt | 22 +++++++++---------- .../tachiyomi/ui/manga/MangaController.kt | 2 +- .../ui/manga/chapter/ChapterHolder.kt | 6 ++--- .../ui/manga/chapter/ChaptersAdapter.kt | 2 +- .../ui/manga/chapter/ChaptersController.kt | 16 +++++++------- .../ui/manga/chapter/ChaptersPresenter.kt | 4 ++-- .../ui/manga/info/MangaInfoController.kt | 12 +++++----- .../ui/manga/info/MangaInfoPresenter.kt | 5 ++--- .../tachiyomi/ui/manga/track/TrackAdapter.kt | 2 +- .../ui/manga/track/TrackController.kt | 5 ++--- .../ui/manga/track/TrackPresenter.kt | 2 +- .../ui/manga/track/TrackSearchAdapter.kt | 4 ++-- .../ui/manga/track/TrackSearchDialog.kt | 6 +++-- .../ui/migration/MigrationPresenter.kt | 4 ++-- .../tachiyomi/ui/migration/SourceAdapter.kt | 4 ++-- .../tachiyomi/ui/migration/SourceHolder.kt | 4 ++-- .../tachiyomi/ui/reader/ReaderActivity.kt | 14 ++++++------ .../ui/reader/ReaderColorFilterSheet.kt | 2 +- .../tachiyomi/ui/reader/ReaderPresenter.kt | 2 +- .../ui/reader/ReaderSettingsSheet.kt | 2 +- .../tachiyomi/ui/reader/SaveImageNotifier.kt | 2 +- .../ui/reader/loader/DirectoryPageLoader.kt | 6 ++--- .../ui/reader/loader/HttpPageLoader.kt | 6 ++--- .../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 | 12 +++++----- .../viewer/pager/PagerTransitionHolder.kt | 6 ++--- .../ui/reader/viewer/webtoon/WebtoonConfig.kt | 2 +- .../viewer/webtoon/WebtoonPageHolder.kt | 8 +++---- .../viewer/webtoon/WebtoonTransitionHolder.kt | 4 ++-- .../ui/recent_updates/RecentChapterHolder.kt | 6 ++--- .../RecentChaptersController.kt | 14 +++++++----- .../recently_read/RecentlyReadController.kt | 7 +++--- .../ui/setting/SettingsAboutController.kt | 6 ++--- .../ui/setting/SettingsAdvancedController.kt | 4 ++-- .../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 | 22 +++++++++---------- .../kanade/tachiyomi/util/ComparatorUtil.kt | 5 ----- .../util/{ => chapter}/ChapterRecognition.kt | 2 +- .../util/{ => chapter}/ChapterSourceSync.kt | 2 +- .../util/{ => lang}/CoroutinesExtensions.kt | 2 +- .../tachiyomi/util/lang/DateExtensions.kt | 10 +++++++++ .../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 | 5 +++-- .../widget/DialogCustomDownloadView.kt | 2 +- .../eu/kanade/tachiyomi/widget/EmptyView.kt | 7 +++--- .../widget/ExtendedNavigationView.kt | 2 +- .../tachiyomi/widget/SimpleNavigationView.kt | 2 +- .../tachiyomi/widget/StateImageViewTarget.kt | 6 ++--- .../preference/LoginCheckBoxPreference.kt | 7 +++--- .../widget/preference/SourceLoginDialog.kt | 7 ++++-- .../preference/SwitchPreferenceCategory.kt | 2 +- .../widget/preference/TrackLoginDialog.kt | 7 ++++-- app/src/main/res/values/strings.xml | 1 + .../data/database/ChapterRecognitionTest.kt | 2 +- 120 files changed, 315 insertions(+), 299 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 (93%) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt 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 (64%) 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 (99%) 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 (99%) 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 33b7b99bdd..5807087804 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.extension.ExtensionUpdateJob import eu.kanade.tachiyomi.ui.main.MainActivity -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 1398db0c25..fb03033dc6 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,10 +30,10 @@ 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 kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext +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 05c4416387..9417af1fb0 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 @@ -30,14 +30,14 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.source.SourceNotFoundException -import eu.kanade.tachiyomi.util.chop +import eu.kanade.tachiyomi.util.lang.chop import eu.kanade.tachiyomi.util.storage.getUriCompat -import eu.kanade.tachiyomi.util.isServiceRunning -import eu.kanade.tachiyomi.util.notificationManager +import eu.kanade.tachiyomi.util.system.notificationManager import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch +import eu.kanade.tachiyomi.util.system.isServiceRunning import timber.log.Timber import uy.kohesive.injekt.injectLazy import java.io.File 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 915133d784..d9f2f10e46 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 @@ -10,8 +10,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 a59df9f1d5..defba52a92 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 @@ -14,13 +14,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.ImageUtil -import eu.kanade.tachiyomi.util.RetryWithDelay -import eu.kanade.tachiyomi.util.launchNow -import eu.kanade.tachiyomi.util.launchUI -import eu.kanade.tachiyomi.util.plusAssign +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 1309117dc0..3340318b1a 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 @@ -35,17 +35,17 @@ import eu.kanade.tachiyomi.source.model.SChapter 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.chop -import eu.kanade.tachiyomi.util.isServiceRunning -import eu.kanade.tachiyomi.util.notification -import eu.kanade.tachiyomi.util.notificationManager -import eu.kanade.tachiyomi.util.syncChaptersWithSource import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch +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 683bb227fd..b72283abec 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 @@ -25,10 +25,10 @@ import eu.kanade.tachiyomi.ui.manga.MangaController 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 uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get +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 25a91c3d64..08ee6201e2 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. @@ -90,4 +90,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 9430e00148..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,9 +8,9 @@ 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 okhttp3.* +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 import okhttp3.RequestBody 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 bb4c45a068..5c6209ec53 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 @@ -9,8 +9,8 @@ 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 java.util.concurrent.TimeUnit +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 11c4f8afa6..3c8d5d69b4 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 @@ -8,8 +8,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.getResourceColor -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 0841869dc0..f87ba23f7c 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 54c5571297..7960bdcb6e 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.Interceptor import okhttp3.Request 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 3ae90e0bcd..7dd9639d63 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -11,18 +11,17 @@ 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.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 import timber.log.Timber import java.io.File import java.io.FileInputStream -import java.io.FileWriter import java.io.InputStream import java.util.Locale import java.util.Scanner @@ -207,7 +206,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) @@ -253,7 +252,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())} @@ -261,7 +260,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) )} @@ -270,7 +269,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 7c30ed4107..24d66258ad 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 @@ -5,7 +5,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate 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 c4b711be79..2d6dc40e53 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,10 +3,10 @@ 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 kotlinx.android.synthetic.main.catalogue_main_controller_card.* import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.items.IFlexible +import eu.kanade.tachiyomi.util.system.LocaleHelper +import kotlinx.android.synthetic.main.catalogue_main_controller_card.title class LangHolder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { 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 5f35c4d981..6f5dd4d44a 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 @@ -35,16 +35,16 @@ import eu.kanade.tachiyomi.ui.library.HeightTopWindowInsetsListener 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.RecyclerWindowInsetsListener -import eu.kanade.tachiyomi.util.connectivityManager -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.inflate -import eu.kanade.tachiyomi.util.marginTop -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePaddingRelative -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.inflate +import eu.kanade.tachiyomi.util.view.marginTop +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePaddingRelative +import eu.kanade.tachiyomi.util.view.visible +import eu.kanade.tachiyomi.util.system.connectivityManager import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_controller.* import kotlinx.android.synthetic.main.main_activity.* 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 da868dd269..929b92230b 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,10 +5,11 @@ 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 kotlinx.android.synthetic.main.catalogue_list_item.* import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.items.IFlexible +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 /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the 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 d78d1fd7a0..b467213418 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.* 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 c4f487b25a..a54f6c0edd 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 ad8ff40d00..6c7f867dc9 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 d4c5137eda..e0f9b75879 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 baf8a9dd62..c0d197b14c 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 6f29d45762..678b9a8be1 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 @@ -5,11 +5,12 @@ import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga 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.visible -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.* +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 +import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.title /** * Holder that binds the [CatalogueSearchItem] containing catalogue cards. 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 318d6aebd6..8f610ec033 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 @@ -15,13 +15,15 @@ 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.ui.main.MainActivity -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePaddingRelative -import kotlinx.android.synthetic.main.categories_controller.* +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePaddingRelative +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 /** * Controller to manage the categories for the users' library. 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 b37df4022f..740a141c0a 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,8 +3,10 @@ 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 kotlinx.android.synthetic.main.categories_item.* +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 /** * Holder used to display category items. 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 b5b362eeb2..1695767c3b 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 @@ -30,9 +30,9 @@ 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.RecyclerWindowInsetsListener +import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import eu.kanade.tachiyomi.widget.preference.ListMatPreference +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/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 8b576bacab..04d2a8de3a 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/extension/SettingsExtensionsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/SettingsExtensionsController.kt index 378d87b894..61d0b71a9a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/SettingsExtensionsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/SettingsExtensionsController.kt @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.ui.setting.onChange 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/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 5d961eeccf..88ffaff9b1 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 @@ -18,13 +18,13 @@ 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.ui.category.CategoryAdapter -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.inflate -import eu.kanade.tachiyomi.util.launchUI -import eu.kanade.tachiyomi.util.plusAssign -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePaddingRelative +import eu.kanade.tachiyomi.util.lang.launchUI +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.inflate +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePaddingRelative +import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.library_category.view.* import kotlinx.coroutines.delay 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 1da65b70f8..123e80a3e1 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 @@ -33,7 +33,6 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.LibraryManga 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.ui.base.controller.NucleusController @@ -48,13 +47,13 @@ import eu.kanade.tachiyomi.ui.migration.MigrationInterface import eu.kanade.tachiyomi.ui.migration.manga.design.PreMigrationController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationProcedureConfig -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.inflate -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.marginTop -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.updatePaddingRelative -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.inflate +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.marginTop +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.updatePaddingRelative +import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.ExtendedNavigationView import kotlinx.android.synthetic.main.library_controller.* import kotlinx.android.synthetic.main.main_activity.* 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 7d4c97883a..30274c3062 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 @@ -7,7 +7,6 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.MangaCategory -import eu.kanade.tachiyomi.data.database.models.MangaImpl import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault @@ -20,10 +19,10 @@ 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.ui.migration.MigrationFlags -import eu.kanade.tachiyomi.util.combineLatest -import eu.kanade.tachiyomi.util.isNullOrUnsubscribed -import eu.kanade.tachiyomi.util.removeArticles -import eu.kanade.tachiyomi.util.syncChaptersWithSource +import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource +import eu.kanade.tachiyomi.util.lang.combineLatest +import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed +import eu.kanade.tachiyomi.util.lang.removeArticles import eu.kanade.tachiyomi.widget.ExtendedNavigationView.Item.TriStateGroup.Companion.STATE_EXCLUDE import eu.kanade.tachiyomi.widget.ExtendedNavigationView.Item.TriStateGroup.Companion.STATE_IGNORE import eu.kanade.tachiyomi.widget.ExtendedNavigationView.Item.TriStateGroup.Companion.STATE_INCLUDE @@ -33,12 +32,9 @@ import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.io.IOException -import java.io.InputStream import java.util.ArrayList import java.util.Collections import java.util.Comparator -import java.util.Date /** * Class containing library information. 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 1edec51021..073fa00b9b 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 @@ -53,17 +53,17 @@ 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.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.launchUI -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.marginTop -import eu.kanade.tachiyomi.util.openInBrowser -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePadding -import eu.kanade.tachiyomi.util.updatePaddingRelative -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.lang.launchUI +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.system.getResourceColor +import eu.kanade.tachiyomi.util.view.gone +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.marginTop +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePadding +import eu.kanade.tachiyomi.util.view.updatePaddingRelative +import eu.kanade.tachiyomi.util.view.visible +import eu.kanade.tachiyomi.util.system.openInBrowser import kotlinx.android.synthetic.main.main_activity.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope 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 0b31f0f191..d695df62e0 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 @@ -29,8 +29,8 @@ import eu.kanade.tachiyomi.ui.main.SearchActivity 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 kotlinx.android.synthetic.main.search_activity.sTabs +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 0a232a4af5..fa5945db49 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.* 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 6bb9226d82..a1e1a4f62f 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 @@ -4,7 +4,7 @@ import android.content.Context import android.view.MenuItem import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.getResourceColor +import eu.kanade.tachiyomi.util.system.getResourceColor import java.text.DateFormat import java.text.DecimalFormat import java.text.DecimalFormatSymbols 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 f62028dfd7..c9ab74e405 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 @@ -29,14 +29,14 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.getCoordinates -import eu.kanade.tachiyomi.util.getText -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePaddingRelative +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.getCoordinates +import eu.kanade.tachiyomi.util.view.getText +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePaddingRelative 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 ba01e7fb44..dfc4867972 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 4c763ddcae..f8461fcdf1 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 @@ -61,13 +61,13 @@ 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.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.storage.getUriCompat -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePaddingRelative +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.snack +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePaddingRelative 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 eb9c0f668f..43e6353e5a 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 @@ -18,8 +18,8 @@ import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter +import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed import eu.kanade.tachiyomi.util.storage.DiskUtil -import eu.kanade.tachiyomi.util.isNullOrUnsubscribed import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers @@ -28,9 +28,8 @@ import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.io.File import java.io.FileOutputStream -import java.io.InputStream import java.io.OutputStream -import java.util.* +import java.util.Date /** * Presenter of MangaInfoFragment. 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 5a57a1b72e..4f4daf86c5 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 androidx.recyclerview.widget.RecyclerView import android.view.ViewGroup 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 5dfed3efe9..169ebca3a5 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 @@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.ui.manga.track import android.content.Intent import android.net.Uri -import androidx.recyclerview.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -11,8 +10,8 @@ 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.RecyclerWindowInsetsListener -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import kotlinx.android.synthetic.main.track_controller.* import timber.log.Timber 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 37d4332984..5978c758f1 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 9fde89cd3c..47a57f090e 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.* 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 469a1fd7de..e6f6337f10 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 @@ -15,9 +15,11 @@ 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 kotlinx.android.synthetic.main.track_controller.* -import kotlinx.android.synthetic.main.track_search_dialog.view.* +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 import rx.Subscription import rx.android.schedulers.AndroidSchedulers import rx.subscriptions.CompositeSubscription 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 0715ee770d..8d7b2cab1a 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 4546bdef7c..c70ff66ef0 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. @@ -51,4 +51,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 9631c98383..d77d37f96f 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,7 +4,7 @@ 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.view.getRound import io.github.mthli.slice.Slice import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.* @@ -42,4 +42,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 0cc70f9f5e..595882aa33 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 @@ -45,14 +45,14 @@ 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.GLUtil -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.gone -import eu.kanade.tachiyomi.util.launchUI -import eu.kanade.tachiyomi.util.plusAssign -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.lang.launchUI +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.getResourceColor +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 a11f7e9d13..57f88346dc 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 fb854a8d14..79f5877839 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 @@ -23,7 +23,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 09ab52f234..3b48be03a6 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 d473a4aa5c..aae8d8c1f7 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 @@ -10,7 +10,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 be72081306..c34799d8e3 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 @@ -8,10 +8,8 @@ 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.ui.reader.viewer.pager.PagerConfig -import eu.kanade.tachiyomi.util.ImageUtil -import eu.kanade.tachiyomi.util.plusAssign -import kotlinx.coroutines.async +import eu.kanade.tachiyomi.util.system.ImageUtil +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 b2ba6e9cd9..9bb95453a6 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 3fab78156e..dfcb7112d6 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 @@ -3,9 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.annotation.SuppressLint import android.content.Intent import android.graphics.BitmapFactory -import android.graphics.Color import android.graphics.PointF -import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import android.net.Uri import android.view.GestureDetector @@ -37,11 +35,11 @@ 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.launchUI -import eu.kanade.tachiyomi.util.visible +import eu.kanade.tachiyomi.util.lang.launchUI +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 kotlinx.coroutines.Dispatchers.Default import kotlinx.coroutines.withContext 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 fa38abc4e1..1798eb55a3 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 @@ -2,8 +2,6 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.annotation.SuppressLint import android.graphics.Typeface -import android.os.Build -import androidx.appcompat.widget.AppCompatTextView import android.text.SpannableStringBuilder import android.text.Spanned import android.text.style.StyleSpan @@ -15,11 +13,11 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.LinearLayout import android.widget.ProgressBar import android.widget.TextView +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.getResourceColor +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 1005c85a37..3d171800c2 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 ccc5f22d21..9f40d31dd4 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 8ca0d8a25b..7cc7be9b4e 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 @@ -1,10 +1,14 @@ package eu.kanade.tachiyomi.ui.recent_updates +import android.view.LayoutInflater +import android.view.Menu +import android.view.MenuItem +import android.view.View +import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.view.ActionMode import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import android.view.* import com.jakewharton.rxbinding.support.v4.widget.refreshes import com.jakewharton.rxbinding.support.v7.widget.scrollStateChanges import eu.davidea.flexibleadapter.FlexibleAdapter @@ -16,14 +20,12 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateService import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController import eu.kanade.tachiyomi.ui.base.controller.NucleusController -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.RecyclerWindowInsetsListener -import eu.kanade.tachiyomi.util.notificationManager -import eu.kanade.tachiyomi.util.snack -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.system.notificationManager +import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener +import eu.kanade.tachiyomi.util.view.snack import kotlinx.android.synthetic.main.recent_chapters_controller.* import timber.log.Timber 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 f6b6832a5d..9a293663d2 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 @@ -19,9 +19,10 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.catalogue.browse.ProgressItem import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.RecyclerWindowInsetsListener -import eu.kanade.tachiyomi.util.toast -import kotlinx.android.synthetic.main.recently_read_controller.* +import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener +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 /** * Fragment that shows recently read manga. 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 2bf38f129e..32091a7bf2 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 @@ -4,18 +4,17 @@ import android.app.Dialog import android.content.Intent import android.net.Uri import android.os.Bundle -import androidx.preference.PreferenceScreen import android.view.View +import androidx.preference.PreferenceScreen import com.afollestad.materialdialogs.MaterialDialog import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.updater.UpdateChecker import eu.kanade.tachiyomi.data.updater.UpdateResult -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.toast +import eu.kanade.tachiyomi.util.system.toast import rx.Subscription import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers @@ -25,7 +24,6 @@ import java.text.ParseException import java.text.SimpleDateFormat import java.util.Locale import java.util.TimeZone -import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys class SettingsAboutController : SettingsController() { 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 421693fff6..513ae2f20c 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 @@ -19,13 +19,13 @@ import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.library.LibraryController -import eu.kanade.tachiyomi.util.launchUI -import eu.kanade.tachiyomi.util.toast +import eu.kanade.tachiyomi.util.lang.launchUI import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch +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 4086681b9e..4989540ba0 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 @@ -21,7 +21,10 @@ 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.system.getFilePicker +import eu.kanade.tachiyomi.util.system.registerLocalReceiver +import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.system.unregisterLocalReceiver import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys class SettingsBackupController : SettingsController() { 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 7e28998694..83a548c566 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 @@ -17,7 +17,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 f32c632162..d8f405f6fb 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 @@ -6,8 +6,8 @@ import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.updater.UpdaterJob -import eu.kanade.tachiyomi.util.LocaleHelper import eu.kanade.tachiyomi.widget.preference.IntListMatPreference +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 6bf8824b5d..2ac8ea26ca 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 @@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferenceKeys import eu.kanade.tachiyomi.data.updater.UpdaterJob 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 18d3ccbb05..dc12f13669 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 @@ -14,7 +14,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 eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory 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 1bbbb49eef..e213d685ea 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.shikimori.ShikimoriApi import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi -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 uy.kohesive.injekt.injectLazy 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 80b6fdedf1..78050d4bee 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 @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.webview import android.content.Context import android.content.Intent import android.content.res.Configuration -import android.content.res.Resources import android.graphics.Bitmap import android.graphics.Color import android.os.Build @@ -17,20 +16,19 @@ import android.webkit.WebView import android.widget.LinearLayout import androidx.core.graphics.ColorUtils import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.data.preference.PreferencesHelper 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.WebViewClientCompat -import eu.kanade.tachiyomi.util.doOnApplyWindowInsets -import eu.kanade.tachiyomi.util.getResourceColor -import eu.kanade.tachiyomi.util.invisible -import eu.kanade.tachiyomi.util.marginBottom -import eu.kanade.tachiyomi.util.openInBrowser -import eu.kanade.tachiyomi.util.toast -import eu.kanade.tachiyomi.util.updateLayoutParams -import eu.kanade.tachiyomi.util.updatePadding -import eu.kanade.tachiyomi.util.visible +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.doOnApplyWindowInsets +import eu.kanade.tachiyomi.util.view.invisible +import eu.kanade.tachiyomi.util.view.marginBottom +import eu.kanade.tachiyomi.util.view.updateLayoutParams +import eu.kanade.tachiyomi.util.view.updatePadding +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 8294589fb5..3601905556 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 6c1f5d5b07..dc1e184737 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 93% 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 2a286e09cc..f2f68b5bc9 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.CoroutineScope import kotlinx.coroutines.CoroutineStart diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt new file mode 100644 index 0000000000..509d4c71cf --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt @@ -0,0 +1,10 @@ +package eu.kanade.tachiyomi.util.lang + +import java.text.DateFormat +import java.util.Date + +fun Date.toTimestampString(dateFormatter: DateFormat): String { + val date = dateFormatter.format(this) + val time = DateFormat.getTimeInstance(DateFormat.SHORT).format(this) + return "$date $time" +} 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 64% 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 6a21dd8fa9..bbbff6aa13 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,7 +11,6 @@ fun String.chop(count: Int, replacement: String = "..."): String { take(count - replacement.length) + replacement else this - } fun String.removeArticles(): String { @@ -22,11 +21,18 @@ fun String.removeArticles(): String { * 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 ab3631f764..e14d200d54 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 99% 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 fe3b391d73..0f1ca55bf6 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 android.graphics.Bitmap import android.graphics.Color 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 80794e6e73..420fb135ae 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 2f07474a33..e27f28dd5e 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 androidx.annotation.DrawableRes import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat 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 99% 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 69b4f32b48..920b3a2d8d 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.content.Context import android.graphics.Color 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 1c22523ff2..1da0b4d986 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 androidx.annotation.LayoutRes import android.view.LayoutInflater 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 bef33dc26e..ccefd385c4 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 a8fdf1b484..b6195a7d9a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt @@ -5,8 +5,9 @@ import androidx.annotation.StringRes import android.util.AttributeSet import android.widget.LinearLayout import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.inflate -import kotlinx.android.synthetic.main.common_dialog_with_checkbox.view.* +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 class DialogCheckboxView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : LinearLayout(context, attrs) { 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 6715bb17d3..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,9 +5,10 @@ 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 kotlinx.android.synthetic.main.common_view_empty.view.* +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 class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : RelativeLayout (context, attrs) { 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 f34bee41c2..af5da9612c 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 android.util.AttributeSet import android.view.View import android.view.ViewGroup 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 05928c6fbb..49e396efd6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt @@ -16,7 +16,7 @@ import androidx.core.view.ViewCompat 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 6f1eefa263..5768afe90c 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 android.widget.ImageView.ScaleType 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 5f35d7eb4e..62e1765a6a 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,9 +9,10 @@ import android.view.View 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 kotlinx.android.synthetic.main.pref_item_source.view.* +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 class LoginCheckBoxPreference @JvmOverloads constructor( context: Context, 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 42cf0b18ec..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,8 +6,11 @@ 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 kotlinx.android.synthetic.main.pref_account_login.view.* +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 +import kotlinx.android.synthetic.main.pref_account_login.view.username import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt 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 8e0181fa18..24f9a68218 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 android.widget.Checkable import android.widget.CompoundButton import android.widget.TextView 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 dcd99390ba..baf6806eaf 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,8 +5,11 @@ 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 kotlinx.android.synthetic.main.pref_account_login.view.* +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 +import kotlinx.android.synthetic.main.pref_account_login.view.username import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import uy.kohesive.injekt.Injekt diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2728edb84a..a892aa119f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -366,6 +366,7 @@ Show password Login Logout + Logout from %1$s? Successfully logged in You are now logged out Could not log in 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