From 78689e74432695a655d7b1cd782f23d646dd87ce Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 5 Jan 2020 11:29:27 -0500 Subject: [PATCH] Migrate to AndroidX (#2424) * Migrate to AndroidX (automatic conversion by Android Studio) * AndroidX dependency code updates * Fix source preference reparenting * fixes the androidx prefererences icon spacing issue (cherry picked from commit b76a15d960ec2cdf771be16377db0348b66b3179) * Fix source preference screen heading size/list padding Co-authored-by: Carlos --- app/build.gradle | 55 ++++++++++--------- app/proguard-rules.pro | 28 +++------- app/src/main/AndroidManifest.xml | 2 +- app/src/main/java/eu/kanade/tachiyomi/App.kt | 2 +- .../tachiyomi/data/cache/ChapterCache.kt | 11 ++-- .../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 | 4 +- .../preference/SharedPreferencesDataStore.kt | 2 +- .../tachiyomi/data/track/TrackService.kt | 4 +- .../data/track/anilist/AnilistApi.kt | 19 ++++--- .../data/track/bangumi/BangumiApi.kt | 8 +-- .../data/track/bangumi/BangumiInterceptor.kt | 10 ++-- .../data/track/kitsu/KitsuInterceptor.kt | 4 +- .../tachiyomi/data/track/kitsu/KitsuModels.kt | 2 +- .../data/track/myanimelist/MyAnimeList.kt | 9 ++- .../myanimelist/MyAnimeListInterceptor.kt | 6 +- .../data/track/myanimelist/MyanimelistApi.kt | 22 +++++--- .../data/track/shikimori/ShikimoriApi.kt | 18 +++--- .../track/shikimori/ShikimoriInterceptor.kt | 2 +- .../tachiyomi/data/updater/UpdaterJob.kt | 2 +- .../tachiyomi/data/updater/UpdaterNotifier.kt | 4 +- .../tachiyomi/data/updater/UpdaterService.kt | 2 +- .../extension/api/ExtensionGithubApi.kt | 2 +- .../tachiyomi/network/AndroidCookieJar.kt | 2 +- .../network/CloudflareInterceptor.kt | 8 +-- .../kanade/tachiyomi/network/NetworkHelper.kt | 2 +- .../tachiyomi/network/OkHttpExtensions.kt | 8 +-- .../tachiyomi/network/ProgressResponseBody.kt | 6 +- .../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 | 4 +- .../controller/SecondaryDrawerController.kt | 4 +- .../ui/base/controller/TabbedController.kt | 4 +- .../ui/base/holder/BaseViewHolder.kt | 4 +- .../presenter/NucleusConductorDelegate.java | 2 +- .../NucleusConductorLifecycleListener.java | 2 +- .../ui/catalogue/CatalogueController.kt | 10 ++-- .../kanade/tachiyomi/ui/catalogue/LangItem.kt | 12 ++-- .../catalogue/SourceDividerItemDecoration.kt | 2 +- .../tachiyomi/ui/catalogue/SourceItem.kt | 14 +++-- .../browse/BrowseCatalogueController.kt | 19 ++++--- .../ui/catalogue/browse/CatalogueItem.kt | 22 +++++--- .../ui/catalogue/browse/ProgressItem.kt | 8 ++- .../ui/catalogue/filter/CheckboxItem.kt | 8 ++- .../ui/catalogue/filter/GroupItem.kt | 8 ++- .../ui/catalogue/filter/HeaderItem.kt | 8 ++- .../ui/catalogue/filter/SelectItem.kt | 8 ++- .../ui/catalogue/filter/SeparatorItem.kt | 10 ++-- .../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 | 2 +- .../global_search/CatalogueSearchCardItem.kt | 8 ++- .../CatalogueSearchController.kt | 4 +- .../global_search/CatalogueSearchHolder.kt | 2 +- .../global_search/CatalogueSearchItem.kt | 6 +- .../latest/LatestUpdatesController.kt | 2 +- .../ui/category/CategoryController.kt | 14 ++--- .../tachiyomi/ui/category/CategoryItem.kt | 8 ++- .../tachiyomi/ui/download/DownloadAdapter.kt | 2 +- .../ui/download/DownloadController.kt | 2 +- .../ui/extension/ExtensionController.kt | 6 +- .../extension/ExtensionDetailsController.kt | 24 ++++---- .../ExtensionDividerItemDecoration.kt | 2 +- .../ui/extension/ExtensionGroupItem.kt | 6 +- .../tachiyomi/ui/extension/ExtensionItem.kt | 6 +- .../ui/library/LibraryCategoryAdapter.kt | 6 +- .../ui/library/LibraryCategoryView.kt | 9 +-- .../tachiyomi/ui/library/LibraryController.kt | 15 ++--- .../tachiyomi/ui/library/LibraryItem.kt | 10 ++-- .../kanade/tachiyomi/ui/main/MainActivity.kt | 6 +- .../kanade/tachiyomi/ui/main/TabsAnimator.kt | 4 +- .../tachiyomi/ui/manga/MangaController.kt | 4 +- .../tachiyomi/ui/manga/chapter/ChapterItem.kt | 8 ++- .../ui/manga/chapter/ChaptersController.kt | 12 ++-- .../ui/manga/info/MangaInfoController.kt | 14 ++--- .../tachiyomi/ui/manga/track/TrackAdapter.kt | 2 +- .../ui/manga/track/TrackController.kt | 4 +- .../tachiyomi/ui/migration/MangaItem.kt | 8 ++- .../ui/migration/MigrationController.kt | 8 +-- .../tachiyomi/ui/migration/SelectionHeader.kt | 6 +- .../tachiyomi/ui/migration/SourceItem.kt | 8 ++- .../ui/reader/PageIndicatorTextView.kt | 2 +- .../ui/reader/ReaderColorFilterSheet.kt | 6 +- .../tachiyomi/ui/reader/ReaderPageSheet.kt | 2 +- .../tachiyomi/ui/reader/ReaderSeekBar.kt | 2 +- .../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 | 2 +- .../reader/viewer/pager/PagerViewerAdapter.kt | 2 +- .../reader/viewer/webtoon/WebtoonAdapter.kt | 4 +- .../viewer/webtoon/WebtoonLayoutManager.kt | 4 +- .../viewer/webtoon/WebtoonPageHolder.kt | 4 +- .../viewer/webtoon/WebtoonRecyclerView.kt | 4 +- .../viewer/webtoon/WebtoonTransitionHolder.kt | 4 +- .../ui/reader/viewer/webtoon/WebtoonViewer.kt | 4 +- .../tachiyomi/ui/recent_updates/DateItem.kt | 8 ++- .../ui/recent_updates/RecentChapterItem.kt | 8 ++- .../RecentChaptersController.kt | 10 ++-- .../recently_read/RecentlyReadController.kt | 4 +- .../ui/recently_read/RecentlyReadItem.kt | 8 ++- .../ui/setting/AnilistLoginActivity.kt | 4 +- .../ui/setting/BangumiLoginActivity.kt | 4 +- .../tachiyomi/ui/setting/PreferenceDSL.kt | 16 ++++-- .../ui/setting/SettingsAboutController.kt | 2 +- .../ui/setting/SettingsAdvancedController.kt | 2 +- .../ui/setting/SettingsBackupController.kt | 2 +- .../ui/setting/SettingsController.kt | 8 +-- .../ui/setting/SettingsDownloadController.kt | 4 +- .../ui/setting/SettingsGeneralController.kt | 2 +- .../ui/setting/SettingsMainController.kt | 4 +- .../ui/setting/SettingsReaderController.kt | 2 +- .../ui/setting/SettingsSourcesController.kt | 6 +- .../ui/setting/SettingsTrackingController.kt | 10 ++-- .../ui/setting/ShikomoriLoginActivity.kt | 4 +- .../tachiyomi/util/ContextExtensions.kt | 12 ++-- .../java/eu/kanade/tachiyomi/util/DiskUtil.kt | 4 +- .../kanade/tachiyomi/util/FileExtensions.kt | 2 +- .../tachiyomi/util/ImageViewExtensions.kt | 6 +- .../kanade/tachiyomi/util/JsoupExtensions.kt | 4 +- .../kanade/tachiyomi/util/OkioExtensions.kt | 5 +- .../kanade/tachiyomi/util/ViewExtensions.kt | 4 +- .../tachiyomi/util/ViewGroupExtensions.kt | 2 +- .../tachiyomi/widget/AutofitRecyclerView.kt | 6 +- .../tachiyomi/widget/CustomLayoutPicker.kt | 4 +- .../tachiyomi/widget/DialogCheckboxView.kt | 2 +- .../widget/DrawerSwipeCloseListener.kt | 4 +- .../tachiyomi/widget/ElevationAppBarLayout.kt | 6 +- .../widget/ExtendedNavigationView.kt | 10 ++-- .../tachiyomi/widget/FABAnimationBase.kt | 8 +-- .../tachiyomi/widget/FABAnimationUpDown.kt | 6 +- .../widget/PreCachingLayoutManager.kt | 4 +- .../tachiyomi/widget/SimpleNavigationView.kt | 18 +++--- .../tachiyomi/widget/StateImageViewTarget.kt | 2 +- .../tachiyomi/widget/ViewPagerAdapter.kt | 2 +- .../widget/preference/IntListPreference.kt | 4 +- .../preference/LoginCheckBoxPreference.kt | 6 +- .../widget/preference/LoginPreference.kt | 4 +- .../preference/SwitchPreferenceCategory.kt | 8 +-- .../res/layout-land/manga_info_controller.xml | 18 +++--- .../layout-land/reader_color_filter_sheet.xml | 10 ++-- .../main/res/layout/catalogue_controller.xml | 4 +- .../catalogue_global_search_controller.xml | 4 +- ...atalogue_global_search_controller_card.xml | 10 ++-- ...gue_global_search_controller_card_item.xml | 4 +- .../main/res/layout/catalogue_grid_item.xml | 6 +- .../main/res/layout/catalogue_list_item.xml | 4 +- .../res/layout/catalogue_main_controller.xml | 4 +- .../catalogue_main_controller_card_item.xml | 4 +- .../main/res/layout/categories_controller.xml | 6 +- .../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 | 10 ++-- .../main/res/layout/extension_card_header.xml | 6 +- .../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 | 6 +- .../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 | 4 +- .../main/res/layout/manga_info_controller.xml | 24 ++++---- .../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 | 6 +- .../main/res/layout/recently_read_item.xml | 4 +- app/src/main/res/layout/track_controller.xml | 8 +-- 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/themes.xml | 4 +- gradle.properties | 6 +- 199 files changed, 689 insertions(+), 607 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0589e8bae5..14d2e9c40c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { applicationId "eu.kanade.tachiyomi" minSdkVersion 16 targetSdkVersion 28 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" versionCode 41 versionName "0.8.4" @@ -108,21 +108,20 @@ 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 'androidx.legacy:legacy-support-v4:1.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.1.0' + implementation 'androidx.preference:preference:1.1.0' + implementation 'androidx.annotation:annotation:1.1.0' + implementation 'androidx.browser:browser:1.2.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' + 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' + standardImplementation 'com.google.firebase:firebase-core:17.2.1' // ReactiveX implementation 'io.reactivex:rxandroid:1.2.1' @@ -132,17 +131,19 @@ dependencies { 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" // JSON - implementation 'com.google.code.gson:gson:2.8.2' + implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.github.salomonbrys.kotson:kotson:2.5.0' // JavaScript engine @@ -157,13 +158,13 @@ dependencies { // 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.1.1' + 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' @@ -177,13 +178,13 @@ 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.7.1' @@ -194,24 +195,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/proguard-rules.pro b/app/proguard-rules.pro index cc477df740..0d0bde354f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -4,6 +4,12 @@ -keep class eu.kanade.tachiyomi.** -keep class eu.kanade.tachiyomi.source.model.** { *; } +# Design library +-dontwarn com.google.android.material.** +-keep class com.google.android.material.** { *; } +-keep interface com.google.android.material.** { *; } +-keep public class com.google.android.material.R$* { *; } + -keep class com.hippo.image.** { *; } -keep interface com.hippo.image.** { *; } -dontwarn nucleus.view.NucleusActionBarActivity @@ -46,26 +52,6 @@ rx.internal.util.atomic.LinkedQueueNode consumerNode; } -### Support v7, Design -# http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051 --keep class android.support.v7.widget.RoundRectDrawable { *; } - --keep public class android.support.v7.widget.** { *; } --keep public class android.support.v7.internal.widget.** { *; } --keep public class android.support.v7.internal.view.menu.** { *; } --keep public class android.support.v7.graphics.drawable.** { *; } - --keep public class * extends android.support.v4.view.ActionProvider { - public (android.content.Context); -} - --dontwarn android.support.** --dontwarn android.support.design.** --keep class android.support.design.** { *; } --keep interface android.support.design.** { *; } --keep public class android.support.design.R$* { *; } - - # ReactiveNetwork -dontwarn com.github.pwittchen.reactivenetwork.** @@ -89,4 +75,4 @@ -dontwarn org.yaml.snakeyaml.** # Duktape --keep class com.squareup.duktape.** { *; } \ No newline at end of file +-keep class com.squareup.duktape.** { *; } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a218391ca5..d2e855747c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -98,7 +98,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/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index 4868dec1ec..acb7b6b7a6 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 @@ -10,7 +10,8 @@ import eu.kanade.tachiyomi.source.model.Page 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 +127,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() } @@ -170,7 +171,7 @@ class ChapterCache(private val context: Context) { /** * Add image to cache. - * + * * @param imageUrl url of image. * @param response http response from page. * @throws IOException image error. @@ -186,12 +187,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 33ef28abb7..75676fcb83 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 0dc8e1e6cf..25dc94e128 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..2f2081a27b 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() { @@ -45,4 +45,4 @@ class EmptyPreferenceDataStore : PreferenceDataStore() { override fun putStringSet(key: String?, values: Set?) { } -} \ No newline at end of file +} 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 8d02d1c77d..7c3295f21f 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 9a09658c60..6698b1cde2 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 @@ -1,13 +1,18 @@ package eu.kanade.tachiyomi.data.track.anilist import android.net.Uri -import com.github.salomonbrys.kotson.* +import com.github.salomonbrys.kotson.array +import com.github.salomonbrys.kotson.get +import com.github.salomonbrys.kotson.jsonObject +import com.github.salomonbrys.kotson.nullInt +import com.github.salomonbrys.kotson.nullString +import com.github.salomonbrys.kotson.obj import com.google.gson.JsonObject import com.google.gson.JsonParser 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 +23,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() fun addLibManga(track: Track): Observable { @@ -47,7 +52,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") @@ -130,7 +135,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") } @@ -191,7 +196,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") } @@ -236,7 +241,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..44b874bea7 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() } @@ -43,4 +43,4 @@ class KitsuInterceptor(val kitsu: Kitsu, val gson: Gson) : Interceptor { kitsu.saveToken(oauth) } -} \ No newline at end of file +} 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 b5e55d9d97..5e709e810f 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 da40b5cfd5..a57012447d 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 @@ -7,10 +7,9 @@ import eu.kanade.tachiyomi.data.database.models.Track 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 class Myanimelist(private val context: Context, id: Int) : TrackService(id) { @@ -138,7 +137,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 @@ -152,9 +151,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 124182168f..9eae9f1370 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 @@ -15,7 +15,7 @@ class MyAnimeListInterceptor(private val myanimelist: Myanimelist): Interceptor val request = chain.request() var response = chain.proceed(updateRequest(request)) - if (response.code() == 400){ + if (response.code == 400){ myanimelist.refreshLogin() response = chain.proceed(updateRequest(request)) } @@ -24,7 +24,7 @@ class MyAnimeListInterceptor(private val myanimelist: Myanimelist): Interceptor } private fun updateRequest(request: Request): Request { - return request.body()?.let { + return request.body?.let { val contentType = it.contentType().toString() val updatedBody = when { contentType.contains("x-www-form-urlencoded") -> updateFormBody(it) @@ -56,4 +56,4 @@ class MyAnimeListInterceptor(private val myanimelist: Myanimelist): Interceptor return RequestBody.create(requestBody.contentType(), newBody.toString()) } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt index efc3abefc0..3bc1b3f3b0 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 @@ -10,7 +10,11 @@ import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.util.selectInt import eu.kanade.tachiyomi.util.selectText -import okhttp3.* +import okhttp3.FormBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.OkHttpClient +import okhttp3.RequestBody +import okhttp3.Response import org.json.JSONObject import org.jsoup.Jsoup import org.jsoup.nodes.Document @@ -85,7 +89,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 +129,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 +176,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 +266,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 RequestBody.create("application/json; charset=utf-8".toMediaTypeOrNull(), body.toString()) } private fun Element.searchTitle() = select("strong").text()!! @@ -298,4 +302,4 @@ class MyanimelistApi(private val client: OkHttpClient, interceptor: MyAnimeListI else -> 1 } } -} \ No newline at end of file +} 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..7441cf66d1 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 @@ -14,7 +14,11 @@ import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservableSuccess -import okhttp3.* +import okhttp3.FormBody +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.RequestBody import rx.Observable import uy.kohesive.injekt.injectLazy @@ -22,7 +26,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 +67,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 +124,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 +147,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..d464b4f637 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 @@ -106,4 +106,4 @@ internal class UpdaterNotifier(private val context: Context) { } notification.show(Notifications.ID_UPDATER) } -} \ No newline at end of file +} 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..ff231ed421 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt @@ -21,7 +21,7 @@ class AndroidCookieJar(context: Context) : CookieJar { } } - override fun saveFromResponse(url: HttpUrl, cookies: MutableList) { + override fun saveFromResponse(url: HttpUrl, cookies: List) { val urlString = url.toString() for (cookie in cookies) { 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..905113352b 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,10 +61,10 @@ 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() return progressClient.newCall(request) -} \ No newline at end of file +} 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..a90a04576c 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 { @@ -25,7 +25,7 @@ class ProgressResponseBody(private val responseBody: ResponseBody, private val p private fun source(source: Source): Source { return object : ForwardingSource(source) { - internal var totalBytesRead = 0L + var totalBytesRead = 0L @Throws(IOException::class) override fun read(sink: Buffer, byteCount: Long): Long { @@ -37,4 +37,4 @@ class ProgressResponseBody(private val responseBody: ResponseBody, private val p } } } -} \ No newline at end of file +} 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..4f5154fe52 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) -} \ 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..def5f2eaf4 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 @@ -89,4 +89,4 @@ abstract class RxController(bundle: Bundle? = null) : BaseController(bundle) { return subscribe(onNext, onError, onCompleted).also { untilDestroySubscriptions.add(it) } } -} \ No newline at end of file +} 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..fa76b576d9 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,6 +1,6 @@ package eu.kanade.tachiyomi.ui.base.controller -import android.support.v4.widget.DrawerLayout +import androidx.drawerlayout.widget.DrawerLayout import android.view.ViewGroup interface SecondaryDrawerController { @@ -8,4 +8,4 @@ interface SecondaryDrawerController { fun createSecondaryDrawer(drawer: DrawerLayout): ViewGroup? fun cleanupSecondaryDrawer(drawer: 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..48cbda58a5 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,10 +1,10 @@ package eu.kanade.tachiyomi.ui.base.controller -import android.support.design.widget.TabLayout +import com.google.android.material.tabs.TabLayout interface TabbedController { fun configureTabs(tabs: TabLayout) {} fun cleanupTabs(tabs: TabLayout) {} -} \ No newline at end of file +} 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..68a66475c0 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,6 +1,6 @@ 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 @@ -8,4 +8,4 @@ abstract class BaseViewHolder(view: View) : RecyclerView.ViewHolder(view), Layou override val containerView: View? get() = itemView -} \ No newline at end of file +} 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 ceed07a35d..a839d29e84 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 @@ -132,7 +132,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()) { @@ -150,7 +150,7 @@ class CatalogueController : NucleusController(), * Called when browse is clicked in [CatalogueAdapter] */ override fun onBrowseClick(position: Int) { - onItemClick(position) + onItemClick(view!!, position) } /** @@ -233,4 +233,4 @@ class CatalogueController : NucleusController(), } class SettingsSourcesFadeChangeHandler : FadeChangeHandler() -} \ No newline at end of file +} 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..7bf01f1d43 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,18 @@ 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..1b33496160 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,7 +4,7 @@ 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() { 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..9543e5e692 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,17 +27,19 @@ 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) } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt index 93ee031792..64dc08e232 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,15 @@ 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 androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.afollestad.materialdialogs.MaterialDialog import com.f2prateek.rx.preferences.Preference import com.jakewharton.rxbinding.support.v7.widget.queryTextChangeEvents @@ -136,13 +141,13 @@ open class BrowseCatalogueController(bundle: Bundle) : this.navView = navView navView.setFilters(presenter.filterItems) - drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.END) + drawer.setDrawerLockMode(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) } @@ -273,7 +278,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) @@ -468,7 +473,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/CatalogueItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt index 71696565be..8c746774dd 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 @@ -4,9 +4,11 @@ import android.view.Gravity import android.view.View import android.view.ViewGroup.LayoutParams.MATCH_PARENT import android.widget.FrameLayout +import androidx.recyclerview.widget.RecyclerView import com.f2prateek.rx.preferences.Preference 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.Manga import eu.kanade.tachiyomi.data.preference.getOrDefault @@ -23,7 +25,10 @@ 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,11 +43,12 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference, - holder: CatalogueHolder, - position: Int, - payloads: List?) { - + override fun bindViewHolder( + adapter: FlexibleAdapter>, + holder: CatalogueHolder, + position: Int, + payloads: List? + ) { holder.onSetValues(manga) } @@ -58,6 +64,4 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference() { 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: List) { holder.progressBar.visibility = View.GONE holder.progressMessage.visibility = View.GONE @@ -46,4 +48,4 @@ class ProgressItem : AbstractFlexibleItem() { val progressMessage: TextView = view.findViewById(R.id.progress_message) } -} \ No newline at end of file +} 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..c38c8cda62 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: List?) { val view = holder.check view.text = filter.name view.isChecked = filter.state @@ -42,4 +44,4 @@ open class CheckboxItem(val filter: Filter.CheckBox) : AbstractFlexibleItem) : 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: List?) { holder.title.text = filter.name holder.icon.setVectorCompat(if (isExpanded) @@ -62,4 +64,4 @@ 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: List?) { val view = holder.itemView as TextView view.text = filter.name } 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..7042751529 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 @@ -4,8 +4,10 @@ import android.view.View import android.widget.ArrayAdapter import android.widget.Spinner 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 import eu.kanade.tachiyomi.source.model.Filter @@ -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: List?) { holder.text.text = filter.name + ": " val spinner = holder.spinner @@ -51,4 +53,4 @@ 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: List?) { } @@ -34,4 +36,4 @@ class SeparatorItem(val filter: Filter.Separator) : AbstractHeaderItem) : 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..fba5258325 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: List?) { holder.title.text = filter.name holder.icon.setVectorCompat(if (isExpanded) @@ -49,4 +51,4 @@ class SortGroup(val filter: Filter.Sort) : AbstractExpandableHeaderItem) : 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..3a1905e3fa 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,11 +1,13 @@ 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 androidx.recyclerview.widget.RecyclerView import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractSectionableItem +import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.model.Filter @@ -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: List?) { val view = holder.text view.text = name val filter = group.filter @@ -71,4 +73,4 @@ class SortItem(val name: String, val group: SortGroup) : AbstractSectionableItem val text: CheckedTextView = itemView.findViewById(R.id.nav_view_item) } -} \ No newline at end of file +} 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..077082ab51 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,10 +1,12 @@ 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 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 @@ -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: List?) { holder.wrapper.hint = filter.name holder.edit.setText(filter.state) holder.edit.addTextChangedListener(object : SimpleTextWatcher() { @@ -45,4 +47,4 @@ 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: List?) { val view = holder.text view.text = filter.name @@ -72,4 +74,4 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem): CatalogueSearchCardHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueSearchCardHolder { return CatalogueSearchCardHolder(view, adapter as CatalogueSearchCardAdapter) } - override fun bindViewHolder(adapter: FlexibleAdapter<*>, holder: CatalogueSearchCardHolder, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CatalogueSearchCardHolder, position: Int, payloads: List?) { holder.bind(manga) } @@ -32,4 +34,4 @@ class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem): 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, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CatalogueSearchHolder, position: Int, payloads: List?) { 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..e596c06ba4 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 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 c698c2d6e6..6200d58ba8 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 @@ -205,7 +205,7 @@ 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) { toggleSelection(position) @@ -320,4 +320,4 @@ class CategoryController : NucleusController(), activity?.toast(R.string.error_category_exists) } -} \ No newline at end of file +} 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..7b01cb3de6 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,7 +43,7 @@ class CategoryItem(val category: Category) : AbstractFlexibleItem, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: CategoryHolder, position: Int, payloads: List?) { @@ -68,4 +70,4 @@ class CategoryItem(val category: Category) : AbstractFlexibleItem(), 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 c851b81ade..9d020e278a 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,10 @@ 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.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 @@ -74,7 +73,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) : val manager = PreferenceManager(themedContext) manager.preferenceDataStore = EmptyPreferenceDataStore() manager.onDisplayPreferenceDialogListener = this - val screen = manager.createPreferenceScreen(themedContext) + val screen = manager.createPreferenceScreen(context) preferenceScreen = screen val multiSource = extension.sources.size > 1 @@ -136,10 +135,13 @@ class ExtensionDetailsController(bundle: Bundle? = null) : val newScreen = screen.preferenceManager.createPreferenceScreen(context) source.setupPreferenceScreen(newScreen) - for (i in 0 until newScreen.preferenceCount) { - val pref = newScreen.getPreference(i) + // Reparent the preferences + while (newScreen.preferenceCount != 0) { + val pref = newScreen.getPreference(0) pref.preferenceDataStore = dataStore pref.order = Int.MAX_VALUE // reset to default order + + newScreen.removePreference(pref) screen.addPreference(pref) } } @@ -165,7 +167,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()?") @@ -174,8 +176,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..24c7c0a432 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,7 +4,7 @@ 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() { 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..14c976910d 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.extension 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 /** @@ -23,14 +25,14 @@ 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, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: ExtensionGroupHolder, position: Int, payloads: List?) { 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..7a0bd406a6 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.extension 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.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep @@ -29,14 +31,14 @@ 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, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: ExtensionHolder, position: Int, payloads: List?) { if (payloads == null || payloads.isEmpty()) { 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..f98de90a33 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 @@ -38,7 +38,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 f2969dbce2..6221ca00f3 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 @@ -110,7 +111,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() } @@ -201,7 +202,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 4f8c9451c0..a5eb2c3108 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 @@ -5,13 +5,14 @@ import android.content.Intent import android.content.res.Configuration import android.graphics.Color 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 androidx.core.view.GravityCompat import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType import com.f2prateek.rx.preferences.Preference @@ -353,7 +354,7 @@ class LibraryController( override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_filter -> { - navView?.let { activity?.drawer?.openDrawer(Gravity.END) } + navView?.let { activity?.drawer?.openDrawer(GravityCompat.END) } } R.id.action_update_library -> { activity?.let { LibraryUpdateService.start(it) } 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..0191e2b1bb 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 @@ -4,10 +4,12 @@ import android.view.Gravity import android.view.View import android.view.ViewGroup.LayoutParams.MATCH_PARENT import android.widget.FrameLayout +import androidx.recyclerview.widget.RecyclerView import com.f2prateek.rx.preferences.Preference import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.AbstractFlexibleItem import eu.davidea.flexibleadapter.items.IFilterable +import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.LibraryManga import eu.kanade.tachiyomi.data.preference.getOrDefault @@ -15,7 +17,7 @@ import eu.kanade.tachiyomi.widget.AutofitRecyclerView import kotlinx.android.synthetic.main.catalogue_grid_item.view.* 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,7 +43,7 @@ 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?) { @@ -70,4 +72,4 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference override fun hashCode(): Int { return manga.id!!.hashCode() } -} \ No newline at end of file +} 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 88433d5a6e..c8cfd26762 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 @@ -5,9 +5,9 @@ import android.app.SearchManager import android.content.Intent import android.graphics.Color import android.os.Bundle -import android.support.v4.view.GravityCompat -import android.support.v4.widget.DrawerLayout -import android.support.v7.graphics.drawable.DrawerArrowDrawable +import androidx.core.view.GravityCompat +import androidx.drawerlayout.widget.DrawerLayout +import androidx.appcompat.graphics.drawable.DrawerArrowDrawable import android.view.ViewGroup import com.bluelinelabs.conductor.* import eu.kanade.tachiyomi.Migrations 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..a4014beeda 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 @@ -103,4 +103,4 @@ class TabsAnimator(val tabs: TabLayout) { private val isMeasured: Boolean get() = tabsHeight > 0 -} \ No newline at end of file +} 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 ee8fd9d63c..2990d80ac4 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..34fb89ff21 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.manga.chapter 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.Chapter import eu.kanade.tachiyomi.data.database.models.Manga @@ -26,11 +28,11 @@ 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?) { @@ -50,4 +52,4 @@ class ChapterItem(val chapter: Chapter, val manga: Manga) : AbstractFlexibleItem return chapter.id!!.hashCode() } -} \ No newline at end of file +} 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 8397e0b414..7c5c07a21b 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 @@ -242,7 +242,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 0ff932bc48..8f12ed1646 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.drawable.Drawable import android.net.Uri import android.os.Build import android.os.Bundle -import android.support.customtabs.CustomTabsIntent -import android.support.v4.content.pm.ShortcutInfoCompat -import android.support.v4.content.pm.ShortcutManagerCompat -import android.support.v4.graphics.drawable.IconCompat +import androidx.browser.customtabs.CustomTabsIntent +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 @@ -291,14 +291,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 } @@ -315,7 +315,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..d1b05cfc88 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,6 +1,6 @@ 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 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 0acf3381d0..45fe58e8c5 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 @@ -139,4 +139,4 @@ class TrackController : NucleusController(), const val TAG_SEARCH_CONTROLLER = "track_search_controller" } -} \ No newline at end of file +} 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..3183c913b1 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.migration 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.Manga @@ -12,11 +14,11 @@ 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?) { @@ -34,4 +36,4 @@ class MangaItem(val manga: Manga) : AbstractFlexibleItem() { override fun hashCode(): Int { return manga.id!!.hashCode() } -} \ No newline at end of file +} 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 a72bcc8e5a..caa85fc2d5 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 @@ -91,7 +91,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) { @@ -106,7 +106,7 @@ class MigrationController : NucleusController(), } override fun onSelectClick(position: Int) { - onItemClick(position) + onItemClick(view!!, position) } fun migrateManga(prevManga: Manga, manga: Manga) { @@ -132,4 +132,4 @@ class MigrationController : NucleusController(), const val LOADING_DIALOG_TAG = "LoadingDialog" } -} \ No newline at end of file +} 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 d40028050b..9562b0cdb4 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.migration 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 import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import kotlinx.android.synthetic.main.catalogue_main_controller_card.title @@ -22,14 +24,14 @@ 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, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: Holder, position: Int, payloads: List?) { // Intentionally empty } 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..f154bc1f39 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.migration 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.Source @@ -25,17 +27,17 @@ 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, + override fun bindViewHolder(adapter: FlexibleAdapter>, holder: SourceHolder, position: Int, payloads: List?) { holder.bind(this) } -} \ No newline at end of file +} 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 7fa36a2a3e..a938039720 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/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 c429804eb8..1c4e94b47e 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 @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader import android.content.Context import android.graphics.Canvas -import android.support.v7.widget.AppCompatSeekBar +import androidx.appcompat.widget.AppCompatSeekBar import android.util.AttributeSet import android.view.MotionEvent 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 b798f3b49b..a7ee141855 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 4133c19c5f..4024abd8b7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.reader.viewer.pager import android.annotation.SuppressLint import android.graphics.Typeface -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..c2081f1e97 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 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..a8b91c15b7 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 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..4a5d101186 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 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..39e5b52164 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 /** 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..52600d0e20 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 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 3eb092f802..ed51718593 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 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..9ee399ace5 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 @@ -3,8 +3,10 @@ package eu.kanade.tachiyomi.ui.recent_updates import android.text.format.DateUtils import android.view.View import android.widget.TextView +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.R import java.util.* @@ -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: List?) { holder.bind(this) } @@ -45,4 +47,4 @@ class DateItem(val date: Date) : AbstractHeaderItem() { section_text.text = DateUtils.getRelativeTimeSpanString(item.date.time, now, DateUtils.DAY_IN_MILLIS) } } -} \ No newline at end of file +} 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..2f41ce4133 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.recent_updates 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.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga @@ -26,11 +28,11 @@ 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?) { @@ -50,4 +52,4 @@ class RecentChapterItem(val chapter: Chapter, val manga: Manga, header: DateItem return chapter.id!!.hashCode() } -} \ No newline at end of file +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt index 1b0fef7dbd..51f6c365b9 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 @@ -111,7 +111,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 c094c39fc0..840eb930b1 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 @@ -115,4 +115,4 @@ class RecentlyReadController : NucleusController(), } } -} \ No newline at end of file +} 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..e98e2dd5c2 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 @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.recently_read 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.MangaChapterHistory @@ -12,11 +14,11 @@ 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?) { @@ -34,4 +36,4 @@ class RecentlyReadItem(val mch: MangaChapterHistory) : AbstractFlexibleItem PreferenceGroup.initThenAdd(p: P, block: P.() -> Unit): P { - return p.apply { block(); addPreference(this); } + return p.apply { + block() + this.isIconSpaceReserved = false + addPreference(this) } } inline fun

PreferenceGroup.addThenInit(p: P, block: P.() -> Unit): P { - return p.apply { addPreference(this); block() } + return p.apply { + this.isIconSpaceReserved = false + addPreference(this) + block() } } inline fun Preference.onClick(crossinline block: () -> Unit) { 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 b6ff16dcae..2331dfea51 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 597cc4eef2..8ba0798fe8 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 21af01ca55..45f97eebba 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 @@ -84,4 +84,4 @@ abstract class SettingsController : PreferenceController() { fun Observable.subscribeUntilDestroy(onNext: (T) -> Unit): Subscription { return subscribe(onNext).also { untilDestroySubscriptions.add(it) } } -} \ No newline at end of file +} 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 6a06ec8ca3..e4531de8d6 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 ba3cc7a500..04c25d182c 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 @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.setting import android.app.Dialog import android.os.Bundle import android.os.Handler -import android.support.v7.preference.PreferenceScreen +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..65e98e8a30 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 @@ -58,4 +58,4 @@ class SettingsMainController : SettingsController() { private fun navigateTo(controller: SettingsController) { router.pushController(controller.withFadeTransaction()) } -} \ No newline at end of file +} 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 ae59d13f19..f6371c4af4 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..a7ace7c56b 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 @@ -115,4 +115,4 @@ class SettingsSourcesController : SettingsController(), return "source_$sourceId" } -} \ No newline at end of file +} 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..1bbbb49eef 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 @@ -45,7 +45,7 @@ class SettingsTrackingController : SettingsController(), .setToolbarColor(context.getResourceColor(R.attr.colorPrimary)) .build() tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY) - tabsIntent.launchUrl(activity, AnilistApi.authUrl()) + tabsIntent.launchUrl(activity!!, AnilistApi.authUrl()) } } trackPreference(trackManager.kitsu) { @@ -61,7 +61,7 @@ class SettingsTrackingController : SettingsController(), .setToolbarColor(context.getResourceColor(R.attr.colorPrimary)) .build() tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY) - tabsIntent.launchUrl(activity, ShikimoriApi.authUrl()) + tabsIntent.launchUrl(activity!!, ShikimoriApi.authUrl()) } } trackPreference(trackManager.bangumi) { @@ -70,7 +70,7 @@ class SettingsTrackingController : SettingsController(), .setToolbarColor(context.getResourceColor(R.attr.colorPrimary)) .build() tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY) - tabsIntent.launchUrl(activity, BangumiApi.authUrl()) + tabsIntent.launchUrl(activity!!, BangumiApi.authUrl()) } } } 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..42fb40430d 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 @@ -47,4 +47,4 @@ class ShikimoriLoginActivity : AppCompatActivity() { startActivity(intent) } -} \ No newline at end of file +} 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 ad3ec5c510..936f94760b 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 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 c735c0b8d7..4f0375e423 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 com.hippo.unifile.UniFile import java.io.File 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..2f07474a33 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 /** @@ -16,4 +16,4 @@ fun ImageView.setVectorCompat(@DrawableRes drawable: Int, tint: Int? = null) { vector?.setTint(tint) } setImageDrawable(vector) -} \ No newline at end of file +} 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..2dc39e1094 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()) -} \ No newline at end of file + return Jsoup.parse(html ?: body!!.string(), request.url.toString()) +} 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..7556f18df6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/OkioExtensions.kt @@ -1,7 +1,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 +32,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 af9b041e29..e13f11e6c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/ViewExtensions.kt @@ -5,7 +5,7 @@ package eu.kanade.tachiyomi.util import android.graphics.Color import android.graphics.Point import android.graphics.Typeface -import android.support.design.widget.Snackbar +import com.google.android.material.snackbar.Snackbar import android.view.View import android.widget.TextView import com.amulyakhare.textdrawable.TextDrawable @@ -28,7 +28,7 @@ fun View.getCoordinates() = Point((left + right) / 2, (top + bottom) / 2) */ inline fun View.snack(message: String, length: Int = Snackbar.LENGTH_LONG, f: Snackbar.() -> Unit): 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) snack.f() snack.show() 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..dbc694f520 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/AutofitRecyclerView.kt @@ -1,8 +1,8 @@ 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) : @@ -42,4 +42,4 @@ class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: Att } } -} \ No newline at end of file +} 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..53725afecb 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 @@ -30,4 +30,4 @@ class CustomLayoutFilePickerFragment : FilePickerFragment() { else -> return super.onCreateViewHolder(parent, viewType) } } -} \ No newline at end of file +} 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..4349e2c1af 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/DrawerSwipeCloseListener.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.widget -import android.support.v4.widget.DrawerLayout +import androidx.drawerlayout.widget.DrawerLayout import android.view.View import android.view.ViewGroup @@ -20,4 +20,4 @@ class DrawerSwipeCloseListener( drawer.setDrawerLockMode(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..32a959e663 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( @@ -45,4 +45,4 @@ class ElevationAppBarLayout @JvmOverloads constructor( } } -} \ No newline at end of file +} 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..db8c73ee23 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 @@ -236,4 +236,4 @@ open class ExtendedNavigationView @JvmOverloads constructor( } -} \ No newline at end of file +} 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..42babe98e5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt @@ -1,8 +1,8 @@ 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() { @@ -31,4 +31,4 @@ abstract class FABAnimationBase : FloatingActionButton.Behavior() { abstract fun animateOut(button: FloatingActionButton) abstract fun animateIn(button: FloatingActionButton) -} \ No newline at end of file +} 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..855515db6c 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 @@ -48,4 +48,4 @@ class FABAnimationUpDown @JvmOverloads constructor(ctx: Context, attrs: Attribut button.visibility = View.VISIBLE button.startAnimation(inAnimation) } -} \ No newline at end of file +} 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..e862c29f93 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt @@ -1,8 +1,8 @@ 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) { 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 31fcec901c..4c6055cdf5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleNavigationView.kt @@ -2,22 +2,22 @@ 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.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 import android.widget.* +import com.google.android.material.internal.ScrimInsetsFrameLayout 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, @@ -155,4 +155,4 @@ open class SimpleNavigationView @JvmOverloads constructor( const val VIEW_TYPE_LIST = 106 } -} \ No newline at end of file +} 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..e985a1f779 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/ViewPagerAdapter.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.widget -import android.support.v4.view.PagerAdapter +import androidx.viewpager.widget.PagerAdapter import android.view.View import android.view.ViewGroup 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..3e3000a003 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) : @@ -23,4 +23,4 @@ class IntListPreference @JvmOverloads constructor(context: Context, attrs: Attri defaultReturnValue } } -} \ No newline at end of file +} 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..5f35d7eb4e 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 @@ -54,4 +54,4 @@ class LoginCheckBoxPreference @JvmOverloads constructor( super.notifyChanged() } -} \ No newline at end of file +} 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..8e0181fa18 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 @@ -122,4 +122,4 @@ CompoundButton.OnCheckedChangeListener { defaultValue as Boolean) } -} \ No newline at end of file +} 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 bba645590f..2eed51af8a 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 @@ - - - - - @@ -255,10 +255,10 @@ 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 929ea22754..c2f7290ff9 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 + 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..4f9ab29f8e 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"> - android:paddingTop="4dp" android:clipToPadding="false" tools:listitem="@layout/catalogue_global_search_controller_card" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/catalogue_global_search_controller_card.xml b/app/src/main/res/layout/catalogue_global_search_controller_card.xml index c5f81880db..60c6ce4968 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller_card.xml +++ b/app/src/main/res/layout/catalogue_global_search_controller_card.xml @@ -1,5 +1,5 @@ - - - - - \ 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..9cfad6b96b 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 + diff --git a/app/src/main/res/layout/catalogue_grid_item.xml b/app/src/main/res/layout/catalogue_grid_item.xml index 4bde878c41..614a0bbd19 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"/> - - + - \ No newline at end of file + diff --git a/app/src/main/res/layout/catalogue_list_item.xml b/app/src/main/res/layout/catalogue_list_item.xml index b2b43a8260..b83795268a 100644 --- a/app/src/main/res/layout/catalogue_list_item.xml +++ b/app/src/main/res/layout/catalogue_list_item.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/layout/catalogue_main_controller.xml b/app/src/main/res/layout/catalogue_main_controller.xml index 84efdf4714..09128b2f2b 100644 --- a/app/src/main/res/layout/catalogue_main_controller.xml +++ b/app/src/main/res/layout/catalogue_main_controller.xml @@ -5,10 +5,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - \ No newline at end of file + diff --git a/app/src/main/res/layout/catalogue_main_controller_card_item.xml b/app/src/main/res/layout/catalogue_main_controller_card_item.xml index 14954bc501..071c89ad77 100644 --- a/app/src/main/res/layout/catalogue_main_controller_card_item.xml +++ b/app/src/main/res/layout/catalogue_main_controller_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/categories_controller.xml b/app/src/main/res/layout/categories_controller.xml index 9bc79a6c39..db67a00619 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 + diff --git a/app/src/main/res/layout/chapters_controller.xml b/app/src/main/res/layout/chapters_controller.xml index 2f2d19d566..0a0c3c7278 100644 --- a/app/src/main/res/layout/chapters_controller.xml +++ b/app/src/main/res/layout/chapters_controller.xml @@ -1,5 +1,5 @@ - - - - + - + - - \ 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"> - - - - - - - \ No newline at end of file + diff --git a/app/src/main/res/layout/extension_card_header.xml b/app/src/main/res/layout/extension_card_header.xml index 2c2e11fc91..1ed6c941c3 100644 --- a/app/src/main/res/layout/extension_card_header.xml +++ b/app/src/main/res/layout/extension_card_header.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - @@ -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 8f4bb3d527..2c7d09d2be 100644 --- a/app/src/main/res/layout/extension_controller.xml +++ b/app/src/main/res/layout/extension_controller.xml @@ -1,15 +1,15 @@ - - - \ 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 a22c526969..0713e670d4 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 + diff --git a/app/src/main/res/layout/library_category.xml b/app/src/main/res/layout/library_category.xml index df6b7ce5ac..d7476939f7 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 bb0806f088..1f9ac99e22 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..7ea422782e 100644 --- a/app/src/main/res/layout/manga_controller.xml +++ b/app/src/main/res/layout/manga_controller.xml @@ -1,6 +1,6 @@ - \ No newline at end of file + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml index fe78d31821..eeb03a594b 100644 --- a/app/src/main/res/layout/manga_info_controller.xml +++ b/app/src/main/res/layout/manga_info_controller.xml @@ -1,5 +1,5 @@ - - - - - - @@ -237,9 +237,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 643832cd0a..9c75a0230b 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 3155bc15cb..496563ebfb 100644 --- a/app/src/main/res/layout/reader_color_filter_sheet.xml +++ b/app/src/main/res/layout/reader_color_filter_sheet.xml @@ -9,7 +9,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 d28155d704..f18cc12c98 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 6dcca143ed..51e9abaf6b 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 + diff --git a/app/src/main/res/layout/recent_chapters_item.xml b/app/src/main/res/layout/recent_chapters_item.xml index 2bf1b92d87..c8d275dbba 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 + diff --git a/app/src/main/res/layout/recently_read_controller.xml b/app/src/main/res/layout/recently_read_controller.xml index e0f4da99b1..5f0c27f271 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"> - - + - \ No newline at end of file + diff --git a/app/src/main/res/layout/recently_read_item.xml b/app/src/main/res/layout/recently_read_item.xml index 1543147877..08eb39ea3c 100644 --- a/app/src/main/res/layout/recently_read_item.xml +++ b/app/src/main/res/layout/recently_read_item.xml @@ -1,5 +1,5 @@ - @@ -69,4 +69,4 @@ android:text="@string/action_resume"/> - \ 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..327dbeb873 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..27cc0d5eae 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 + 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/Theme.ActionBar.Light - @style/PreferenceThemeOverlay.Material + @style/PreferenceThemeOverlay.v14.Material @style/Theme.AlertDialog.Light @@ -65,7 +65,7 @@ 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/gradle.properties b/gradle.properties index 1d3591c8a4..48da317bc0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,8 @@ # 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 + +# AndroidX support +android.enableJetifier=true +android.useAndroidX=true