From 25bf5602ba7b270a1efe5164376ace7ab06a162c Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 28 Oct 2019 22:51:46 -0700 Subject: [PATCH] Migration for androidx --- app/build.gradle | 69 +++++++++++-------- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/eu/kanade/tachiyomi/App.kt | 2 +- .../java/eu/kanade/tachiyomi/Migrations.kt | 2 +- .../data/backup/BackupCreateService.kt | 3 +- .../tachiyomi/data/cache/ChapterCache.kt | 8 ++- .../tachiyomi/data/database/DatabaseHelper.kt | 2 +- .../tachiyomi/data/database/DbOpenCallback.kt | 4 +- .../resolvers/HistoryLastReadPutResolver.kt | 2 +- .../data/download/DownloadNotifier.kt | 2 +- .../data/download/DownloadService.kt | 2 +- .../tachiyomi/data/download/Downloader.kt | 4 +- .../data/library/LibraryUpdateService.kt | 2 +- .../preference/EmptyPreferenceDataStore.kt | 2 +- .../preference/SharedPreferencesDataStore.kt | 2 +- .../tachiyomi/data/track/TrackService.kt | 4 +- .../data/track/anilist/AnilistApi.kt | 11 +-- .../data/track/bangumi/BangumiApi.kt | 8 +-- .../data/track/bangumi/BangumiInterceptor.kt | 10 +-- .../data/track/kitsu/KitsuInterceptor.kt | 2 +- .../tachiyomi/data/track/kitsu/KitsuModels.kt | 2 +- .../data/track/myanimelist/MyAnimeList.kt | 7 +- .../myanimelist/MyAnimeListInterceptor.kt | 2 +- .../data/track/myanimelist/MyanimelistApi.kt | 16 +++-- .../data/track/shikimori/ShikimoriApi.kt | 13 ++-- .../track/shikimori/ShikimoriInterceptor.kt | 2 +- .../tachiyomi/data/updater/UpdaterJob.kt | 2 +- .../tachiyomi/data/updater/UpdaterNotifier.kt | 2 +- .../tachiyomi/data/updater/UpdaterService.kt | 2 +- .../extension/api/ExtensionGithubApi.kt | 2 +- .../tachiyomi/network/AndroidCookieJar.kt | 12 +--- .../network/CloudflareInterceptor.kt | 8 +-- .../kanade/tachiyomi/network/NetworkHelper.kt | 2 +- .../tachiyomi/network/OkHttpExtensions.kt | 6 +- .../tachiyomi/network/ProgressResponseBody.kt | 2 +- .../tachiyomi/source/ConfigurableSource.kt | 4 +- .../ui/base/activity/BaseActivity.kt | 2 +- .../ui/base/controller/BaseController.kt | 2 +- .../ui/base/controller/ConductorExtensions.kt | 2 +- .../ui/base/controller/DialogController.java | 4 +- .../ui/base/controller/RxController.kt | 2 +- .../controller/SecondaryDrawerController.kt | 6 +- .../ui/base/controller/TabbedController.kt | 2 +- .../ui/base/holder/BaseFlexibleViewHolder.kt | 2 + .../ui/base/holder/BaseViewHolder.kt | 4 +- .../presenter/NucleusConductorDelegate.java | 2 +- .../NucleusConductorLifecycleListener.java | 2 +- .../ui/catalogue/CatalogueController.kt | 10 +-- .../tachiyomi/ui/catalogue/LangHolder.kt | 4 +- .../kanade/tachiyomi/ui/catalogue/LangItem.kt | 8 +-- .../catalogue/SourceDividerItemDecoration.kt | 12 ++-- .../tachiyomi/ui/catalogue/SourceItem.kt | 8 +-- .../browse/BrowseCatalogueController.kt | 37 +++++----- .../catalogue/browse/CatalogueGridHolder.kt | 4 +- .../ui/catalogue/browse/CatalogueHolder.kt | 4 +- .../ui/catalogue/browse/CatalogueItem.kt | 8 ++- .../catalogue/browse/CatalogueListHolder.kt | 4 +- .../ui/catalogue/browse/ProgressItem.kt | 8 ++- .../ui/catalogue/filter/CheckboxItem.kt | 8 ++- .../ui/catalogue/filter/GroupItem.kt | 8 ++- .../ui/catalogue/filter/HeaderItem.kt | 10 +-- .../ui/catalogue/filter/SelectItem.kt | 8 ++- .../ui/catalogue/filter/SeparatorItem.kt | 11 +-- .../ui/catalogue/filter/SortGroup.kt | 8 ++- .../tachiyomi/ui/catalogue/filter/SortItem.kt | 12 ++-- .../tachiyomi/ui/catalogue/filter/TextItem.kt | 10 +-- .../ui/catalogue/filter/TriStateItem.kt | 12 ++-- .../global_search/CatalogueSearchAdapter.kt | 10 +-- .../global_search/CatalogueSearchCardItem.kt | 8 ++- .../CatalogueSearchController.kt | 6 +- .../global_search/CatalogueSearchHolder.kt | 5 +- .../global_search/CatalogueSearchItem.kt | 8 ++- .../latest/LatestUpdatesController.kt | 6 +- .../ui/category/CategoryController.kt | 16 ++--- .../tachiyomi/ui/category/CategoryItem.kt | 10 ++- .../tachiyomi/ui/download/DownloadAdapter.kt | 4 +- .../ui/download/DownloadController.kt | 4 +- .../ui/extension/ExtensionController.kt | 8 +-- .../extension/ExtensionDetailsController.kt | 26 +++---- .../ExtensionDividerItemDecoration.kt | 12 ++-- .../ui/extension/ExtensionGroupHolder.kt | 4 +- .../ui/extension/ExtensionGroupItem.kt | 8 ++- .../tachiyomi/ui/extension/ExtensionItem.kt | 8 ++- .../ui/library/LibraryCategoryAdapter.kt | 8 ++- .../ui/library/LibraryCategoryView.kt | 21 +++--- .../tachiyomi/ui/library/LibraryController.kt | 20 +++--- .../tachiyomi/ui/library/LibraryGridHolder.kt | 4 +- .../tachiyomi/ui/library/LibraryHolder.kt | 4 +- .../tachiyomi/ui/library/LibraryItem.kt | 10 +-- .../tachiyomi/ui/library/LibraryListHolder.kt | 4 +- .../kanade/tachiyomi/ui/main/MainActivity.kt | 24 +++---- .../kanade/tachiyomi/ui/main/TabsAnimator.kt | 2 +- .../tachiyomi/ui/manga/MangaController.kt | 4 +- .../tachiyomi/ui/manga/chapter/ChapterItem.kt | 8 ++- .../ui/manga/chapter/ChaptersController.kt | 16 ++--- .../ui/manga/info/MangaInfoController.kt | 14 ++-- .../tachiyomi/ui/manga/track/TrackAdapter.kt | 4 +- .../ui/manga/track/TrackController.kt | 4 +- .../tachiyomi/ui/migration/MangaHolder.kt | 4 +- .../tachiyomi/ui/migration/MangaItem.kt | 8 ++- .../ui/migration/MigrationController.kt | 9 +-- .../tachiyomi/ui/migration/SelectionHeader.kt | 10 +-- .../tachiyomi/ui/migration/SourceItem.kt | 8 ++- .../ui/reader/PageIndicatorTextView.kt | 2 +- .../tachiyomi/ui/reader/ReaderActivity.kt | 2 +- .../ui/reader/ReaderColorFilterSheet.kt | 6 +- .../tachiyomi/ui/reader/ReaderPageSheet.kt | 2 +- .../tachiyomi/ui/reader/ReaderSeekBar.kt | 3 +- .../ui/reader/ReaderSettingsSheet.kt | 4 +- .../tachiyomi/ui/reader/SaveImageNotifier.kt | 2 +- .../tachiyomi/ui/reader/loader/PageLoader.kt | 2 +- .../tachiyomi/ui/reader/viewer/pager/Pager.kt | 2 +- .../ui/reader/viewer/pager/PagerButton.kt | 2 +- .../viewer/pager/PagerTransitionHolder.kt | 2 +- .../ui/reader/viewer/pager/PagerViewer.kt | 6 +- .../reader/viewer/pager/PagerViewerAdapter.kt | 4 +- .../reader/viewer/webtoon/WebtoonAdapter.kt | 12 ++-- .../viewer/webtoon/WebtoonLayoutManager.kt | 8 +-- .../viewer/webtoon/WebtoonPageHolder.kt | 4 +- .../viewer/webtoon/WebtoonRecyclerView.kt | 8 +-- .../viewer/webtoon/WebtoonTransitionHolder.kt | 4 +- .../ui/reader/viewer/webtoon/WebtoonViewer.kt | 8 +-- .../tachiyomi/ui/recent_updates/DateItem.kt | 8 ++- .../ui/recent_updates/RecentChapterItem.kt | 8 ++- .../RecentChaptersController.kt | 14 ++-- .../recently_read/RecentlyReadController.kt | 4 +- .../ui/recently_read/RecentlyReadItem.kt | 8 ++- .../ui/setting/AnilistLoginActivity.kt | 2 +- .../ui/setting/BangumiLoginActivity.kt | 2 +- .../tachiyomi/ui/setting/PreferenceDSL.kt | 6 +- .../ui/setting/SettingsAboutController.kt | 2 +- .../ui/setting/SettingsAdvancedController.kt | 2 +- .../ui/setting/SettingsBackupController.kt | 2 +- .../ui/setting/SettingsController.kt | 6 +- .../ui/setting/SettingsDownloadController.kt | 4 +- .../ui/setting/SettingsGeneralController.kt | 4 +- .../ui/setting/SettingsMainController.kt | 2 +- .../ui/setting/SettingsReaderController.kt | 2 +- .../ui/setting/SettingsSourcesController.kt | 4 +- .../ui/setting/SettingsTrackingController.kt | 4 +- .../ui/setting/ShikomoriLoginActivity.kt | 2 +- .../tachiyomi/util/ContextExtensions.kt | 20 +++--- .../java/eu/kanade/tachiyomi/util/DiskUtil.kt | 4 +- .../kanade/tachiyomi/util/FileExtensions.kt | 2 +- .../tachiyomi/util/ImageViewExtensions.kt | 4 +- .../kanade/tachiyomi/util/JsoupExtensions.kt | 2 +- .../kanade/tachiyomi/util/OkioExtensions.kt | 4 +- .../kanade/tachiyomi/util/ViewExtensions.kt | 12 ++-- .../tachiyomi/util/ViewGroupExtensions.kt | 2 +- .../tachiyomi/widget/AutofitRecyclerView.kt | 8 +-- .../tachiyomi/widget/CustomLayoutPicker.kt | 4 +- .../tachiyomi/widget/DialogCheckboxView.kt | 2 +- .../widget/DrawerSwipeCloseListener.kt | 10 +-- .../tachiyomi/widget/ElevationAppBarLayout.kt | 4 +- .../widget/ExtendedNavigationView.kt | 10 +-- .../tachiyomi/widget/FABAnimationBase.kt | 10 +-- .../tachiyomi/widget/FABAnimationUpDown.kt | 4 +- .../widget/PreCachingLayoutManager.kt | 8 +-- .../tachiyomi/widget/SimpleNavigationView.kt | 22 +++--- .../tachiyomi/widget/StateImageViewTarget.kt | 2 +- .../tachiyomi/widget/ViewPagerAdapter.kt | 4 +- .../widget/preference/IntListPreference.kt | 2 +- .../preference/LoginCheckBoxPreference.kt | 4 +- .../widget/preference/LoginPreference.kt | 4 +- .../preference/SwitchPreferenceCategory.kt | 6 +- .../res/layout-land/manga_info_controller.xml | 22 +++--- .../layout-land/reader_color_filter_sheet.xml | 10 +-- .../main/res/layout/catalogue_controller.xml | 4 +- .../catalogue_global_search_controller.xml | 2 +- ...atalogue_global_search_controller_card.xml | 10 +-- ...gue_global_search_controller_card_item.xml | 4 +- .../main/res/layout/catalogue_grid_item.xml | 4 +- .../main/res/layout/catalogue_list_item.xml | 4 +- .../res/layout/catalogue_main_controller.xml | 2 +- .../catalogue_main_controller_card_item.xml | 4 +- .../main/res/layout/categories_controller.xml | 4 +- .../main/res/layout/chapters_controller.xml | 14 ++-- app/src/main/res/layout/chapters_item.xml | 4 +- app/src/main/res/layout/common_view_empty.xml | 2 +- .../main/res/layout/download_controller.xml | 2 +- .../res/layout/download_custom_amount.xml | 8 +-- .../main/res/layout/extension_card_header.xml | 4 +- .../main/res/layout/extension_card_item.xml | 4 +- .../main/res/layout/extension_controller.xml | 6 +- .../layout/extension_detail_controller.xml | 8 +-- app/src/main/res/layout/library_category.xml | 4 +- .../main/res/layout/library_controller.xml | 2 +- .../main/res/layout/library_list_recycler.xml | 2 +- app/src/main/res/layout/main_activity.xml | 10 +-- app/src/main/res/layout/manga_controller.xml | 2 +- .../main/res/layout/manga_info_controller.xml | 28 ++++---- .../main/res/layout/migration_controller.xml | 2 +- .../main/res/layout/navigation_view_text.xml | 6 +- app/src/main/res/layout/reader_activity.xml | 2 +- .../main/res/layout/reader_color_filter.xml | 16 ++--- .../res/layout/reader_color_filter_sheet.xml | 6 +- .../main/res/layout/reader_settings_sheet.xml | 40 +++++------ .../res/layout/recent_chapters_controller.xml | 6 +- .../main/res/layout/recent_chapters_item.xml | 4 +- .../res/layout/recently_read_controller.xml | 4 +- .../main/res/layout/recently_read_item.xml | 4 +- app/src/main/res/layout/track_controller.xml | 6 +- app/src/main/res/layout/track_item.xml | 8 +-- app/src/main/res/layout/track_search_item.xml | 10 +-- app/src/main/res/menu/catalogue_list.xml | 2 +- app/src/main/res/menu/catalogue_main.xml | 2 +- app/src/main/res/menu/catalogue_new_list.xml | 2 +- app/src/main/res/menu/extension_main.xml | 2 +- app/src/main/res/menu/library.xml | 2 +- app/src/main/res/values-night/themes.xml | 2 +- app/src/main/res/values/themes.xml | 6 +- gradle.properties | 4 +- 212 files changed, 748 insertions(+), 661 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f2c547399..555abc895d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { applicationId "eu.kanade.tachiyomi" minSdkVersion 21 targetSdkVersion 29 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" versionCode 41 versionName "0.8.4" @@ -76,7 +76,6 @@ android { dimension "default" } dev { - minSdkVersion 21 resConfigs "en", "xxhdpi" dimension "default" } @@ -95,6 +94,15 @@ android { checkReleaseBuilds false } + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } + + kotlinOptions { + jvmTarget = "1.8" + } + } dependencies { @@ -104,35 +112,36 @@ dependencies { implementation 'com.github.inorichi:junrar-android:634c1f5' // Android support library - final support_library_version = '28.0.0' - implementation "com.android.support:support-v4:$support_library_version" - implementation "com.android.support:appcompat-v7:$support_library_version" - implementation "com.android.support:cardview-v7:$support_library_version" - implementation "com.android.support:design:$support_library_version" - implementation "com.android.support:recyclerview-v7:$support_library_version" - implementation "com.android.support:preference-v7:$support_library_version" - implementation "com.android.support:support-annotations:$support_library_version" - implementation "com.android.support:customtabs:$support_library_version" + implementation 'com.android.support:preference-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'androidx.preference:preference:1.1.0' + implementation 'androidx.annotation:annotation:1.1.0' + implementation 'androidx.browser:browser:1.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.2' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - implementation 'com.android.support:multidex:1.0.3' + implementation 'androidx.multidex:multidex:2.0.1' standardImplementation 'com.google.firebase:firebase-core:11.8.0' // ReactiveX implementation 'io.reactivex:rxandroid:1.2.1' - implementation 'io.reactivex:rxjava:1.3.6' + implementation 'io.reactivex:rxjava:1.3.8' implementation 'com.jakewharton.rxrelay:rxrelay:1.2.0' implementation 'com.f2prateek.rx.preferences:rx-preferences:1.0.2' - implementation 'com.github.pwittchen:reactivenetwork:0.7.0' + implementation 'com.github.pwittchen:reactivenetwork:0.13.0' // Network client - implementation "com.squareup.okhttp3:okhttp:3.10.0" - implementation 'com.squareup.okio:okio:1.14.0' + final okhttp_version = "4.2.1" + implementation "com.squareup.okhttp3:okhttp:$okhttp_version" + implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version" + implementation 'com.squareup.okio:okio:2.4.0' // REST - final retrofit_version = '2.3.0' + final retrofit_version = '2.6.2' implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" @@ -149,17 +158,17 @@ dependencies { implementation 'com.github.inorichi:unifile:e9ee588' // HTML parser - implementation 'org.jsoup:jsoup:1.10.2' + implementation 'org.jsoup:jsoup:1.12.1' // Job scheduling implementation 'com.evernote:android-job:1.2.5' - implementation 'com.google.android.gms:play-services-gcm:11.8.0' + implementation 'com.google.android.gms:play-services-gcm:17.0.0' // Changelog implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' // Database - implementation 'android.arch.persistence:db:1.0.0' + implementation 'androidx.sqlite:sqlite:2.0.1' implementation 'com.github.inorichi.storio:storio-common:8be19de@aar' implementation 'com.github.inorichi.storio:storio-sqlite:8be19de@aar' implementation 'io.requery:sqlite-android:3.25.2' @@ -173,16 +182,16 @@ dependencies { implementation "com.github.inorichi.injekt:injekt-core:65b0440" // Image library - final glide_version = '4.6.1' + final glide_version = '4.10.0' implementation "com.github.bumptech.glide:glide:$glide_version" implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version" kapt "com.github.bumptech.glide:compiler:$glide_version" // Transformations - implementation 'jp.wasabeef:glide-transformations:3.1.1' + implementation 'jp.wasabeef:glide-transformations:4.0.0' // Logging - implementation 'com.jakewharton.timber:timber:4.6.1' + implementation 'com.jakewharton.timber:timber:4.7.1' // Crash reports implementation 'ch.acra:acra:4.9.2' @@ -193,24 +202,24 @@ dependencies { // UI implementation 'com.dmitrymalkovich.android:material-design-dimens:1.4' implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4' - implementation 'eu.davidea:flexible-adapter:5.0.0-rc4' - implementation 'eu.davidea:flexible-adapter-ui:1.0.0-b1' + implementation 'eu.davidea:flexible-adapter:5.1.0' + implementation 'eu.davidea:flexible-adapter-ui:1.0.0' implementation 'com.nononsenseapps:filepicker:2.5.2' implementation 'com.github.amulyakhare:TextDrawable:558677e' implementation 'com.afollestad.material-dialogs:core:0.9.6.0' implementation 'me.zhanghai.android.systemuihelper:library:1.0.0' - implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4' + implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0' implementation 'com.github.mthli:Slice:v1.2' implementation 'me.gujun.android.taggroup:library:1.4@aar' - implementation 'com.github.chrisbanes:PhotoView:2.1.3' - implementation 'com.github.inorichi:DirectionalViewPager:3acc51a' + implementation 'com.github.chrisbanes:PhotoView:2.3.0' + implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a' // Conductor implementation 'com.bluelinelabs:conductor:2.1.5' implementation ("com.bluelinelabs:conductor-support:2.1.5") { exclude group: "com.android.support" } - implementation 'com.github.inorichi:conductor-support-preference:27.0.2' + implementation 'com.github.inorichi:conductor-support-preference:78e2344' // RxBindings final rxbindings_version = '1.0.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9c09b0f24f..b6b6e2b5ef 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -99,7 +99,7 @@ android:theme="@android:style/Theme.Translucent.NoTitleBar"/> diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index ef4564f777..7a2688b924 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi import android.app.Application import android.content.Context import android.content.res.Configuration -import android.support.multidex.MultiDex +import androidx.multidex.MultiDex import com.evernote.android.job.JobManager import eu.kanade.tachiyomi.data.backup.BackupCreatorJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 3a46947180..7fc1bcaf94 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -39,7 +39,7 @@ object Migrations { if (oldDir.exists()) { val destDir = context.getExternalFilesDir("covers") if (destDir != null) { - oldDir.listFiles().forEach { + oldDir.listFiles()?.forEach { it.renameTo(File(destDir, it.name)) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreateService.kt index 0d993a7019..d7095642db 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreateService.kt @@ -57,7 +57,8 @@ class BackupCreateService : IntentService(NAME) { val uri = intent.getParcelableExtra(BackupConst.EXTRA_URI) val flags = intent.getIntExtra(EXTRA_FLAGS, 0) // Create backup - backupManager.createBackup(uri, flags, false) + if (uri != null) + backupManager.createBackup(uri, flags, false) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index 4868dec1ec..f606e6640c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt @@ -11,6 +11,8 @@ import eu.kanade.tachiyomi.util.DiskUtil import eu.kanade.tachiyomi.util.saveTo import okhttp3.Response import okio.Okio +import okio.buffer +import okio.sink import rx.Observable import uy.kohesive.injekt.injectLazy import java.io.File @@ -126,7 +128,7 @@ class ChapterCache(private val context: Context) { editor = diskCache.edit(key) ?: return // Write chapter urls to cache. - Okio.buffer(Okio.sink(editor.newOutputStream(0))).use { + editor.newOutputStream(0).sink().buffer().use { it.write(cachedValue.toByteArray()) it.flush() } @@ -186,12 +188,12 @@ class ChapterCache(private val context: Context) { editor = diskCache.edit(key) ?: throw IOException("Unable to edit key") // Get OutputStream and write image with Okio. - response.body()!!.source().saveTo(editor.newOutputStream(0)) + response.body!!.source().saveTo(editor.newOutputStream(0)) diskCache.flush() editor.commit() } finally { - response.body()?.close() + response.body?.close() editor?.abortUnlessCommitted() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.kt index 6148e49ae7..711cefbcb3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/DatabaseHelper.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.data.database -import android.arch.persistence.db.SupportSQLiteOpenHelper +import androidx.sqlite.db.SupportSQLiteOpenHelper import android.content.Context import com.pushtorefresh.storio.sqlite.impl.DefaultStorIOSQLite import eu.kanade.tachiyomi.data.database.mappers.* diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt index cf65b6a1d6..1497963f41 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.data.database -import android.arch.persistence.db.SupportSQLiteDatabase -import android.arch.persistence.db.SupportSQLiteOpenHelper +import androidx.sqlite.db.SupportSQLiteDatabase +import androidx.sqlite.db.SupportSQLiteOpenHelper import android.content.Context import android.database.sqlite.SQLiteDatabase import android.database.sqlite.SQLiteOpenHelper diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/HistoryLastReadPutResolver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/HistoryLastReadPutResolver.kt index b9d583d4c9..f1d68c22a9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/HistoryLastReadPutResolver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/HistoryLastReadPutResolver.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.data.database.resolvers import android.content.ContentValues -import android.support.annotation.NonNull +import androidx.annotation.NonNull import com.pushtorefresh.storio.sqlite.StorIOSQLite import com.pushtorefresh.storio.sqlite.operations.put.PutResult import com.pushtorefresh.storio.sqlite.queries.Query 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 af9d84c0af..016c93a85c 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.data.download import android.content.Context import android.graphics.BitmapFactory -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.DownloadQueue 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 8fdb4f6267..860dbf145d 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 @@ -9,7 +9,7 @@ import android.net.NetworkInfo.State.DISCONNECTED import android.os.Build import android.os.IBinder import android.os.PowerManager -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import com.github.pwittchen.reactivenetwork.library.Connectivity import com.github.pwittchen.reactivenetwork.library.ReactiveNetwork import com.jakewharton.rxrelay.BehaviorRelay 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 f49585bc2e..5c232fb64f 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 @@ -351,7 +351,7 @@ class Downloader( .map { response -> val file = tmpDir.createFile("$filename.tmp") try { - response.body()!!.source().saveTo(file.openOutputStream()) + response.body!!.source().saveTo(file.openOutputStream()) val extension = getImageExtension(response, file) file.renameTo("$filename.$extension") } catch (e: Exception) { @@ -374,7 +374,7 @@ class Downloader( */ private fun getImageExtension(response: Response, file: UniFile): String { // Read content type if available. - val mime = response.body()?.contentType()?.let { ct -> "${ct.type()}/${ct.subtype()}" } + val mime = response.body?.contentType()?.let { ct -> "${ct.type}/${ct.subtype}" } // Else guess from the uri. ?: context.contentResolver.getType(file.uri) // Else read magic numbers. 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 415a458687..0b9517c5b6 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 @@ -9,7 +9,7 @@ import android.graphics.BitmapFactory import android.os.Build import android.os.IBinder import android.os.PowerManager -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/EmptyPreferenceDataStore.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/EmptyPreferenceDataStore.kt index 10e83b84eb..d162cfd659 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/EmptyPreferenceDataStore.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/EmptyPreferenceDataStore.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.data.preference -import android.support.v7.preference.PreferenceDataStore +import androidx.preference.PreferenceDataStore class EmptyPreferenceDataStore : PreferenceDataStore() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/SharedPreferencesDataStore.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/SharedPreferencesDataStore.kt index 8ac81e6b2b..03a4d17187 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/SharedPreferencesDataStore.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/SharedPreferencesDataStore.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.data.preference import android.content.SharedPreferences -import android.support.v7.preference.PreferenceDataStore +import androidx.preference.PreferenceDataStore class SharedPreferencesDataStore(private val prefs: SharedPreferences) : PreferenceDataStore() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt index 9397f71e42..417e8ba5ce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.data.track -import android.support.annotation.CallSuper -import android.support.annotation.DrawableRes +import androidx.annotation.CallSuper +import androidx.annotation.DrawableRes import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.data.preference.PreferencesHelper diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 041852ea0f..92c01aac93 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.network.asObservableSuccess import okhttp3.MediaType +import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody @@ -18,7 +19,7 @@ import java.util.Calendar class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { private val parser = JsonParser() - private val jsonMime = MediaType.parse("application/json; charset=utf-8") + private val jsonMime = "application/json; charset=utf-8".toMediaTypeOrNull() private val authClient = client.newBuilder().addInterceptor(interceptor).build() @@ -45,7 +46,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() netResponse.close() if (responseBody.isEmpty()) { throw Exception("Null Response") @@ -128,7 +129,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } @@ -189,7 +190,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } @@ -235,7 +236,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt index 661c265236..c678372c6b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt @@ -84,7 +84,7 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } @@ -127,7 +127,7 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept .asObservableSuccess() .map { netResponse -> // get comic info - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() jsonToTrack(parser.parse(responseBody).obj) } } @@ -144,7 +144,7 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept return authClient.newCall(requestUserRead) .asObservableSuccess() .map { netResponse -> - val resp = netResponse.body()?.string() + val resp = netResponse.body?.string() val coll = gson.fromJson(resp, Collection::class.java) track.status = coll.status?.id!! track.last_chapter_read = coll.ep_status!! @@ -154,7 +154,7 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept fun accessToken(code: String): Observable { return client.newCall(accessTokenRequest(code)).asObservableSuccess().map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt index 69565f447b..b403daf8a9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt @@ -14,7 +14,7 @@ class BangumiInterceptor(val bangumi: Bangumi, val gson: Gson) : Interceptor { fun addTocken(tocken: String, oidFormBody: FormBody): FormBody { val newFormBody = FormBody.Builder() - for (i in 0 until oidFormBody.size()) { + for (i in 0 until oidFormBody.size) { newFormBody.add(oidFormBody.name(i), oidFormBody.value(i)) } newFormBody.add("access_token", tocken) @@ -29,18 +29,18 @@ class BangumiInterceptor(val bangumi: Bangumi, val gson: Gson) : Interceptor { if (currAuth.isExpired()) { val response = chain.proceed(BangumiApi.refreshTokenRequest(currAuth.refresh_token!!)) if (response.isSuccessful) { - newAuth(gson.fromJson(response.body()!!.string(), OAuth::class.java)) + newAuth(gson.fromJson(response.body!!.string(), OAuth::class.java)) } else { response.close() } } - var authRequest = if (originalRequest.method() == "GET") originalRequest.newBuilder() + var authRequest = if (originalRequest.method == "GET") originalRequest.newBuilder() .header("User-Agent", "Tachiyomi") - .url(originalRequest.url().newBuilder() + .url(originalRequest.url.newBuilder() .addQueryParameter("access_token", currAuth.access_token).build()) .build() else originalRequest.newBuilder() - .post(addTocken(currAuth.access_token, originalRequest.body() as FormBody)) + .post(addTocken(currAuth.access_token, originalRequest.body as FormBody)) .header("User-Agent", "Tachiyomi") .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt index 8810dd2743..1a74b8d9ec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt @@ -22,7 +22,7 @@ class KitsuInterceptor(val kitsu: Kitsu, val gson: Gson) : Interceptor { if (currAuth.isExpired()) { val response = chain.proceed(KitsuApi.refreshTokenRequest(refreshToken)) if (response.isSuccessful) { - newAuth(gson.fromJson(response.body()!!.string(), OAuth::class.java)) + newAuth(gson.fromJson(response.body!!.string(), OAuth::class.java)) } else { response.close() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt index ca0de7d3d3..5a3df974b3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuModels.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.data.track.kitsu -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import com.github.salomonbrys.kotson.* import com.google.gson.JsonObject import eu.kanade.tachiyomi.data.database.models.Track diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt index fbfc1e019b..35d821111c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt @@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.model.TrackSearch import okhttp3.HttpUrl +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import rx.Completable import rx.Observable import java.lang.Exception @@ -134,7 +135,7 @@ class Myanimelist(private val context: Context, id: Int) : TrackService(id) { override fun logout() { super.logout() preferences.trackToken(this).delete() - networkService.cookieManager.remove(HttpUrl.parse(BASE_URL)!!) + networkService.cookieManager.remove(BASE_URL.toHttpUrlOrNull()!!) } val isAuthorized: Boolean @@ -148,9 +149,9 @@ class Myanimelist(private val context: Context, id: Int) : TrackService(id) { private fun checkCookies(): Boolean { var ckCount = 0 - val url = HttpUrl.parse(BASE_URL)!! + val url = BASE_URL.toHttpUrlOrNull()!! for (ck in networkService.cookieManager.get(url)) { - if (ck.name() == USER_SESSION_COOKIE || ck.name() == LOGGED_IN_COOKIE) + if (ck.name == USER_SESSION_COOKIE || ck.name == LOGGED_IN_COOKIE) ckCount++ } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt index 0a032c6a5b..9089c3a343 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt @@ -12,7 +12,7 @@ class MyAnimeListInterceptor(private val myanimelist: Myanimelist): Interceptor myanimelist.ensureLoggedIn() var request = chain.request() - request.body()?.let { + request.body?.let { val contentType = it.contentType().toString() val updatedBody = when { contentType.contains("x-www-form-urlencoded") -> updateFormBody(it) 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 efc3abefc0..5462eb4f92 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 @@ -11,6 +11,8 @@ import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.util.selectInt import eu.kanade.tachiyomi.util.selectText import okhttp3.* +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.RequestBody.Companion.toRequestBody import org.json.JSONObject import org.jsoup.Jsoup import org.jsoup.nodes.Document @@ -85,7 +87,7 @@ class MyanimelistApi(private val client: OkHttpClient, interceptor: MyAnimeListI .map {response -> var libTrack: Track? = null response.use { - if (it.priorResponse()?.isRedirect != true) { + if (it.priorResponse?.isRedirect != true) { val trackForm = Jsoup.parse(it.consumeBody()) libTrack = Track.create(TrackManager.MYANIMELIST).apply { @@ -125,7 +127,7 @@ class MyanimelistApi(private val client: OkHttpClient, interceptor: MyAnimeListI val response = client.newCall(POST(url = loginUrl(), body = loginPostBody(username, password, csrf))).execute() response.use { - if (response.priorResponse()?.code() != 302) throw Exception("Authentication error") + if (response.priorResponse?.code != 302) throw Exception("Authentication error") } } @@ -172,15 +174,15 @@ class MyanimelistApi(private val client: OkHttpClient, interceptor: MyAnimeListI private fun Response.consumeBody(): String? { use { - if (it.code() != 200) throw Exception("HTTP error ${it.code()}") - return it.body()?.string() + if (it.code != 200) throw Exception("HTTP error ${it.code}") + return it.body?.string() } } private fun Response.consumeXmlBody(): String? { use { res -> - if (res.code() != 200) throw Exception("Export list error") - BufferedReader(InputStreamReader(GZIPInputStream(res.body()?.source()?.inputStream()))).use { reader -> + if (res.code != 200) throw Exception("Export list error") + BufferedReader(InputStreamReader(GZIPInputStream(res.body?.source()?.inputStream()))).use { reader -> val sb = StringBuilder() reader.forEachLine { line -> sb.append(line) @@ -262,7 +264,7 @@ class MyanimelistApi(private val client: OkHttpClient, interceptor: MyAnimeListI .put("score", track.score) .put("num_read_chapters", track.last_chapter_read) - return RequestBody.create(MediaType.parse("application/json; charset=utf-8"), body.toString()) + return body.toString().toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull()) } private fun Element.searchTitle() = select("strong").text()!! diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt index 0180e015eb..afef886bab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt @@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservableSuccess import okhttp3.* +import okhttp3.MediaType.Companion.toMediaTypeOrNull import rx.Observable import uy.kohesive.injekt.injectLazy @@ -22,7 +23,7 @@ class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInter private val gson: Gson by injectLazy() private val parser = JsonParser() - private val jsonime = MediaType.parse("application/json; charset=utf-8") + private val jsonime = "application/json; charset=utf-8".toMediaTypeOrNull() private val authClient = client.newBuilder().addInterceptor(interceptor).build() fun addLibManga(track: Track, user_id: String): Observable { @@ -63,7 +64,7 @@ class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInter return authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } @@ -120,13 +121,13 @@ class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInter return authClient.newCall(requestMangas) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() parser.parse(responseBody).obj }.flatMap { mangas -> authClient.newCall(request) .asObservableSuccess() .map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } @@ -143,13 +144,13 @@ class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInter } fun getCurrentUser(): Int { - val user = authClient.newCall(GET("$apiUrl/users/whoami")).execute().body()?.string() + val user = authClient.newCall(GET("$apiUrl/users/whoami")).execute().body?.string() return parser.parse(user).obj["id"].asInt } fun accessToken(code: String): Observable { return client.newCall(accessTokenRequest(code)).asObservableSuccess().map { netResponse -> - val responseBody = netResponse.body()?.string().orEmpty() + val responseBody = netResponse.body?.string().orEmpty() if (responseBody.isEmpty()) { throw Exception("Null Response") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriInterceptor.kt index 1540207277..6e10b4de3d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriInterceptor.kt @@ -22,7 +22,7 @@ class ShikimoriInterceptor(val shikimori: Shikimori, val gson: Gson) : Intercept if (currAuth.isExpired()) { val response = chain.proceed(ShikimoriApi.refreshTokenRequest(refreshToken)) if (response.isSuccessful) { - newAuth(gson.fromJson(response.body()!!.string(), OAuth::class.java)) + newAuth(gson.fromJson(response.body!!.string(), OAuth::class.java)) } else { response.close() } 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 594ecd31b9..3bcfe9fcf4 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.data.updater import android.app.PendingIntent import android.content.Intent -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import com.evernote.android.job.Job import com.evernote.android.job.JobManager import com.evernote.android.job.JobRequest 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 509c65bb4b..9879ec5eda 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.data.updater import android.content.Context import android.net.Uri -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationHandler import eu.kanade.tachiyomi.data.notification.NotificationReceiver diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterService.kt index 4bcff3f1f0..5dd8dee2eb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterService.kt @@ -71,7 +71,7 @@ class UpdaterService : IntentService(UpdaterService::class.java.name) { val apkFile = File(externalCacheDir, "update.apk") if (response.isSuccessful) { - response.body()!!.source().saveTo(apkFile) + response.body!!.source().saveTo(apkFile) } else { response.close() throw Exception("Unsuccessful response") diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index f8ef81b89b..d8eb982122 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -32,7 +32,7 @@ internal class ExtensionGithubApi { } private fun parseResponse(response: Response): List { - val text = response.body()?.use { it.string() } ?: return emptyList() + val text = response.body?.use { it.string() } ?: return emptyList() val json = gson.fromJson(text) diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt b/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt index 6d425bfb99..b588dbea26 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt @@ -14,22 +14,12 @@ class AndroidCookieJar(context: Context) : CookieJar { private val syncManager by lazy { CookieSyncManager.createInstance(context) } - init { - // Init sync manager when using anything below L - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - syncManager - } - } - - override fun saveFromResponse(url: HttpUrl, cookies: MutableList) { + override fun saveFromResponse(url: HttpUrl, cookies: List) { val urlString = url.toString() for (cookie in cookies) { manager.setCookie(urlString, cookie.toString()) } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - syncManager.sync() - } } override fun loadForRequest(url: HttpUrl): List { 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 a3f4283a11..a34475d4c5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt @@ -42,7 +42,7 @@ class CloudflareInterceptor(private val context: Context) : Interceptor { val response = chain.proceed(chain.request()) // Check if Cloudflare anti-bot is on - if (response.code() == 503 && response.header("Server") in serverCheck) { + if (response.code == 503 && response.header("Server") in serverCheck) { try { response.close() val solutionRequest = resolveWithWebView(chain.request()) @@ -71,8 +71,8 @@ class CloudflareInterceptor(private val context: Context) : Interceptor { var solutionUrl: String? = null var challengeFound = false - val origRequestUrl = request.url().toString() - val headers = request.headers().toMultimap().mapValues { it.value.getOrNull(0) ?: "" } + val origRequestUrl = request.url.toString() + val headers = request.headers.toMultimap().mapValues { it.value.getOrNull(0) ?: "" } handler.post { val view = WebView(context) @@ -144,7 +144,7 @@ class CloudflareInterceptor(private val context: Context) : Interceptor { return Request.Builder().get() .url(solution) - .headers(request.headers()) + .headers(request.headers) .addHeader("Referer", origRequestUrl) .addHeader("Accept", "text/html,application/xhtml+xml,application/xml") .addHeader("Accept-Language", "en") diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt index 275dca17dc..60893a7e32 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt @@ -103,7 +103,7 @@ class NetworkHelper(context: Context) { val specCompat = ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .tlsVersions(TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0) .cipherSuites( - *ConnectionSpec.MODERN_TLS.cipherSuites().orEmpty().toTypedArray(), + *ConnectionSpec.MODERN_TLS.cipherSuites.orEmpty().toTypedArray(), CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt index d82a75923e..7ea2dfa819 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt @@ -37,7 +37,7 @@ fun Call.asObservable(): Observable { } override fun isUnsubscribed(): Boolean { - return call.isCanceled + return call.isCanceled() } } @@ -50,7 +50,7 @@ fun Call.asObservableSuccess(): Observable { return asObservable().doOnNext { response -> if (!response.isSuccessful) { response.close() - throw Exception("HTTP error ${response.code()}") + throw Exception("HTTP error ${response.code}") } } } @@ -61,7 +61,7 @@ fun OkHttpClient.newCallWithProgress(request: Request, listener: ProgressListene .addNetworkInterceptor { chain -> val originalResponse = chain.proceed(chain.request()) originalResponse.newBuilder() - .body(ProgressResponseBody(originalResponse.body()!!, listener)) + .body(ProgressResponseBody(originalResponse.body!!, listener)) .build() } .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt b/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt index f8123c5199..0d1c418535 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt @@ -8,7 +8,7 @@ import java.io.IOException class ProgressResponseBody(private val responseBody: ResponseBody, private val progressListener: ProgressListener) : ResponseBody() { private val bufferedSource: BufferedSource by lazy { - Okio.buffer(source(responseBody.source())) + source(responseBody.source()).buffer() } override fun contentType(): MediaType { diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt index 6b3f99aceb..a1e75187de 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/ConfigurableSource.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.source -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen interface ConfigurableSource : Source { - fun setupPreferenceScreen(screen: PreferenceScreen) + fun setupPreferenceScreen(screen: PreferenceScreen) } \ No newline at end of file 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 2b9745ea14..f9f867fae2 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 @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.base.activity -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import eu.kanade.tachiyomi.util.LocaleHelper abstract class BaseActivity : AppCompatActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt index acf2ff1e86..292bf2e326 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.base.controller import android.os.Bundle -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.view.LayoutInflater import android.view.MenuItem import android.view.View diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt index 492c5a2804..79a6ce86a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.base.controller import android.content.pm.PackageManager.PERMISSION_GRANTED import android.os.Build -import android.support.v4.content.ContextCompat +import androidx.core.content.ContextCompat import com.bluelinelabs.conductor.Controller import com.bluelinelabs.conductor.Router import com.bluelinelabs.conductor.RouterTransaction diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.java b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.java index db8efbd830..fa4b62846f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/DialogController.java @@ -3,8 +3,8 @@ package eu.kanade.tachiyomi.ui.base.controller; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt index 2b2e1ecc6e..a53effc73f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/RxController.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.base.controller import android.os.Bundle -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import android.view.View import rx.Observable import rx.Subscription diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SecondaryDrawerController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SecondaryDrawerController.kt index ba2ce016a1..a6d4aaa56b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SecondaryDrawerController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SecondaryDrawerController.kt @@ -1,11 +1,11 @@ package eu.kanade.tachiyomi.ui.base.controller -import android.support.v4.widget.DrawerLayout +import androidx.drawerlayout.widget.DrawerLayout import android.view.ViewGroup interface SecondaryDrawerController { - fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup? + fun createSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout): ViewGroup? - fun cleanupSecondaryDrawer(drawer: DrawerLayout) + fun cleanupSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout) } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/TabbedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/TabbedController.kt index 02fba36c31..f70d2e11f1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/TabbedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/TabbedController.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.base.controller -import android.support.design.widget.TabLayout +import com.google.android.material.tabs.TabLayout interface TabbedController { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseFlexibleViewHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseFlexibleViewHolder.kt index 3cc6b9c2af..2720eac37a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseFlexibleViewHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseFlexibleViewHolder.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.ui.base.holder import android.view.View +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.viewholders.FlexibleViewHolder import kotlinx.android.extensions.LayoutContainer diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseViewHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseViewHolder.kt index c809b7eebc..fe7e418c07 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseViewHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/holder/BaseViewHolder.kt @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.ui.base.holder -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View import kotlinx.android.extensions.LayoutContainer -abstract class BaseViewHolder(view: View) : RecyclerView.ViewHolder(view), LayoutContainer { +abstract class BaseViewHolder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view), LayoutContainer { override val containerView: View? get() = itemView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorDelegate.java b/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorDelegate.java index 5210a3a2a8..99642a5016 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorDelegate.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorDelegate.java @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.base.presenter; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import nucleus.factory.PresenterFactory; import nucleus.presenter.Presenter; diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorLifecycleListener.java b/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorLifecycleListener.java index 33272a1b20..36890cd1be 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorLifecycleListener.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/presenter/NucleusConductorLifecycleListener.java @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.base.presenter; import android.os.Bundle; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.View; import com.bluelinelabs.conductor.Controller; diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index dd8c3b1cec..f5fb95bbfe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.catalogue import android.Manifest.permission.WRITE_EXTERNAL_STORAGE -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.SearchView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.appcompat.widget.SearchView import android.view.* import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType @@ -99,7 +99,7 @@ class CatalogueController : NucleusController(), adapter = CatalogueAdapter(this) // Create recycler and set adapter. - recycler.layoutManager = LinearLayoutManager(view.context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) recycler.adapter = adapter recycler.addItemDecoration(SourceDividerItemDecoration(view.context)) recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) @@ -134,7 +134,7 @@ class CatalogueController : NucleusController(), /** * Called when item is clicked */ - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View, position: Int): Boolean { val item = adapter?.getItem(position) as? SourceItem ?: return false val source = item.source if (source is LoginSource && !source.isLogged()) { @@ -152,7 +152,7 @@ class CatalogueController : NucleusController(), * Called when browse is clicked in [CatalogueAdapter] */ override fun onBrowseClick(position: Int) { - onItemClick(position) + onItemClick(view!!, position) } /** 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 66c94967d3..c4b711be79 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 @@ -5,8 +5,10 @@ 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 -class LangHolder(view: View, adapter: FlexibleAdapter<*>) : +class LangHolder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { fun bind(item: LangItem) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt index dfa6a91d2f..c3f15a3f50 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.catalogue import android.view.View +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractHeaderItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R /** @@ -22,16 +24,14 @@ data class LangItem(val code: String) : AbstractHeaderItem() { /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): LangHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): LangHolder { return LangHolder(view, adapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: LangHolder, - position: Int, payloads: List?) { - + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: LangHolder, position: Int, payloads: MutableList) { holder.bind(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt index e21b58124f..b927d4e3e5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt @@ -4,10 +4,10 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Rect import android.graphics.drawable.Drawable -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View -class SourceDividerItemDecoration(context: Context) : RecyclerView.ItemDecoration() { +class SourceDividerItemDecoration(context: Context) : androidx.recyclerview.widget.RecyclerView.ItemDecoration() { private val divider: Drawable @@ -17,14 +17,14 @@ class SourceDividerItemDecoration(context: Context) : RecyclerView.ItemDecoratio a.recycle() } - override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { + override fun onDraw(c: Canvas, parent: androidx.recyclerview.widget.RecyclerView, state: androidx.recyclerview.widget.RecyclerView.State) { val childCount = parent.childCount for (i in 0 until childCount - 1) { val child = parent.getChildAt(i) val holder = parent.getChildViewHolder(child) if (holder is SourceHolder && parent.getChildViewHolder(parent.getChildAt(i + 1)) is SourceHolder) { - val params = child.layoutParams as RecyclerView.LayoutParams + val params = child.layoutParams as androidx.recyclerview.widget.RecyclerView.LayoutParams val top = child.bottom + params.bottomMargin val bottom = top + divider.intrinsicHeight val left = parent.paddingLeft + holder.margin @@ -36,8 +36,8 @@ class SourceDividerItemDecoration(context: Context) : RecyclerView.ItemDecoratio } } - override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, - state: RecyclerView.State) { + override fun getItemOffsets(outRect: Rect, view: View, parent: androidx.recyclerview.widget.RecyclerView, + state: androidx.recyclerview.widget.RecyclerView.State) { outRect.set(0, 0, 0, divider.intrinsicHeight) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt index 57c1fdf8ae..bd4bb03852 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.catalogue import android.view.View +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractSectionableItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.CatalogueSource @@ -25,16 +27,14 @@ data class SourceItem(val source: CatalogueSource, val header: LangItem? = null) /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): SourceHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): SourceHolder { return SourceHolder(view, adapter as CatalogueAdapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: SourceHolder, - position: Int, payloads: List?) { - + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: SourceHolder, position: Int, payloads: MutableList) { holder.bind(this) } 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 3ccd7b044d..fe268a890b 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 @@ -2,10 +2,11 @@ package eu.kanade.tachiyomi.ui.catalogue.browse import android.content.res.Configuration import android.os.Bundle -import android.support.design.widget.Snackbar -import android.support.v4.widget.DrawerLayout -import android.support.v7.widget.* +import com.google.android.material.snackbar.Snackbar +import androidx.drawerlayout.widget.DrawerLayout +import androidx.appcompat.widget.* import android.view.* +import androidx.core.view.GravityCompat import com.afollestad.materialdialogs.MaterialDialog import com.f2prateek.rx.preferences.Preference import com.jakewharton.rxbinding.support.v7.widget.queryTextChangeEvents @@ -76,7 +77,7 @@ open class BrowseCatalogueController(bundle: Bundle) : /** * Recycler view with the list of results. */ - private var recycler: RecyclerView? = null + private var recycler: androidx.recyclerview.widget.RecyclerView? = null /** * Subscription for the search view. @@ -132,19 +133,19 @@ open class BrowseCatalogueController(bundle: Bundle) : super.onDestroyView(view) } - override fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup? { + override fun createSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout): ViewGroup? { // Inflate and prepare drawer val navView = drawer.inflate(R.layout.catalogue_drawer) as CatalogueNavigationView this.navView = navView navView.setFilters(presenter.filterItems) - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.END) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_UNLOCKED, GravityCompat.END) navView.onSearchClicked = { val allDefault = presenter.sourceFilters == presenter.source.getFilterList() showProgressBar() adapter?.clear() - drawer.closeDrawer(Gravity.END) + drawer.closeDrawer(GravityCompat.END) presenter.setSourceFilter(if (allDefault) FilterList() else presenter.sourceFilters) } @@ -174,27 +175,27 @@ open class BrowseCatalogueController(bundle: Bundle) : return navView } - override fun cleanupSecondaryDrawer(drawer: DrawerLayout) { + override fun cleanupSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout) { navView = null } private fun setupRecycler(view: View) { numColumnsSubscription?.unsubscribe() - var oldPosition = RecyclerView.NO_POSITION + var oldPosition = androidx.recyclerview.widget.RecyclerView.NO_POSITION val oldRecycler = catalogue_view?.getChildAt(1) - if (oldRecycler is RecyclerView) { - oldPosition = (oldRecycler.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() + if (oldRecycler is androidx.recyclerview.widget.RecyclerView) { + oldPosition = (oldRecycler.layoutManager as androidx.recyclerview.widget.LinearLayoutManager).findFirstVisibleItemPosition() oldRecycler.adapter = null catalogue_view?.removeView(oldRecycler) } val recycler = if (presenter.isListMode) { - RecyclerView(view.context).apply { + androidx.recyclerview.widget.RecyclerView(view.context).apply { id = R.id.recycler - layoutManager = LinearLayoutManager(context) - addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) + layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context) + addItemDecoration(androidx.recyclerview.widget.DividerItemDecoration(context, androidx.recyclerview.widget.DividerItemDecoration.VERTICAL)) } } else { (catalogue_view.inflate(R.layout.catalogue_recycler_autofit) as AutofitRecyclerView).apply { @@ -204,7 +205,7 @@ open class BrowseCatalogueController(bundle: Bundle) : // Set again the adapter to recalculate the covers height .subscribe { adapter = this@BrowseCatalogueController.adapter } - (layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { + (layoutManager as androidx.recyclerview.widget.GridLayoutManager).spanSizeLookup = object : androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup() { override fun getSpanSize(position: Int): Int { return when (adapter?.getItemViewType(position)) { R.layout.catalogue_grid_item, null -> 1 @@ -219,7 +220,7 @@ open class BrowseCatalogueController(bundle: Bundle) : catalogue_view.addView(recycler, 1) recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) - if (oldPosition != RecyclerView.NO_POSITION) { + if (oldPosition != androidx.recyclerview.widget.RecyclerView.NO_POSITION) { recycler.layoutManager?.scrollToPosition(oldPosition) } this.recycler = recycler @@ -291,7 +292,7 @@ open class BrowseCatalogueController(bundle: Bundle) : override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_display_mode -> swapDisplayMode() - R.id.action_set_filter -> navView?.let { activity?.drawer?.openDrawer(Gravity.END) } + R.id.action_set_filter -> navView?.let { activity?.drawer?.openDrawer(GravityCompat.END) } R.id.action_open_in_browser -> openInBrowser() R.id.action_open_in_web_view -> openInWebView() else -> return super.onOptionsItemSelected(item) @@ -483,7 +484,7 @@ open class BrowseCatalogueController(bundle: Bundle) : * @param position the position of the element clicked. * @return true if the item should be selected, false otherwise. */ - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { val item = adapter?.getItem(position) as? CatalogueItem ?: return false router.pushController(MangaController(item.manga, true).withFadeTransaction()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt index 8daad99477..1d69853b29 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt @@ -7,6 +7,8 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.widget.StateImageViewTarget import kotlinx.android.synthetic.main.catalogue_grid_item.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. @@ -16,7 +18,7 @@ import kotlinx.android.synthetic.main.catalogue_grid_item.* * @param adapter the adapter handling this holder. * @constructor creates a new catalogue holder. */ -class CatalogueGridHolder(private val view: View, private val adapter: FlexibleAdapter<*>) : +class CatalogueGridHolder(private val view: View, private val adapter: FlexibleAdapter>) : CatalogueHolder(view, adapter) { /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt index 9a0ec3916b..2356d1686f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt @@ -4,6 +4,8 @@ import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Generic class used to hold the displayed data of a manga in the catalogue. @@ -11,7 +13,7 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder * @param view the inflated view for this holder. * @param adapter the adapter handling this holder. */ -abstract class CatalogueHolder(view: View, adapter: FlexibleAdapter<*>) : +abstract class CatalogueHolder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt index 71696565be..19c03650ed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt @@ -12,6 +12,8 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_grid_item.view.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference) : AbstractFlexibleItem() { @@ -23,7 +25,7 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference): CatalogueHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueHolder { val parent = adapter.recyclerView return if (parent is AutofitRecyclerView) { view.apply { @@ -38,10 +40,10 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CatalogueHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.onSetValues(manga) } 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 2624215574..08799d6406 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 @@ -7,6 +7,8 @@ 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 /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. @@ -16,7 +18,7 @@ import kotlinx.android.synthetic.main.catalogue_list_item.* * @param adapter the adapter handling this holder. * @constructor creates a new catalogue holder. */ -class CatalogueListHolder(private val view: View, adapter: FlexibleAdapter<*>) : +class CatalogueListHolder(private val view: View, adapter: FlexibleAdapter>) : CatalogueHolder(view, adapter) { private val favoriteColor = view.context.getResourceColor(android.R.attr.textColorHint) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt index 0eeeb51d3a..1f54272a75 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt @@ -3,8 +3,10 @@ package eu.kanade.tachiyomi.ui.catalogue.browse import android.view.View import android.widget.ProgressBar import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R @@ -17,11 +19,11 @@ class ProgressItem : AbstractFlexibleItem() { return R.layout.catalogue_progress_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList) { holder.progressBar.visibility = View.GONE holder.progressMessage.visibility = View.GONE @@ -40,7 +42,7 @@ class ProgressItem : AbstractFlexibleItem() { return this === other } - class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val progressBar: ProgressBar = view.findViewById(R.id.progress_bar) val progressMessage: TextView = view.findViewById(R.id.progress_message) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt index 5ad10faf81..8431ca5859 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt @@ -2,8 +2,10 @@ package eu.kanade.tachiyomi.ui.catalogue.filter import android.view.View import android.widget.CheckBox +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter @@ -14,11 +16,11 @@ open class CheckboxItem(val filter: Filter.CheckBox) : AbstractFlexibleItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList) { val view = holder.check view.text = filter.name view.isChecked = filter.state @@ -38,7 +40,7 @@ open class CheckboxItem(val filter: Filter.CheckBox) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val check: CheckBox = itemView.findViewById(R.id.nav_view_item) } 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 325371d944..c7ea5b5a7f 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 @@ -10,6 +10,8 @@ import eu.davidea.viewholders.ExpandableViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.util.setVectorCompat +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem>() { @@ -25,11 +27,11 @@ class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { holder.title.text = filter.name holder.icon.setVectorCompat(if (isExpanded) @@ -52,7 +54,7 @@ class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem) : ExpandableViewHolder(view, adapter, true) { + open class Holder(view: View, adapter: FlexibleAdapter>) : ExpandableViewHolder(view, adapter, true) { val title: TextView = itemView.findViewById(R.id.title) val icon: ImageView = itemView.findViewById(R.id.expand_icon) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt index fc929af2e4..a3826c0156 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt @@ -1,13 +1,15 @@ package eu.kanade.tachiyomi.ui.catalogue.filter import android.annotation.SuppressLint -import android.support.design.R +import com.google.android.material.R import android.view.View import android.widget.TextView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.source.model.Filter +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class HeaderItem(val filter: Filter.Header) : AbstractHeaderItem() { @@ -16,11 +18,11 @@ class HeaderItem(val filter: Filter.Header) : AbstractHeaderItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { val view = holder.itemView as TextView view.text = filter.name } @@ -35,5 +37,5 @@ class HeaderItem(val filter: Filter.Header) : AbstractHeaderItem) : FlexibleViewHolder(view, adapter) + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt index 6a3e9005ec..5e0a4f3263 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt @@ -10,6 +10,8 @@ import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem() { @@ -17,11 +19,11 @@ open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { holder.text.text = filter.name + ": " val spinner = holder.spinner @@ -46,7 +48,7 @@ open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val text: TextView = itemView.findViewById(R.id.nav_view_item_text) val spinner: Spinner = itemView.findViewById(R.id.nav_view_item) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt index 61fa80c8b8..fb25fa0c2b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt @@ -1,10 +1,12 @@ package eu.kanade.tachiyomi.ui.catalogue.filter import android.annotation.SuppressLint -import android.support.design.R +import com.google.android.material.R import android.view.View +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractHeaderItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.source.model.Filter @@ -15,11 +17,12 @@ class SeparatorItem(val filter: Filter.Separator) : AbstractHeaderItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, + holder: Holder, position: Int, payloads: MutableList?) { } @@ -33,5 +36,5 @@ class SeparatorItem(val filter: Filter.Separator) : AbstractHeaderItem) : FlexibleViewHolder(view, adapter) + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) } \ No newline at end of file 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 b91205c26a..6b12985bfb 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.catalogue.filter import android.view.View +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractExpandableHeaderItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.ISectionable import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter @@ -22,11 +24,11 @@ class SortGroup(val filter: Filter.Sort) : AbstractExpandableHeaderItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { holder.title.text = filter.name holder.icon.setVectorCompat(if (isExpanded) @@ -48,5 +50,5 @@ class SortGroup(val filter: Filter.Sort) : AbstractExpandableHeaderItem) : GroupItem.Holder(view, adapter) + class Holder(view: View, adapter: FlexibleAdapter>) : GroupItem.Holder(view, adapter) } \ No newline at end of file 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 87d0a501bf..763b1f7195 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 @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.catalogue.filter -import android.support.graphics.drawable.VectorDrawableCompat -import android.support.v4.content.ContextCompat +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat +import androidx.core.content.ContextCompat import android.view.View import android.widget.CheckedTextView import eu.davidea.flexibleadapter.FlexibleAdapter @@ -10,6 +10,8 @@ import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.util.getResourceColor +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class SortItem(val name: String, val group: SortGroup) : AbstractSectionableItem(group) { @@ -21,11 +23,11 @@ class SortItem(val name: String, val group: SortGroup) : AbstractSectionableItem return 102 } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { val view = holder.text view.text = name val filter = group.filter @@ -66,7 +68,7 @@ class SortItem(val name: String, val group: SortGroup) : AbstractSectionableItem return result } - class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val text: CheckedTextView = itemView.findViewById(R.id.nav_view_item) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt index 18c57b6404..1c368ca52c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.catalogue.filter -import android.support.design.widget.TextInputLayout +import com.google.android.material.textfield.TextInputLayout import android.view.View import android.widget.EditText import eu.davidea.flexibleadapter.FlexibleAdapter @@ -9,6 +9,8 @@ import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.widget.SimpleTextWatcher +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible open class TextItem(val filter: Filter.Text) : AbstractFlexibleItem() { @@ -16,11 +18,11 @@ open class TextItem(val filter: Filter.Text) : AbstractFlexibleItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { holder.wrapper.hint = filter.name holder.edit.setText(filter.state) holder.edit.addTextChangedListener(object : SimpleTextWatcher() { @@ -40,7 +42,7 @@ open class TextItem(val filter: Filter.Text) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val wrapper: TextInputLayout = itemView.findViewById(R.id.nav_view_item_wrapper) val edit: EditText = itemView.findViewById(R.id.nav_view_item) 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 d122251c99..28ea006dc6 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 @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.catalogue.filter -import android.support.design.R -import android.support.graphics.drawable.VectorDrawableCompat +import com.google.android.material.R +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import android.view.View import android.widget.CheckedTextView import eu.davidea.flexibleadapter.FlexibleAdapter @@ -11,6 +11,8 @@ import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.util.dpToPx import eu.kanade.tachiyomi.util.getResourceColor import eu.kanade.tachiyomi.R as TR +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem() { @@ -22,11 +24,11 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { val view = holder.text view.text = filter.name @@ -61,7 +63,7 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem) : FlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter) { val text: CheckedTextView = itemView.findViewById(TR.id.nav_view_item) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt index 430b6f5b67..ec419c7641 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.catalogue.global_search import android.os.Bundle import android.os.Parcelable -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.util.SparseArray import eu.davidea.flexibleadapter.FlexibleAdapter @@ -19,12 +19,12 @@ class CatalogueSearchAdapter(val controller: CatalogueSearchController) : */ private var bundle = Bundle() - override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + override fun onBindViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) { super.onBindViewHolder(holder, position) restoreHolderState(holder) } - override fun onViewRecycled(holder: RecyclerView.ViewHolder) { + override fun onViewRecycled(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder) { super.onViewRecycled(holder) saveHolderState(holder, bundle) } @@ -47,7 +47,7 @@ class CatalogueSearchAdapter(val controller: CatalogueSearchController) : * @param holder The holder to save. * @param outState The bundle where the state is saved. */ - private fun saveHolderState(holder: RecyclerView.ViewHolder, outState: Bundle) { + private fun saveHolderState(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, outState: Bundle) { val key = "holder_${holder.adapterPosition}" val holderState = SparseArray() holder.itemView.saveHierarchyState(holderState) @@ -59,7 +59,7 @@ class CatalogueSearchAdapter(val controller: CatalogueSearchController) : * * @param holder The holder to restore. */ - private fun restoreHolderState(holder: RecyclerView.ViewHolder) { + private fun restoreHolderState(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder) { val key = "holder_${holder.adapterPosition}" val holderState = bundle.getSparseParcelableArray(key) if (holderState != null) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt index 3d43b12e96..9da45250b7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt @@ -5,6 +5,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem() { @@ -12,12 +14,12 @@ class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem): CatalogueSearchCardHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueSearchCardHolder { return CatalogueSearchCardHolder(view, adapter as CatalogueSearchCardAdapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: CatalogueSearchCardHolder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CatalogueSearchCardHolder, + position: Int, payloads: MutableList?) { holder.bind(manga) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt index da76c4867c..1a28e41c30 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.catalogue.global_search import android.os.Bundle -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.SearchView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.appcompat.widget.SearchView import android.view.* import com.jakewharton.rxbinding.support.v7.widget.queryTextChangeEvents import eu.kanade.tachiyomi.R @@ -132,7 +132,7 @@ open class CatalogueSearchController( adapter = CatalogueSearchAdapter(this) // Create recycler and set adapter. - recycler.layoutManager = LinearLayoutManager(view.context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) recycler.adapter = adapter recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) } 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 eefb379604..6f29d45762 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 @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.catalogue.global_search -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.View import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga @@ -29,7 +29,8 @@ class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : init { // Set layout horizontal. - recycler.layoutManager = LinearLayoutManager(view.context, LinearLayoutManager.HORIZONTAL, false) + recycler.layoutManager = + androidx.recyclerview.widget.LinearLayoutManager(view.context, androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL, false) recycler.adapter = mangaAdapter } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt index 9fe950082c..0a69cbd13a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt @@ -5,6 +5,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.CatalogueSource +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Item that contains search result information. @@ -30,15 +32,15 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List): CatalogueSearchHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueSearchHolder { return CatalogueSearchHolder(view, adapter as CatalogueSearchAdapter) } /** * Bind item to view. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: CatalogueSearchHolder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CatalogueSearchHolder, + position: Int, payloads: MutableList?) { holder.bind(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt index 221a2142e4..41c133a820 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.catalogue.latest import android.os.Bundle -import android.support.v4.widget.DrawerLayout +import androidx.drawerlayout.widget.DrawerLayout import android.view.Menu import android.view.ViewGroup import eu.kanade.tachiyomi.R @@ -28,11 +28,11 @@ class LatestUpdatesController(bundle: Bundle) : BrowseCatalogueController(bundle menu.findItem(R.id.action_set_filter).isVisible = false } - override fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup? { + override fun createSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout): ViewGroup? { return null } - override fun cleanupSecondaryDrawer(drawer: DrawerLayout) { + override fun cleanupSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout) { } 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 1eaff7f067..8e6a77216f 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 @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.ui.category -import android.support.design.widget.Snackbar -import android.support.v7.app.AppCompatActivity -import android.support.v7.view.ActionMode -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import com.google.android.material.snackbar.Snackbar +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.view.ActionMode +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import android.view.* import com.jakewharton.rxbinding.view.clicks import eu.davidea.flexibleadapter.FlexibleAdapter @@ -78,7 +78,7 @@ class CategoryController : NucleusController(), super.onViewCreated(view) adapter = CategoryAdapter(this@CategoryController) - recycler.layoutManager = LinearLayoutManager(view.context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) recycler.setHasFixedSize(true) recycler.adapter = adapter adapter?.isHandleDragEnabled = true @@ -217,9 +217,9 @@ class CategoryController : NucleusController(), * @param position The position of the clicked item. * @return true if this click should enable selection mode. */ - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { // Check if action mode is initialized and selected item exist. - if (actionMode != null && position != RecyclerView.NO_POSITION) { + if (actionMode != null && position != androidx.recyclerview.widget.RecyclerView.NO_POSITION) { toggleSelection(position) return true } else { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryItem.kt index 7f24ab5289..4eb6f8f794 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryItem.kt @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.category import android.view.View +import androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category @@ -29,7 +31,7 @@ class CategoryItem(val category: Category) : AbstractFlexibleItem): CategoryHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CategoryHolder { return CategoryHolder(view, adapter as CategoryAdapter) } @@ -41,11 +43,7 @@ class CategoryItem(val category: Category) : AbstractFlexibleItem, - holder: CategoryHolder, - position: Int, - payloads: List?) { - + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CategoryHolder, position: Int, payloads: MutableList) { holder.bind(category) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt index 795b85f131..6cf6c1bebc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadAdapter.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.download -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.ViewGroup import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.model.Download @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.util.inflate * * @param context the context of the fragment containing this adapter. */ -class DownloadAdapter : RecyclerView.Adapter() { +class DownloadAdapter : androidx.recyclerview.widget.RecyclerView.Adapter() { private var items = emptyList() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt index 9793b81830..2430892b7f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.download -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.* import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.DownloadService @@ -63,7 +63,7 @@ class DownloadController : NucleusController() { recycler.adapter = adapter // Set the layout manager for the recycler and fixed size. - recycler.layoutManager = LinearLayoutManager(view.context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) recycler.setHasFixedSize(true) recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt index 425875114c..26e539e71b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.extension -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.SearchView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.appcompat.widget.SearchView import android.view.LayoutInflater import android.view.Menu import android.view.MenuInflater @@ -64,7 +64,7 @@ open class ExtensionController : NucleusController(), // Initialize adapter, scroll listener and recycler views adapter = ExtensionAdapter(this) // Create recycler and set adapter. - ext_recycler.layoutManager = LinearLayoutManager(view.context) + ext_recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) ext_recycler.adapter = adapter ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context)) ext_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) @@ -118,7 +118,7 @@ open class ExtensionController : NucleusController(), searchItem.fixExpand() } - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return false if (extension is Extension.Installed) { openDetails(extension) 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 eabd4e926a..6d606fdab4 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 @@ -3,11 +3,11 @@ package eu.kanade.tachiyomi.ui.extension import android.annotation.SuppressLint import android.content.Context import android.os.Bundle -import android.support.v7.preference.* -import android.support.v7.preference.internal.AbstractMultiSelectListPreference -import android.support.v7.widget.DividerItemDecoration -import android.support.v7.widget.DividerItemDecoration.VERTICAL -import android.support.v7.widget.LinearLayoutManager +import androidx.preference.* +import androidx.preference.MultiSelectListPreference +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.DividerItemDecoration.VERTICAL +import androidx.recyclerview.widget.LinearLayoutManager import android.util.TypedValue import android.view.ContextThemeWrapper import android.view.LayoutInflater @@ -21,6 +21,7 @@ import eu.kanade.tachiyomi.source.ConfigurableSource 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.preference import eu.kanade.tachiyomi.ui.setting.preferenceCategory import eu.kanade.tachiyomi.util.LocaleHelper import eu.kanade.tachiyomi.util.RecyclerWindowInsetsListener @@ -80,17 +81,18 @@ class ExtensionDetailsController(bundle: Bundle? = null) : val multiSource = extension.sources.size > 1 - for (source in extension.sources) { + /*for (source in extension.sources) { if (source is ConfigurableSource) { addPreferencesForSource(screen, source, multiSource) } - } + }*/ manager.setPreferences(screen) - extension_prefs_recycler.layoutManager = LinearLayoutManager(context) + extension_prefs_recycler.layoutManager = + androidx.recyclerview.widget.LinearLayoutManager(context) extension_prefs_recycler.adapter = PreferenceGroupAdapter(screen) - extension_prefs_recycler.addItemDecoration(DividerItemDecoration(context, VERTICAL)) + extension_prefs_recycler.addItemDecoration(androidx.recyclerview.widget.DividerItemDecoration(context, VERTICAL)) extension_prefs_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) if (screen.preferenceCount == 0) { @@ -167,7 +169,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) : .newInstance(preference.getKey()) is ListPreference -> ListPreferenceDialogController .newInstance(preference.getKey()) - is AbstractMultiSelectListPreference -> MultiSelectListPreferenceDialogController + is MultiSelectListPreference -> MultiSelectListPreferenceDialogController .newInstance(preference.getKey()) else -> throw IllegalArgumentException("Tried to display dialog for unknown " + "preference type. Did you forget to override onDisplayPreferenceDialog()?") @@ -176,8 +178,8 @@ class ExtensionDetailsController(bundle: Bundle? = null) : f.showDialog(router) } - override fun findPreference(key: CharSequence?): Preference { - return preferenceScreen!!.getPreference(lastOpenPreferencePosition!!) + override fun findPreference(key: CharSequence): T? { + return preferenceScreen!!.findPreference(key) } override fun loginDialogClosed(source: LoginSource) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt index 247206df7c..5b5946939d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionDividerItemDecoration.kt @@ -4,10 +4,10 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Rect import android.graphics.drawable.Drawable -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.View -class ExtensionDividerItemDecoration(context: Context) : RecyclerView.ItemDecoration() { +class ExtensionDividerItemDecoration(context: Context) : androidx.recyclerview.widget.RecyclerView.ItemDecoration() { private val divider: Drawable @@ -17,14 +17,14 @@ class ExtensionDividerItemDecoration(context: Context) : RecyclerView.ItemDecora a.recycle() } - override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { + override fun onDraw(c: Canvas, parent: androidx.recyclerview.widget.RecyclerView, state: androidx.recyclerview.widget.RecyclerView.State) { val childCount = parent.childCount for (i in 0 until childCount - 1) { val child = parent.getChildAt(i) val holder = parent.getChildViewHolder(child) if (holder is ExtensionHolder && parent.getChildViewHolder(parent.getChildAt(i + 1)) is ExtensionHolder) { - val params = child.layoutParams as RecyclerView.LayoutParams + val params = child.layoutParams as androidx.recyclerview.widget.RecyclerView.LayoutParams val top = child.bottom + params.bottomMargin val bottom = top + divider.intrinsicHeight val left = parent.paddingLeft + holder.margin @@ -36,8 +36,8 @@ class ExtensionDividerItemDecoration(context: Context) : RecyclerView.ItemDecora } } - override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, - state: RecyclerView.State) { + override fun getItemOffsets(outRect: Rect, view: View, parent: androidx.recyclerview.widget.RecyclerView, + state: androidx.recyclerview.widget.RecyclerView.State) { outRect.set(0, 0, 0, divider.intrinsicHeight) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt index 85c2a597ce..01a53c647d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupHolder.kt @@ -5,8 +5,10 @@ import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import kotlinx.android.synthetic.main.extension_card_header.title +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible -class ExtensionGroupHolder(view: View, adapter: FlexibleAdapter<*>) : +class ExtensionGroupHolder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { @SuppressLint("SetTextI18n") diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt index c7f5656457..6babafc24a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionGroupItem.kt @@ -4,6 +4,8 @@ import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.kanade.tachiyomi.R +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Item that contains the group header. @@ -23,15 +25,15 @@ data class ExtensionGroupItem(val name: String, val size: Int) : AbstractHeaderI /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): ExtensionGroupHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): ExtensionGroupHolder { return ExtensionGroupHolder(view, adapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: ExtensionGroupHolder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: ExtensionGroupHolder, + position: Int, payloads: MutableList?) { holder.bind(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt index 2ed363e971..61c219becd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionItem.kt @@ -7,6 +7,8 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.source.CatalogueSource +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Item that contains source information. @@ -29,15 +31,15 @@ data class ExtensionItem(val extension: Extension, /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): ExtensionHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): ExtensionHolder { return ExtensionHolder(view, adapter as ExtensionAdapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: ExtensionHolder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: ExtensionHolder, + position: Int, payloads: MutableList?) { if (payloads == null || payloads.isEmpty()) { holder.bind(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt index b14996f111..12857908a9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt @@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.ui.library import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.database.models.Manga +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Adapter storing a list of manga in a certain category. @@ -38,7 +40,11 @@ class LibraryCategoryAdapter(view: LibraryCategoryView) : } fun performFilter() { - updateDataSet(mangas.filter { it.filter(searchText) }) + var s = getFilter(String::class.java) + if (s == null) { + s = "" + } + updateDataSet(mangas.filter { it.filter(s) }) } } 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 f58f11e379..d451da811f 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 @@ -1,9 +1,10 @@ package eu.kanade.tachiyomi.ui.library import android.content.Context -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet +import android.view.View import android.widget.FrameLayout import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.SelectableAdapter @@ -46,7 +47,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att /** * Recycler view of the list of manga. */ - private lateinit var recycler: RecyclerView + private lateinit var recycler: androidx.recyclerview.widget.RecyclerView /** * Adapter to hold the manga in this category. @@ -62,8 +63,8 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att this.controller = controller recycler = if (preferences.libraryAsList().getOrDefault()) { - (swipe_refresh.inflate(R.layout.library_list_recycler) as RecyclerView).apply { - layoutManager = LinearLayoutManager(context) + (swipe_refresh.inflate(R.layout.library_list_recycler) as androidx.recyclerview.widget.RecyclerView).apply { + layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context) } } else { (swipe_refresh.inflate(R.layout.library_grid_recycler) as AutofitRecyclerView).apply { @@ -77,10 +78,10 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att recycler.adapter = adapter swipe_refresh.addView(recycler) - recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { - override fun onScrollStateChanged(recycler: RecyclerView, newState: Int) { + recycler.addOnScrollListener(object : androidx.recyclerview.widget.RecyclerView.OnScrollListener() { + override fun onScrollStateChanged(recycler: androidx.recyclerview.widget.RecyclerView, newState: Int) { // Disable swipe refresh when view is not at the top - val firstPos = (recycler.layoutManager as LinearLayoutManager) + val firstPos = (recycler.layoutManager as androidx.recyclerview.widget.LinearLayoutManager) .findFirstCompletelyVisibleItemPosition() swipe_refresh.isEnabled = firstPos <= 0 } @@ -111,7 +112,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att } subscriptions += controller.searchRelay - .doOnNext { adapter.searchText = it } + .doOnNext { adapter.setFilter(it) } .skip(1) .subscribe { adapter.performFilter() } @@ -202,7 +203,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att * @param position the position of the element clicked. * @return true if the item should be selected, false otherwise. */ - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { // If the action mode is created and the position is valid, toggle the selection. val item = adapter.getItem(position) ?: return false if (adapter.mode == SelectableAdapter.Mode.MULTI) { 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 9d8624b523..29a43b90ac 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 @@ -6,12 +6,12 @@ import android.content.res.Configuration import android.graphics.Color import android.net.Uri import android.os.Bundle -import android.support.design.widget.TabLayout -import android.support.v4.graphics.drawable.DrawableCompat -import android.support.v4.widget.DrawerLayout -import android.support.v7.app.AppCompatActivity -import android.support.v7.view.ActionMode -import android.support.v7.widget.SearchView +import com.google.android.material.tabs.TabLayout +import androidx.core.graphics.drawable.DrawableCompat +import androidx.drawerlayout.widget.DrawerLayout +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.view.ActionMode +import androidx.appcompat.widget.SearchView import android.view.* import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType @@ -111,7 +111,7 @@ class LibraryController( /** * Drawer listener to allow swipe only for closing the drawer. */ - private var drawerListener: DrawerLayout.DrawerListener? = null + private var drawerListener: androidx.drawerlayout.widget.DrawerLayout.DrawerListener? = null private var tabsVisibilityRelay: BehaviorRelay = BehaviorRelay.create(false) @@ -174,10 +174,10 @@ class LibraryController( super.onDestroyView(view) } - override fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup { + override fun createSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout): ViewGroup { val view = drawer.inflate(R.layout.library_drawer) as LibraryNavigationView navView = view - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.END) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.END) navView?.onGroupClicked = { group -> when (group) { @@ -203,7 +203,7 @@ class LibraryController( return view } - override fun cleanupSecondaryDrawer(drawer: DrawerLayout) { + override fun cleanupSecondaryDrawer(drawer: androidx.drawerlayout.widget.DrawerLayout) { navView = null } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt index 2bc68cf3d9..83211cccde 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt @@ -6,6 +6,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.LocalSource import kotlinx.android.synthetic.main.catalogue_grid_item.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Class used to hold the displayed data of a manga in the library, like the cover or the title. @@ -18,7 +20,7 @@ import kotlinx.android.synthetic.main.catalogue_grid_item.* */ class LibraryGridHolder( private val view: View, - private val adapter: FlexibleAdapter<*> + private val adapter: FlexibleAdapter> ) : LibraryHolder(view, adapter) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt index 41d7f98796..db89816755 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryHolder.kt @@ -3,6 +3,8 @@ package eu.kanade.tachiyomi.ui.library import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Generic class used to hold the displayed data of a manga in the library. @@ -13,7 +15,7 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder abstract class LibraryHolder( view: View, - adapter: FlexibleAdapter<*> + adapter: FlexibleAdapter> ) : BaseFlexibleViewHolder(view, adapter) { /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index ca161827ca..090aa26636 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -13,9 +13,11 @@ import eu.kanade.tachiyomi.data.database.models.LibraryManga import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_grid_item.view.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference) : - AbstractFlexibleItem(), IFilterable { + AbstractFlexibleItem(), IFilterable { var downloadCount = -1 @@ -26,7 +28,7 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference R.layout.catalogue_grid_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): LibraryHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): LibraryHolder { val parent = adapter.recyclerView return if (parent is AutofitRecyclerView) { view.apply { @@ -41,10 +43,10 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference } } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: LibraryHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.onSetValues(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt index 83cc69e25c..c5fd8fc898 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt @@ -6,6 +6,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.LocalSource import kotlinx.android.synthetic.main.catalogue_list_item.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Class used to hold the displayed data of a manga in the library, like the cover or the title. @@ -19,7 +21,7 @@ import kotlinx.android.synthetic.main.catalogue_list_item.* class LibraryListHolder( private val view: View, - private val adapter: FlexibleAdapter<*> + private val adapter: FlexibleAdapter> ) : LibraryHolder(view, adapter) { /** 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 a3709c8cfc..25b1eab35f 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 @@ -7,16 +7,16 @@ import android.content.res.Configuration import android.graphics.Color import android.os.Build import android.os.Bundle -import android.support.annotation.NonNull -import android.support.annotation.Px -import android.support.annotation.RequiresApi -import android.support.v4.view.GravityCompat -import android.support.v4.view.ViewCompat -import android.support.v4.view.WindowInsetsCompat -import android.support.v4.widget.DrawerLayout -import android.support.v7.app.AppCompatDelegate -import android.support.v7.app.AppCompatDelegate.* -import android.support.v7.graphics.drawable.DrawerArrowDrawable +import androidx.annotation.NonNull +import androidx.annotation.Px +import androidx.annotation.RequiresApi +import androidx.core.view.GravityCompat +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat +import androidx.drawerlayout.widget.DrawerLayout +import androidx.appcompat.app.AppCompatDelegate +import androidx.appcompat.app.AppCompatDelegate.* +import androidx.appcompat.graphics.drawable.DrawerArrowDrawable import android.view.View import android.view.ViewGroup import android.view.WindowInsets @@ -265,9 +265,9 @@ class MainActivity : BaseActivity() { val showHamburger = router.backstackSize == 1 if (showHamburger) { - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_UNLOCKED) } else { - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED) } ObjectAnimator.ofFloat(drawerArrow, "progress", if (showHamburger) 0f else 1f).start() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/TabsAnimator.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/TabsAnimator.kt index 304d32f2d4..c975c9516f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/TabsAnimator.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/TabsAnimator.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.main import android.animation.ObjectAnimator -import android.support.design.widget.TabLayout +import com.google.android.material.tabs.TabLayout import android.view.ViewTreeObserver import android.view.animation.DecelerateInterpolator 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 a57a2319b5..71e742e4e9 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 @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.manga import android.Manifest.permission.WRITE_EXTERNAL_STORAGE import android.os.Bundle -import android.support.design.widget.TabLayout -import android.support.graphics.drawable.VectorDrawableCompat +import com.google.android.material.tabs.TabLayout +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterItem.kt index d8639cfb8a..c85c359ae3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChapterItem.kt @@ -7,6 +7,8 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class ChapterItem(val chapter: Chapter, val manga: Manga) : AbstractFlexibleItem(), Chapter by chapter { @@ -26,14 +28,14 @@ class ChapterItem(val chapter: Chapter, val manga: Manga) : AbstractFlexibleItem return R.layout.chapters_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): ChapterHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): ChapterHolder { return ChapterHolder(view, adapter as ChaptersAdapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: ChapterHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.bind(this, manga) } 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 caf00088c0..0ed33b903a 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 @@ -5,11 +5,11 @@ import android.animation.AnimatorListenerAdapter import android.annotation.SuppressLint import android.app.Activity import android.content.Intent -import android.support.design.widget.Snackbar -import android.support.v7.app.AppCompatActivity -import android.support.v7.view.ActionMode -import android.support.v7.widget.DividerItemDecoration -import android.support.v7.widget.LinearLayoutManager +import com.google.android.material.snackbar.Snackbar +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.view.clicks @@ -75,8 +75,8 @@ class ChaptersController : NucleusController(), adapter = ChaptersAdapter(this, view.context) recycler.adapter = adapter - recycler.layoutManager = LinearLayoutManager(view.context) - recycler.addItemDecoration(DividerItemDecoration(view.context, DividerItemDecoration.VERTICAL)) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) + recycler.addItemDecoration(androidx.recyclerview.widget.DividerItemDecoration(view.context, androidx.recyclerview.widget.DividerItemDecoration.VERTICAL)) recycler.setHasFixedSize(true) adapter?.fastScroller = fast_scroller @@ -250,7 +250,7 @@ class ChaptersController : NucleusController(), startActivity(intent) } - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { val adapter = adapter ?: return false val item = adapter.getItem(position) ?: return false if (actionMode != null && adapter.mode == SelectableAdapter.Mode.MULTI) { 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 1f5be44e5d..76948bc69e 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 @@ -11,10 +11,10 @@ import android.graphics.Bitmap import android.graphics.drawable.Drawable import android.os.Build import android.os.Bundle -import android.support.design.widget.Snackbar -import android.support.v4.content.pm.ShortcutInfoCompat -import android.support.v4.content.pm.ShortcutManagerCompat -import android.support.v4.graphics.drawable.IconCompat +import com.google.android.material.snackbar.Snackbar +import androidx.core.content.pm.ShortcutInfoCompat +import androidx.core.content.pm.ShortcutManagerCompat +import androidx.core.graphics.drawable.IconCompat import android.view.* import android.widget.Toast import com.afollestad.materialdialogs.MaterialDialog @@ -306,14 +306,14 @@ class MangaInfoController : NucleusController(), val context = view?.context ?: return val source = presenter.source as? HttpSource ?: return - context.openInBrowser(source.mangaDetailsRequest(presenter.manga).url().toString()) + context.openInBrowser(source.mangaDetailsRequest(presenter.manga).url.toString()) } private fun openInWebView() { val source = presenter.source as? HttpSource ?: return val url = try { - source.mangaDetailsRequest(presenter.manga).url().toString() + source.mangaDetailsRequest(presenter.manga).url.toString() } catch (e: Exception) { return } @@ -330,7 +330,7 @@ class MangaInfoController : NucleusController(), val source = presenter.source as? HttpSource ?: return try { - val url = source.mangaDetailsRequest(presenter.manga).url().toString() + val url = source.mangaDetailsRequest(presenter.manga).url.toString() val intent = Intent(Intent.ACTION_SEND).apply { type = "text/plain" putExtra(Intent.EXTRA_TEXT, url) 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 bb8871097b..d8be0c8741 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 @@ -1,11 +1,11 @@ package eu.kanade.tachiyomi.ui.manga.track -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.ViewGroup import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.inflate -class TrackAdapter(controller: TrackController) : RecyclerView.Adapter() { +class TrackAdapter(controller: TrackController) : androidx.recyclerview.widget.RecyclerView.Adapter() { var items = emptyList() set(value) { 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 cff67f9c17..615d6efe59 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,7 @@ package eu.kanade.tachiyomi.ui.manga.track import android.content.Intent import android.net.Uri -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -43,7 +43,7 @@ class TrackController : NucleusController(), adapter = TrackAdapter(this) with(view) { - track_recycler.layoutManager = LinearLayoutManager(context) + track_recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context) track_recycler.adapter = adapter track_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) swipe_refresh.isEnabled = false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt index c0fd058cd2..353aeeba16 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt @@ -6,10 +6,12 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import kotlinx.android.synthetic.main.catalogue_list_item.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class MangaHolder( private val view: View, - private val adapter: FlexibleAdapter<*> + private val adapter: FlexibleAdapter> ) : BaseFlexibleViewHolder(view, adapter) { fun bind(item: MangaItem) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt index b8f3602c14..6e06b30246 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt @@ -5,6 +5,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class MangaItem(val manga: Manga) : AbstractFlexibleItem() { @@ -12,14 +14,14 @@ class MangaItem(val manga: Manga) : AbstractFlexibleItem() { return R.layout.catalogue_list_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): MangaHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): MangaHolder { return MangaHolder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: MangaHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.bind(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt index f670001bdf..c1c3496aa1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.migration import android.app.Dialog import android.os.Bundle -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -42,7 +42,8 @@ class MigrationController : NucleusController(), super.onViewCreated(view) adapter = FlexibleAdapter(null, this) - migration_recycler.layoutManager = LinearLayoutManager(view.context) + migration_recycler.layoutManager = + androidx.recyclerview.widget.LinearLayoutManager(view.context) migration_recycler.adapter = adapter migration_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) } @@ -93,7 +94,7 @@ class MigrationController : NucleusController(), } } - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { val item = adapter?.getItem(position) ?: return false if (item is MangaItem) { @@ -108,7 +109,7 @@ class MigrationController : NucleusController(), } override fun onSelectClick(position: Int) { - onItemClick(position) + onItemClick(view, position) } fun migrateManga(prevManga: Manga, manga: Manga) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt index cb87fcb9ea..65f3381c8f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt @@ -6,6 +6,8 @@ import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import kotlinx.android.synthetic.main.catalogue_main_controller_card.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Item that contains the selection header. @@ -22,19 +24,19 @@ class SelectionHeader : AbstractHeaderItem() { /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return SelectionHeader.Holder(view, adapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, + position: Int, payloads: MutableList?) { // Intentionally empty } - class Holder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) { + class Holder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { init { title.text = "Please select a source to migrate from" } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt index e64aa0a8b4..f620ef8142 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt @@ -5,6 +5,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractSectionableItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.Source +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible /** * Item that contains source information. @@ -25,15 +27,15 @@ data class SourceItem(val source: Source, val header: SelectionHeader? = null) : /** * Creates a new view holder for this item. */ - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): SourceHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): SourceHolder { return SourceHolder(view, adapter as SourceAdapter) } /** * Binds this item to the given view holder. */ - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: SourceHolder, - position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: SourceHolder, + position: Int, payloads: MutableList?) { holder.bind(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt index 600ed691de..c467ce0db0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/PageIndicatorTextView.kt @@ -5,7 +5,7 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint -import android.support.v7.widget.AppCompatTextView +import androidx.appcompat.widget.AppCompatTextView import android.text.Spannable import android.text.SpannableString import android.text.style.ScaleXSpan 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 51f21d1b27..84265bcd98 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 @@ -10,7 +10,7 @@ import android.graphics.Bitmap import android.graphics.Color import android.os.Build import android.os.Bundle -import android.support.design.widget.BottomSheetDialog +import com.google.android.material.bottomsheet.BottomSheetDialog import android.view.* import android.view.animation.Animation import android.view.animation.AnimationUtils 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 a0579cdccf..cffba4f8bc 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 @@ -1,9 +1,9 @@ package eu.kanade.tachiyomi.ui.reader import android.graphics.Color -import android.support.annotation.ColorInt -import android.support.design.widget.BottomSheetBehavior -import android.support.design.widget.BottomSheetDialog +import androidx.annotation.ColorInt +import com.google.android.material.bottomsheet.BottomSheetBehavior +import com.google.android.material.bottomsheet.BottomSheetDialog import android.view.View import android.view.ViewGroup import android.widget.SeekBar diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt index be465e8738..1d70ed08a7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPageSheet.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.reader import android.os.Bundle -import android.support.design.widget.BottomSheetDialog +import com.google.android.material.bottomsheet.BottomSheetDialog import android.view.ViewGroup import com.afollestad.materialdialogs.MaterialDialog import eu.kanade.tachiyomi.R diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt index 8a750c2ded..48aeb56d32 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt @@ -4,7 +4,7 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Rect import android.os.Build -import android.support.v7.widget.AppCompatSeekBar +import androidx.appcompat.widget.AppCompatSeekBar import android.util.AttributeSet import android.view.MotionEvent @@ -54,6 +54,5 @@ class ReaderSeekBar @JvmOverloads constructor( systemGestureExclusionRects = exclusions } } - } } 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 58810a3f0a..09ab52f234 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 @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.reader import android.os.Bundle -import android.support.design.widget.BottomSheetDialog -import android.support.v4.widget.NestedScrollView +import com.google.android.material.bottomsheet.BottomSheetDialog +import androidx.core.widget.NestedScrollView import android.widget.CompoundButton import android.widget.Spinner import com.f2prateek.rx.preferences.Preference 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 87ed7ab16d..d69ced1e2b 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader import android.content.Context import android.graphics.Bitmap -import android.support.v4.app.NotificationCompat +import androidx.core.app.NotificationCompat import com.bumptech.glide.load.engine.DiskCacheStrategy import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.glide.GlideApp diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/PageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/PageLoader.kt index 38cac38173..b0b872b6d7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/PageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/PageLoader.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.reader.loader -import android.support.annotation.CallSuper +import androidx.annotation.CallSuper import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import rx.Observable diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/Pager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/Pager.kt index 0a0114dcc5..a256a5c6e0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/Pager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/Pager.kt @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.content.Context -import android.support.v4.view.DirectionalViewPager import android.view.HapticFeedbackConstants import android.view.KeyEvent import android.view.MotionEvent +import androidx.viewpager.widget.DirectionalViewPager import eu.kanade.tachiyomi.ui.reader.viewer.GestureDetectorWithLongTap /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerButton.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerButton.kt index 030ed80d02..f184031a40 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerButton.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerButton.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.annotation.SuppressLint import android.content.Context -import android.support.v7.widget.AppCompatButton +import androidx.appcompat.widget.AppCompatButton import android.view.MotionEvent /** 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 386974a327..4a44965cc6 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 @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.annotation.SuppressLint import android.graphics.Typeface import android.os.Build -import android.support.v7.widget.AppCompatTextView +import androidx.appcompat.widget.AppCompatTextView import android.text.SpannableStringBuilder import android.text.Spanned import android.text.style.StyleSpan diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt index 8f37257a5a..1ce1b2f2c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager -import android.support.v4.view.ViewPager +import androidx.viewpager.widget.ViewPager import android.view.InputDevice import android.view.KeyEvent import android.view.MotionEvent @@ -68,7 +68,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer { pager.offscreenPageLimit = 1 pager.id = R.id.reader_pager pager.adapter = adapter - pager.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() { + pager.addOnPageChangeListener(object : androidx.viewpager.widget.ViewPager.SimpleOnPageChangeListener() { override fun onPageSelected(position: Int) { val page = adapter.items.getOrNull(position) if (page != null && currentPage != page) { @@ -81,7 +81,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer { } override fun onPageScrollStateChanged(state: Int) { - isIdle = state == ViewPager.SCROLL_STATE_IDLE + isIdle = state == androidx.viewpager.widget.ViewPager.SCROLL_STATE_IDLE } }) pager.tapListener = { event -> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt index d03e822b0c..d0dd07874e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager -import android.support.v4.view.PagerAdapter +import androidx.viewpager.widget.PagerAdapter import android.view.View import android.view.ViewGroup import eu.kanade.tachiyomi.ui.reader.model.ChapterTransition @@ -95,7 +95,7 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() { Timber.d("Position for ${view.item} not found") } } - return PagerAdapter.POSITION_NONE + return androidx.viewpager.widget.PagerAdapter.POSITION_NONE } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt index e215646c1d..ddbf3c2ec2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon -import android.support.v7.util.DiffUtil -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.RecyclerView import android.view.ViewGroup import android.widget.FrameLayout import android.widget.LinearLayout @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters /** * RecyclerView Adapter used by this [viewer] to where [ViewerChapters] updates are posted. */ -class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter() { +class WebtoonAdapter(val viewer: WebtoonViewer) : androidx.recyclerview.widget.RecyclerView.Adapter() { /** * List of currently set items. @@ -82,7 +82,7 @@ class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter { val view = FrameLayout(parent.context) @@ -99,7 +99,7 @@ class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter holder.bind(item as ReaderPage) @@ -110,7 +110,7 @@ class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter holder.recycle() is WebtoonTransitionHolder -> holder.recycle() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonLayoutManager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonLayoutManager.kt index c9cd0712c1..34f9898a66 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonLayoutManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonLayoutManager.kt @@ -1,8 +1,8 @@ @file:Suppress("PackageDirectoryMismatch") -package android.support.v7.widget +package androidx.recyclerview.widget -import android.support.v7.widget.RecyclerView.NO_POSITION +import androidx.recyclerview.widget.RecyclerView.NO_POSITION import eu.kanade.tachiyomi.ui.reader.ReaderActivity /** @@ -27,7 +27,7 @@ class WebtoonLayoutManager(activity: ReaderActivity) : LinearLayoutManager(activ /** * Returns the custom extra layout space. */ - override fun getExtraLayoutSpace(state: RecyclerView.State): Int { + override fun getExtraLayoutSpace(state: androidx.recyclerview.widget.RecyclerView.State): Int { return extraLayoutSpace } @@ -37,7 +37,7 @@ class WebtoonLayoutManager(activity: ReaderActivity) : LinearLayoutManager(activ fun findLastEndVisibleItemPosition(): Int { ensureLayoutState() @ViewBoundsCheck.ViewBounds val preferredBoundsFlag = - (ViewBoundsCheck.FLAG_CVE_LT_PVE or ViewBoundsCheck.FLAG_CVE_EQ_PVE) + (androidx.recyclerview.widget.ViewBoundsCheck.FLAG_CVE_LT_PVE or androidx.recyclerview.widget.ViewBoundsCheck.FLAG_CVE_EQ_PVE) val fromIndex = childCount - 1 val toIndex = -1 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 754dbb7e1d..1005c85a37 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 @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.content.Intent import android.graphics.drawable.Drawable import android.net.Uri -import android.support.v7.widget.AppCompatButton -import android.support.v7.widget.AppCompatImageView +import androidx.appcompat.widget.AppCompatButton +import androidx.appcompat.widget.AppCompatImageView import android.view.Gravity import android.view.ViewGroup import android.view.ViewGroup.LayoutParams.MATCH_PARENT diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt index 5ae6b4dcb9..5d68c178e9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt @@ -6,8 +6,8 @@ import android.animation.ValueAnimator import android.annotation.TargetApi import android.content.Context import android.os.Build -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet import android.view.HapticFeedbackConstants import android.view.MotionEvent @@ -22,7 +22,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = 0 -) : RecyclerView(context, attrs, defStyle) { +) : androidx.recyclerview.widget.RecyclerView(context, attrs, defStyle) { private var isZooming = false private var atLastPosition = false @@ -54,7 +54,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor( super.onScrolled(dx, dy) val layoutManager = layoutManager lastVisibleItemPosition = - (layoutManager as LinearLayoutManager).findLastVisibleItemPosition() + (layoutManager as androidx.recyclerview.widget.LinearLayoutManager).findLastVisibleItemPosition() firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition() } 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 4a1812c2c9..f5948b8f6c 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 @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon import android.graphics.Typeface -import android.support.v7.widget.AppCompatButton -import android.support.v7.widget.AppCompatTextView +import androidx.appcompat.widget.AppCompatButton +import androidx.appcompat.widget.AppCompatTextView import android.text.SpannableStringBuilder import android.text.Spanned import android.text.style.StyleSpan diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt index 51d8bd1213..b7d6067b12 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.webtoon -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.WebtoonLayoutManager +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.WebtoonLayoutManager import android.view.KeyEvent import android.view.MotionEvent import android.view.View @@ -66,8 +66,8 @@ class WebtoonViewer(val activity: ReaderActivity) : BaseViewer { recycler.itemAnimator = null recycler.layoutManager = layoutManager recycler.adapter = adapter - recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { - override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { + recycler.addOnScrollListener(object : androidx.recyclerview.widget.RecyclerView.OnScrollListener() { + override fun onScrolled(recyclerView: androidx.recyclerview.widget.RecyclerView, dx: Int, dy: Int) { val position = layoutManager.findLastEndVisibleItemPosition() val item = adapter.items.getOrNull(position) if (item != null && currentPage != item) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt index a766613ad0..01965986bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/DateItem.kt @@ -8,6 +8,8 @@ import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import java.util.* +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class DateItem(val date: Date) : AbstractHeaderItem() { @@ -15,11 +17,11 @@ class DateItem(val date: Date) : AbstractHeaderItem() { return R.layout.recent_chapters_section_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): Holder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { return Holder(view, adapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: Holder, position: Int, payloads: List?) { + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: MutableList?) { holder.bind(this) } @@ -35,7 +37,7 @@ class DateItem(val date: Date) : AbstractHeaderItem() { return date.hashCode() } - class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter, true) { + class Holder(view: View, adapter: FlexibleAdapter>) : FlexibleViewHolder(view, adapter, true) { private val now = Date().time diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterItem.kt index eb983c6089..fe4e685234 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChapterItem.kt @@ -7,6 +7,8 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.model.Download +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class RecentChapterItem(val chapter: Chapter, val manga: Manga, header: DateItem) : AbstractSectionableItem(header) { @@ -26,14 +28,14 @@ class RecentChapterItem(val chapter: Chapter, val manga: Manga, header: DateItem return R.layout.recent_chapters_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter<*>): RecentChapterHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): RecentChapterHolder { return RecentChapterHolder(view , adapter as RecentChaptersAdapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: RecentChapterHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.bind(this) } 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 4333da5c27..4cf2cea26b 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,9 +1,9 @@ package eu.kanade.tachiyomi.ui.recent_updates -import android.support.v7.app.AppCompatActivity -import android.support.v7.view.ActionMode -import android.support.v7.widget.DividerItemDecoration -import android.support.v7.widget.LinearLayoutManager +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 @@ -69,9 +69,9 @@ class RecentChaptersController : NucleusController(), super.onViewCreated(view) // Init RecyclerView and adapter - val layoutManager = LinearLayoutManager(view.context) + val layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) recycler.layoutManager = layoutManager - recycler.addItemDecoration(DividerItemDecoration(view.context, DividerItemDecoration.VERTICAL)) + recycler.addItemDecoration(androidx.recyclerview.widget.DividerItemDecoration(view.context, androidx.recyclerview.widget.DividerItemDecoration.VERTICAL)) recycler.setHasFixedSize(true) adapter = RecentChaptersAdapter(this@RecentChaptersController) recycler.adapter = adapter @@ -113,7 +113,7 @@ class RecentChaptersController : NucleusController(), * Called when item in list is clicked * @param position position of clicked item */ - override fun onItemClick(position: Int): Boolean { + override fun onItemClick(view: View?, position: Int): Boolean { val adapter = adapter ?: return false // Get item from position 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 cddd8eda1c..46340d82e8 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 @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.recently_read -import android.support.v7.widget.LinearLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -55,7 +55,7 @@ class RecentlyReadController : NucleusController(), super.onViewCreated(view) // Initialize adapter - recycler.layoutManager = LinearLayoutManager(view.context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) adapter = RecentlyReadAdapter(this@RecentlyReadController) recycler.setHasFixedSize(true) recycler.adapter = adapter diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadItem.kt index 8faf640c6a..e7e8fb96a8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadItem.kt @@ -5,6 +5,8 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.MangaChapterHistory +import androidx.recyclerview.widget.RecyclerView +import eu.davidea.flexibleadapter.items.IFlexible class RecentlyReadItem(val mch: MangaChapterHistory) : AbstractFlexibleItem() { @@ -12,14 +14,14 @@ class RecentlyReadItem(val mch: MangaChapterHistory) : AbstractFlexibleItem): RecentlyReadHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): RecentlyReadHolder { return RecentlyReadHolder(view, adapter as RecentlyReadAdapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: RecentlyReadHolder, position: Int, - payloads: List?) { + payloads: MutableList?) { holder.bind(mch) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/AnilistLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/AnilistLoginActivity.kt index 6b5da186ea..7aad614e34 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/AnilistLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/AnilistLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting import android.content.Intent import android.os.Bundle -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.view.Gravity.CENTER import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.FrameLayout diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/BangumiLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/BangumiLoginActivity.kt index 5654b4efa4..45a781d65c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/BangumiLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/BangumiLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting import android.content.Intent import android.os.Bundle -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.view.Gravity.CENTER import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.FrameLayout diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt index 5d74a00f76..33fad5651a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/PreferenceDSL.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.setting -import android.support.graphics.drawable.VectorDrawableCompat -import android.support.v4.graphics.drawable.DrawableCompat -import android.support.v7.preference.* +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat +import androidx.core.graphics.drawable.DrawableCompat +import androidx.preference.* import eu.kanade.tachiyomi.widget.preference.IntListPreference @DslMarker 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 dced1cd006..72c49018fc 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,7 +4,7 @@ import android.app.Dialog import android.content.Intent import android.net.Uri import android.os.Bundle -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen import android.view.View import com.afollestad.materialdialogs.MaterialDialog import eu.kanade.tachiyomi.BuildConfig 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 3ad78247a1..346cc1a971 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting import android.app.Dialog import android.os.Bundle -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen import android.view.View import com.afollestad.materialdialogs.MaterialDialog import com.bluelinelabs.conductor.RouterTransaction 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 804d097e59..3cad1d5f6d 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 @@ -7,7 +7,7 @@ import android.content.* import android.net.Uri import android.os.Build import android.os.Bundle -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen import android.view.View import com.afollestad.materialdialogs.MaterialDialog import com.hippo.unifile.UniFile diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt index b4dabd1972..ca42221667 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt @@ -2,9 +2,9 @@ package eu.kanade.tachiyomi.ui.setting import android.content.Context import android.os.Bundle -import android.support.v7.app.AppCompatActivity -import android.support.v7.preference.PreferenceController -import android.support.v7.preference.PreferenceScreen +import androidx.appcompat.app.AppCompatActivity +import androidx.preference.PreferenceController +import androidx.preference.PreferenceScreen import android.util.TypedValue import android.view.ContextThemeWrapper import android.view.LayoutInflater 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 ae53eeabad..988e411490 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 @@ -8,8 +8,8 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.os.Environment -import android.support.v4.content.ContextCompat -import android.support.v7.preference.PreferenceScreen +import androidx.core.content.ContextCompat +import androidx.preference.PreferenceScreen import com.afollestad.materialdialogs.MaterialDialog import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.R 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 f27284c824..58d8f48401 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 @@ -4,8 +4,8 @@ import android.app.Dialog import android.os.Build import android.os.Bundle import android.os.Handler -import android.support.v7.app.AppCompatDelegate -import android.support.v7.preference.PreferenceScreen +import androidx.appcompat.app.AppCompatDelegate +import androidx.preference.PreferenceScreen import android.view.View import com.afollestad.materialdialogs.MaterialDialog import eu.kanade.tachiyomi.R 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 56cfa769db..b45755054d 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 @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.ui.setting -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.util.getResourceColor diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt index d1722ec1f4..c6b59aa471 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.ui.setting import android.os.Build -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys 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 6becc8d35e..98cfd1b494 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 @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.ui.setting import android.graphics.drawable.Drawable -import android.support.v7.preference.PreferenceGroup -import android.support.v7.preference.PreferenceScreen +import androidx.preference.PreferenceGroup +import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.source.SourceManager 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 55bc47059e..e8a585285c 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 @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.setting import android.app.Activity import android.content.Intent -import android.support.customtabs.CustomTabsIntent -import android.support.v7.preference.PreferenceScreen +import androidx.browser.customtabs.CustomTabsIntent +import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ShikomoriLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ShikomoriLoginActivity.kt index d369896edb..0b94c5ebae 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ShikomoriLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ShikomoriLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting import android.content.Intent import android.os.Bundle -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import android.view.Gravity.CENTER import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.FrameLayout diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt index 2c54b236c5..57e178cf0e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ContextExtensions.kt @@ -12,12 +12,12 @@ import android.content.res.Resources import android.net.ConnectivityManager import android.net.Uri import android.os.PowerManager -import android.support.annotation.AttrRes -import android.support.annotation.StringRes -import android.support.customtabs.CustomTabsIntent -import android.support.v4.app.NotificationCompat -import android.support.v4.content.ContextCompat -import android.support.v4.content.LocalBroadcastManager +import androidx.annotation.AttrRes +import androidx.annotation.StringRes +import androidx.browser.customtabs.CustomTabsIntent +import androidx.core.app.NotificationCompat +import androidx.core.content.ContextCompat +import androidx.localbroadcastmanager.content.LocalBroadcastManager import android.widget.Toast import com.nononsenseapps.filepicker.FilePickerActivity import eu.kanade.tachiyomi.R @@ -126,7 +126,7 @@ val Context.powerManager: PowerManager * @param intent intent that contains broadcast information */ fun Context.sendLocalBroadcast(intent: Intent) { - LocalBroadcastManager.getInstance(this).sendBroadcast(intent) + androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(this).sendBroadcast(intent) } /** @@ -135,7 +135,7 @@ fun Context.sendLocalBroadcast(intent: Intent) { * @param intent intent that contains broadcast information */ fun Context.sendLocalBroadcastSync(intent: Intent) { - LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent) + androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(this).sendBroadcastSync(intent) } /** @@ -144,7 +144,7 @@ fun Context.sendLocalBroadcastSync(intent: Intent) { * @param receiver receiver that gets registered. */ fun Context.registerLocalReceiver(receiver: BroadcastReceiver, filter: IntentFilter) { - LocalBroadcastManager.getInstance(this).registerReceiver(receiver, filter) + androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(this).registerReceiver(receiver, filter) } /** @@ -153,7 +153,7 @@ fun Context.registerLocalReceiver(receiver: BroadcastReceiver, filter: IntentFil * @param receiver receiver that gets unregistered. */ fun Context.unregisterLocalReceiver(receiver: BroadcastReceiver) { - LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver) + androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt index edff38614f..a93bd9ee16 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/DiskUtil.kt @@ -5,8 +5,8 @@ import android.content.Intent import android.net.Uri import android.os.Build import android.os.Environment -import android.support.v4.content.ContextCompat -import android.support.v4.os.EnvironmentCompat +import androidx.core.content.ContextCompat +import androidx.core.os.EnvironmentCompat import java.io.File object DiskUtil { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/FileExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/FileExtensions.kt index 3ad0eeca05..98fe9bfbb1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/FileExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/FileExtensions.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.util import android.content.Context import android.net.Uri import android.os.Build -import android.support.v4.content.FileProvider +import androidx.core.content.FileProvider import eu.kanade.tachiyomi.BuildConfig import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt index 0419476da5..728ce72488 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ImageViewExtensions.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.util -import android.support.annotation.DrawableRes -import android.support.graphics.drawable.VectorDrawableCompat +import androidx.annotation.DrawableRes +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import android.widget.ImageView /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt index 30471b37c9..556f84e82a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt @@ -22,5 +22,5 @@ fun Element.attrOrText(css: String): String { * @param html the body of the response. Use only if the body was read before calling this method. */ fun Response.asJsoup(html: String? = null): Document { - return Jsoup.parse(html ?: body()!!.string(), request().url().toString()) + return Jsoup.parse(html ?: body!!.string(), request.url.toString()) } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt index c4fbf2c00c..5db31230e7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt @@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.util import okio.BufferedSource import okio.Okio +import okio.buffer +import okio.sink import java.io.File import java.io.OutputStream @@ -31,7 +33,7 @@ fun BufferedSource.saveTo(file: File) { */ fun BufferedSource.saveTo(stream: OutputStream) { use { input -> - Okio.buffer(Okio.sink(stream)).use { + stream.sink().buffer().use { it.writeAll(input) it.flush() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt index 48d8bc3226..06b2917a21 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt @@ -7,11 +7,11 @@ import android.graphics.Color import android.graphics.Point import android.graphics.Typeface import android.os.Build -import android.support.annotation.Px -import android.support.annotation.RequiresApi -import android.support.design.widget.Snackbar -import android.support.v4.view.ViewCompat -import android.support.v4.view.WindowInsetsCompat +import androidx.annotation.Px +import androidx.annotation.RequiresApi +import com.google.android.material.snackbar.Snackbar +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat import android.view.View import android.view.ViewGroup import android.view.Window @@ -39,7 +39,7 @@ fun View.getCoordinates() = Point((left + right) / 2, (top + bottom) / 2) fun View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: (Snackbar.() -> Unit)? = null): Snackbar { val snack = Snackbar.make(this, message, length) - val textView: TextView = snack.view.findViewById(android.support.design.R.id.snackbar_text) + val textView: TextView = snack.view.findViewById(com.google.android.material.R.id.snackbar_text) textView.setTextColor(Color.WHITE) when { Build.VERSION.SDK_INT >= 23 -> snack.config(context, rootWindowInsets.systemWindowInsetBottom) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt index 21ccf5ae3a..1c22523ff2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ViewGroupExtensions.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.util -import android.support.annotation.LayoutRes +import androidx.annotation.LayoutRes import android.view.LayoutInflater import android.view.View import android.view.ViewGroup diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt index 62cc4b04c3..1eb3cdbab6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt @@ -1,14 +1,14 @@ package eu.kanade.tachiyomi.widget import android.content.Context -import android.support.v7.widget.GridLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : - RecyclerView(context, attrs) { + androidx.recyclerview.widget.RecyclerView(context, attrs) { - private val manager = GridLayoutManager(context, 1) + private val manager = androidx.recyclerview.widget.GridLayoutManager(context, 1) private var columnWidth = -1 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 823e1ce438..6cb136ea03 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/CustomLayoutPicker.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.widget -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView import android.view.ViewGroup import com.nononsenseapps.filepicker.AbstractFilePickerFragment import com.nononsenseapps.filepicker.FilePickerActivity @@ -21,7 +21,7 @@ class CustomLayoutPickerActivity : FilePickerActivity() { } class CustomLayoutFilePickerFragment : FilePickerFragment() { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): androidx.recyclerview.widget.RecyclerView.ViewHolder { when (viewType) { LogicHandler.VIEWTYPE_DIR -> { val view = parent.inflate(R.layout.common_listitem_dir) 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 327bb20aa5..a8fdf1b484 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DialogCheckboxView.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.widget import android.content.Context -import android.support.annotation.StringRes +import androidx.annotation.StringRes import android.util.AttributeSet import android.widget.LinearLayout import eu.kanade.tachiyomi.R diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt index 078bceff44..00441c078a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt @@ -1,23 +1,23 @@ package eu.kanade.tachiyomi.widget -import android.support.v4.widget.DrawerLayout +import androidx.drawerlayout.widget.DrawerLayout import android.view.View import android.view.ViewGroup class DrawerSwipeCloseListener( - private val drawer: DrawerLayout, + private val drawer: androidx.drawerlayout.widget.DrawerLayout, private val navigationView: ViewGroup -) : DrawerLayout.SimpleDrawerListener() { +) : androidx.drawerlayout.widget.DrawerLayout.SimpleDrawerListener() { override fun onDrawerOpened(drawerView: View) { if (drawerView == navigationView) { - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, drawerView) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_UNLOCKED, drawerView) } } override fun onDrawerClosed(drawerView: View) { if (drawerView == navigationView) { - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, drawerView) + drawer.setDrawerLockMode(androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED, drawerView) } } } \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt index 20c33a4fc7..d3ad7f6989 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ElevationAppBarLayout.kt @@ -4,8 +4,8 @@ import android.animation.ObjectAnimator import android.animation.StateListAnimator import android.content.Context import android.os.Build -import android.support.design.R -import android.support.design.widget.AppBarLayout +import com.google.android.material.R +import com.google.android.material.appbar.AppBarLayout import android.util.AttributeSet class ElevationAppBarLayout @JvmOverloads constructor( 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 27db7bfbb6..04ab00a585 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ExtendedNavigationView.kt @@ -2,10 +2,10 @@ package eu.kanade.tachiyomi.widget import android.content.Context import android.graphics.drawable.Drawable -import android.support.annotation.CallSuper -import android.support.graphics.drawable.VectorDrawableCompat -import android.support.v4.content.ContextCompat -import android.support.v7.widget.RecyclerView +import androidx.annotation.CallSuper +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat +import androidx.core.content.ContextCompat +import androidx.recyclerview.widget.RecyclerView import android.util.AttributeSet import android.view.View import android.view.ViewGroup @@ -160,7 +160,7 @@ open class ExtendedNavigationView @JvmOverloads constructor( * Base adapter for the navigation view. It knows how to create and render every subclass of * [Item]. */ - abstract inner class Adapter(private val items: List) : RecyclerView.Adapter() { + abstract inner class Adapter(private val items: List) : androidx.recyclerview.widget.RecyclerView.Adapter() { private val onClick = View.OnClickListener { val pos = recycler.getChildAdapterPosition(it) diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt index eaa4201e1b..975e816dd7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt @@ -1,22 +1,22 @@ package eu.kanade.tachiyomi.widget -import android.support.design.widget.CoordinatorLayout -import android.support.design.widget.FloatingActionButton -import android.support.v4.view.ViewCompat +import androidx.coordinatorlayout.widget.CoordinatorLayout +import com.google.android.material.floatingactionbutton.FloatingActionButton +import androidx.core.view.ViewCompat import android.view.View abstract class FABAnimationBase : FloatingActionButton.Behavior() { var isAnimatingOut = false - override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton, + override fun onStartNestedScroll(coordinatorLayout: androidx.coordinatorlayout.widget.CoordinatorLayout, child: FloatingActionButton, directTargetChild: View, target: View, axes: Int, type: Int): Boolean { // Ensure we react to vertical scrolling return axes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type) } - override fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton, + override fun onNestedScroll(coordinatorLayout: androidx.coordinatorlayout.widget.CoordinatorLayout, child: FloatingActionButton, target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int) { super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type) diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt index e1c4245d27..e48c19e72a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.widget import android.content.Context -import android.support.design.widget.FloatingActionButton -import android.support.v4.view.animation.FastOutSlowInInterpolator +import com.google.android.material.floatingactionbutton.FloatingActionButton +import androidx.interpolator.view.animation.FastOutSlowInInterpolator import android.util.AttributeSet import android.view.View import android.view.animation.Animation diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt index 82c6160984..9469c5e8cd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.widget import android.content.Context -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView -class PreCachingLayoutManager(context: Context) : LinearLayoutManager(context) { +class PreCachingLayoutManager(context: Context) : androidx.recyclerview.widget.LinearLayoutManager(context) { init { isItemPrefetchEnabled = false @@ -16,7 +16,7 @@ class PreCachingLayoutManager(context: Context) : LinearLayoutManager(context) { var extraLayoutSpace = 0 - override fun getExtraLayoutSpace(state: RecyclerView.State): Int { + override fun getExtraLayoutSpace(state: androidx.recyclerview.widget.RecyclerView.State): Int { if (extraLayoutSpace > 0) { return extraLayoutSpace } 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 4c21e897cd..e70c12b8bc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt @@ -2,13 +2,13 @@ package eu.kanade.tachiyomi.widget import android.annotation.SuppressLint import android.content.Context -import android.support.design.R -import android.support.design.internal.ScrimInsetsFrameLayout -import android.support.design.widget.TextInputLayout -import android.support.v4.view.ViewCompat -import android.support.v7.widget.LinearLayoutManager -import android.support.v7.widget.RecyclerView -import android.support.v7.widget.TintTypedArray +import com.google.android.material.R +import com.google.android.material.internal.ScrimInsetsFrameLayout +import com.google.android.material.textfield.TextInputLayout +import androidx.core.view.ViewCompat +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import androidx.appcompat.widget.TintTypedArray import android.util.AttributeSet import android.view.View import android.view.ViewGroup @@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.util.inflate import eu.kanade.tachiyomi.R as TR @Suppress("LeakingThis") -@SuppressLint("PrivateResource") +@SuppressLint("PrivateResource", "RestrictedApi") open class SimpleNavigationView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, @@ -32,7 +32,7 @@ open class SimpleNavigationView @JvmOverloads constructor( /** * Recycler view containing all the items. */ - val recycler = RecyclerView(context) + val recycler = androidx.recyclerview.widget.RecyclerView(context) init { // Custom attributes @@ -56,7 +56,7 @@ open class SimpleNavigationView @JvmOverloads constructor( a.recycle() - recycler.layoutManager = LinearLayoutManager(context) + recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(context) recycler.clipToPadding = false } @@ -78,7 +78,7 @@ open class SimpleNavigationView @JvmOverloads constructor( /** * Base view holder. */ - abstract class Holder(view: View) : RecyclerView.ViewHolder(view) + abstract class Holder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view) /** * Separator view holder. 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 2917879b9c..6f1eefa263 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/StateImageViewTarget.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.widget import android.graphics.drawable.Drawable -import android.support.graphics.drawable.VectorDrawableCompat +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import android.view.View import android.widget.ImageView import android.widget.ImageView.ScaleType diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt index 3effd64ec2..6b101e17ee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.widget -import android.support.v4.view.PagerAdapter +import androidx.viewpager.widget.PagerAdapter import android.view.View import android.view.ViewGroup -abstract class ViewPagerAdapter : PagerAdapter() { +abstract class ViewPagerAdapter : androidx.viewpager.widget.PagerAdapter() { protected abstract fun createView(container: ViewGroup, position: Int): View diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/IntListPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/IntListPreference.kt index 085cfd004c..5631d50c40 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/IntListPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/IntListPreference.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.widget.preference import android.content.Context -import android.support.v7.preference.ListPreference +import androidx.preference.ListPreference import android.util.AttributeSet class IntListPreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : 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 ac45bd4afc..8a0412cc0d 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 @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.widget.preference import android.content.Context import android.graphics.Color -import android.support.v7.preference.CheckBoxPreference -import android.support.v7.preference.PreferenceViewHolder +import androidx.preference.CheckBoxPreference +import androidx.preference.PreferenceViewHolder import android.util.AttributeSet import android.view.View import eu.kanade.tachiyomi.R diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginPreference.kt index adc8f386a7..a778196d61 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/LoginPreference.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.widget.preference import android.content.Context -import android.support.v7.preference.Preference -import android.support.v7.preference.PreferenceViewHolder +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder import android.util.AttributeSet import eu.kanade.tachiyomi.R import kotlinx.android.synthetic.main.pref_widget_imageview.view.* 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 cff0847c10..d2be7de057 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 @@ -4,9 +4,9 @@ import android.annotation.TargetApi import android.content.Context import android.content.res.TypedArray import android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH -import android.support.v7.preference.PreferenceCategory -import android.support.v7.preference.PreferenceViewHolder -import android.support.v7.widget.SwitchCompat +import androidx.preference.PreferenceCategory +import androidx.preference.PreferenceViewHolder +import androidx.appcompat.widget.SwitchCompat import android.util.AttributeSet import android.view.View import android.widget.Checkable diff --git a/app/src/main/res/layout-land/manga_info_controller.xml b/app/src/main/res/layout-land/manga_info_controller.xml index 0d0d778109..ba92abc565 100644 --- a/app/src/main/res/layout-land/manga_info_controller.xml +++ b/app/src/main/res/layout-land/manga_info_controller.xml @@ -1,5 +1,5 @@ - - - - @@ -44,7 +44,7 @@ app:layout_constraintVertical_bias="0.0" android:layout_marginStart="16dp"/> - - @@ -262,11 +262,11 @@ android:layout_marginRight="64dp"/> - + - + - + - - + + diff --git a/app/src/main/res/layout-land/reader_color_filter_sheet.xml b/app/src/main/res/layout-land/reader_color_filter_sheet.xml index 761c279928..9cf10846dd 100644 --- a/app/src/main/res/layout-land/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout-land/reader_color_filter_sheet.xml @@ -1,5 +1,5 @@ - - - - + - + diff --git a/app/src/main/res/layout/catalogue_controller.xml b/app/src/main/res/layout/catalogue_controller.xml index 60706f8159..a165ebcc3e 100644 --- a/app/src/main/res/layout/catalogue_controller.xml +++ b/app/src/main/res/layout/catalogue_controller.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/catalogue_global_search_controller.xml b/app/src/main/res/layout/catalogue_global_search_controller.xml index eae833eac9..debe4fa181 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller.xml +++ b/app/src/main/res/layout/catalogue_global_search_controller.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content"> - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/catalogue_global_search_controller_card_item.xml b/app/src/main/res/layout/catalogue_global_search_controller_card_item.xml index 396ff77794..d79a0975c8 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller_card_item.xml +++ b/app/src/main/res/layout/catalogue_global_search_controller_card_item.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/catalogue_grid_item.xml b/app/src/main/res/layout/catalogue_grid_item.xml index 4bde878c41..3442670aa2 100644 --- a/app/src/main/res/layout/catalogue_grid_item.xml +++ b/app/src/main/res/layout/catalogue_grid_item.xml @@ -29,7 +29,7 @@ android:layout_gravity="bottom" android:background="@drawable/gradient_shape"/> - - + - - + diff --git a/app/src/main/res/layout/catalogue_main_controller.xml b/app/src/main/res/layout/catalogue_main_controller.xml index df9085a1d7..6c9c2d5843 100644 --- a/app/src/main/res/layout/catalogue_main_controller.xml +++ b/app/src/main/res/layout/catalogue_main_controller.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - - + diff --git a/app/src/main/res/layout/categories_controller.xml b/app/src/main/res/layout/categories_controller.xml index cc8017ed35..0857605033 100644 --- a/app/src/main/res/layout/categories_controller.xml +++ b/app/src/main/res/layout/categories_controller.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/chapters_item.xml b/app/src/main/res/layout/chapters_item.xml index 95a5c4eaf1..c164c0104a 100644 --- a/app/src/main/res/layout/chapters_item.xml +++ b/app/src/main/res/layout/chapters_item.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/common_view_empty.xml b/app/src/main/res/layout/common_view_empty.xml index 03e3292592..8973f40132 100644 --- a/app/src/main/res/layout/common_view_empty.xml +++ b/app/src/main/res/layout/common_view_empty.xml @@ -5,7 +5,7 @@ android:layout_gravity="center" xmlns:android="http://schemas.android.com/apk/res/android"> - - - - - - - @@ -20,5 +20,5 @@ android:paddingTop="8dp" tools:text="Title"/> - + \ No newline at end of file diff --git a/app/src/main/res/layout/extension_card_item.xml b/app/src/main/res/layout/extension_card_item.xml index 23ee4e5e79..15266ac40b 100644 --- a/app/src/main/res/layout/extension_card_item.xml +++ b/app/src/main/res/layout/extension_card_item.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - + diff --git a/app/src/main/res/layout/extension_controller.xml b/app/src/main/res/layout/extension_controller.xml index a309248ff5..fb91bb1662 100644 --- a/app/src/main/res/layout/extension_controller.xml +++ b/app/src/main/res/layout/extension_controller.xml @@ -1,16 +1,16 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/extension_detail_controller.xml b/app/src/main/res/layout/extension_detail_controller.xml index a060f4cd07..126b092bce 100644 --- a/app/src/main/res/layout/extension_detail_controller.xml +++ b/app/src/main/res/layout/extension_detail_controller.xml @@ -1,5 +1,5 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/library_category.xml b/app/src/main/res/layout/library_category.xml index df6b7ce5ac..8c431ae09b 100644 --- a/app/src/main/res/layout/library_category.xml +++ b/app/src/main/res/layout/library_category.xml @@ -4,11 +4,11 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/library_controller.xml b/app/src/main/res/layout/library_controller.xml index b0bed0ca56..e24b4ec9a9 100644 --- a/app/src/main/res/layout/library_controller.xml +++ b/app/src/main/res/layout/library_controller.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/app/src/main/res/layout/library_list_recycler.xml b/app/src/main/res/layout/library_list_recycler.xml index 124bcd6d77..1d8db6c66b 100644 --- a/app/src/main/res/layout/library_list_recycler.xml +++ b/app/src/main/res/layout/library_list_recycler.xml @@ -1,5 +1,5 @@ - - - - - - + diff --git a/app/src/main/res/layout/manga_controller.xml b/app/src/main/res/layout/manga_controller.xml index f0b5e594de..ff3e76c669 100644 --- a/app/src/main/res/layout/manga_controller.xml +++ b/app/src/main/res/layout/manga_controller.xml @@ -1,5 +1,5 @@ - - - - @@ -24,7 +24,7 @@ android:layout_marginTop="16dp" app:layout_constraintTop_toBottomOf="@+id/manga_cover"/> - - - - @@ -239,9 +239,9 @@ app:layout_constraintLeft_toRightOf="@+id/manga_source_label" app:layout_constraintRight_toRightOf="parent"/> - + - + - - + - + - - + + diff --git a/app/src/main/res/layout/migration_controller.xml b/app/src/main/res/layout/migration_controller.xml index d3caebbca4..1ba1c2b47a 100644 --- a/app/src/main/res/layout/migration_controller.xml +++ b/app/src/main/res/layout/migration_controller.xml @@ -1,5 +1,5 @@ - - - - + diff --git a/app/src/main/res/layout/reader_activity.xml b/app/src/main/res/layout/reader_activity.xml index 5c1dadaf0d..2a1ea590d1 100644 --- a/app/src/main/res/layout/reader_activity.xml +++ b/app/src/main/res/layout/reader_activity.xml @@ -44,7 +44,7 @@ android:visibility="invisible" tools:visibility="visible"> - - - - - - - - - + diff --git a/app/src/main/res/layout/reader_color_filter_sheet.xml b/app/src/main/res/layout/reader_color_filter_sheet.xml index 8a9980a3ff..c4d4da941b 100644 --- a/app/src/main/res/layout/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout/reader_color_filter_sheet.xml @@ -10,7 +10,7 @@ android:layout_width="match_parent" android:layout_height="200dp"> - - - + diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index 73933fff36..ed8e79551c 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -1,5 +1,5 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/app/src/main/res/layout/recent_chapters_controller.xml b/app/src/main/res/layout/recent_chapters_controller.xml index 8b420b6448..cea9d5f895 100644 --- a/app/src/main/res/layout/recent_chapters_controller.xml +++ b/app/src/main/res/layout/recent_chapters_controller.xml @@ -1,5 +1,5 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/recent_chapters_item.xml b/app/src/main/res/layout/recent_chapters_item.xml index 2bf1b92d87..6d90a4f327 100644 --- a/app/src/main/res/layout/recent_chapters_item.xml +++ b/app/src/main/res/layout/recent_chapters_item.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/recently_read_controller.xml b/app/src/main/res/layout/recently_read_controller.xml index e0f4da99b1..ca92b48550 100644 --- a/app/src/main/res/layout/recently_read_controller.xml +++ b/app/src/main/res/layout/recently_read_controller.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - + - @@ -69,4 +69,4 @@ android:text="@string/action_resume"/> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/track_controller.xml b/app/src/main/res/layout/track_controller.xml index 2d3dd35e97..811ccb347c 100644 --- a/app/src/main/res/layout/track_controller.xml +++ b/app/src/main/res/layout/track_controller.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/track_item.xml b/app/src/main/res/layout/track_item.xml index 07c05ebcc2..f3e831c5fc 100644 --- a/app/src/main/res/layout/track_item.xml +++ b/app/src/main/res/layout/track_item.xml @@ -1,12 +1,12 @@ - - @@ -186,6 +186,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/track_search_item.xml b/app/src/main/res/layout/track_search_item.xml index acab56c218..a38bddb7d0 100644 --- a/app/src/main/res/layout/track_search_item.xml +++ b/app/src/main/res/layout/track_search_item.xml @@ -1,12 +1,12 @@ - - - - - + + diff --git a/app/src/main/res/menu/catalogue_list.xml b/app/src/main/res/menu/catalogue_list.xml index 1b75d4ae75..80d8739fd7 100644 --- a/app/src/main/res/menu/catalogue_list.xml +++ b/app/src/main/res/menu/catalogue_list.xml @@ -7,7 +7,7 @@ android:title="@string/action_search" android:icon="@drawable/ic_search_white_24dp" app:showAsAction="collapseActionView|ifRoom" - app:actionViewClass="android.support.v7.widget.SearchView"/> + app:actionViewClass="androidx.appcompat.widget.SearchView"/> + app:actionViewClass="androidx.appcompat.widget.SearchView"/> + app:actionViewClass="androidx.appcompat.widget.SearchView"/> diff --git a/app/src/main/res/menu/extension_main.xml b/app/src/main/res/menu/extension_main.xml index dd634ce737..994ae2fbc2 100644 --- a/app/src/main/res/menu/extension_main.xml +++ b/app/src/main/res/menu/extension_main.xml @@ -6,6 +6,6 @@ android:title="@string/action_search" android:icon="@drawable/ic_search_white_24dp" app:showAsAction="collapseActionView|ifRoom" - app:actionViewClass="android.support.v7.widget.SearchView"/> + app:actionViewClass="androidx.appcompat.widget.SearchView"/> diff --git a/app/src/main/res/menu/library.xml b/app/src/main/res/menu/library.xml index b415e339d5..ad53ae03a1 100644 --- a/app/src/main/res/menu/library.xml +++ b/app/src/main/res/menu/library.xml @@ -7,7 +7,7 @@ android:id="@+id/action_search" android:icon="@drawable/ic_search_white_24dp" android:title="@string/action_search" - app:actionViewClass="android.support.v7.widget.SearchView" + app:actionViewClass="androidx.appcompat.widget.SearchView" app:showAsAction="collapseActionView|ifRoom"/> true @style/ThemeOverlay.AppCompat.Dark.ActionBar @style/ThemeOverlay.AppCompat - @style/PreferenceThemeOverlay.Material + @style/PreferenceThemeOverlay.v14.Material @color/dialogDark @style/Theme.AlertDialog.Dark diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index a57d6a680b..d6084bfebc 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -26,7 +26,7 @@ true @style/Theme.ActionBar.Light - @style/PreferenceThemeOverlay.Material + @style/PreferenceThemeOverlay.v14.Material @style/Theme.AlertDialog.Light @color/dialogLight @@ -78,7 +78,7 @@ true @style/ThemeOverlay.AppCompat.Dark.ActionBar @style/ThemeOverlay.AppCompat - @style/PreferenceThemeOverlay.Material + @style/PreferenceThemeOverlay.v14.Material @color/dialogDark @style/Theme.AlertDialog.Dark @@ -115,7 +115,7 @@ true @style/Theme.ActionBar.Light - @style/PreferenceThemeOverlay.Material + @style/PreferenceThemeOverlay.v14.Material @style/Theme.AlertDialog.Light diff --git a/gradle.properties b/gradle.properties index 1d3591c8a4..915f0e66f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,6 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file