From ff8e3f0af492480fadf1d99d0ee63df335951885 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 26 Dec 2019 16:01:16 -0500 Subject: [PATCH] Update to SDK 28 (#2394) --- .travis.yml | 4 ++-- app/build.gradle | 6 +++--- app/src/main/AndroidManifest.xml | 1 + .../catalogue/browse/BrowseCatalogueController.kt | 2 +- .../kanade/tachiyomi/ui/manga/MangaController.kt | 4 +--- .../reader/viewer/webtoon/WebtoonRecyclerView.kt | 4 ++-- .../ui/reader/viewer/webtoon/WebtoonViewer.kt | 14 ++++++++------ .../ui/setting/SettingsAboutController.kt | 4 ++-- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf00017ca9..edfc5a7c0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: android android: components: - build-tools-29.0.2 - - android-27 + - android-28 - extra-android-m2repository - extra-google-m2repository - extra-android-support @@ -11,7 +11,7 @@ android: licenses: - android-sdk-license-.+ before_install: -- yes | sdkmanager "platforms;android-27" # workaround for accepting the license +- yes | sdkmanager "platforms;android-28" # workaround for accepting the license - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_e56be693d4fd_key -iv $encrypted_e56be693d4fd_iv -in "$PWD/.travis/secrets.tar.enc" -out secrets.tar -d; tar xf secrets.tar; diff --git a/app/build.gradle b/app/build.gradle index 9931564efb..7f5e0f6e8a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,14 +29,14 @@ ext { } android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion '29.0.2' publishNonDefault true defaultConfig { applicationId "eu.kanade.tachiyomi" minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" versionCode 41 versionName "0.8.4" @@ -100,7 +100,7 @@ dependencies { implementation 'com.github.inorichi:junrar-android:634c1f5' // Android support library - final support_library_version = '27.1.1' + 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" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e13d89ba7c..7d2b6144b5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,7 @@ + 0 && lastVisibleItemPosition == totalItemCount - 1 atFirstPosition = firstVisibleItemPosition == 0 } 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 6adee83c2f..3eb092f802 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 @@ -67,7 +67,7 @@ class WebtoonViewer(val activity: ReaderActivity) : BaseViewer { recycler.layoutManager = layoutManager recycler.adapter = adapter recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { - override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) { + override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { val position = layoutManager.findLastEndVisibleItemPosition() val item = adapter.items.getOrNull(position) if (item != null && currentPage != item) { @@ -98,11 +98,13 @@ class WebtoonViewer(val activity: ReaderActivity) : BaseViewer { recycler.longTapListener = f@ { event -> if (activity.menuVisible || config.longTapEnabled) { val child = recycler.findChildViewUnder(event.x, event.y) - val position = recycler.getChildAdapterPosition(child) - val item = adapter.items.getOrNull(position) - if (item is ReaderPage) { - activity.onPageLongTap(item) - return@f true + if (child != null) { + val position = recycler.getChildAdapterPosition(child) + val item = adapter.items.getOrNull(position) + if (item is ReaderPage) { + activity.onPageLongTap(item) + return@f true + } } } false 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 bbd23da2cf..b6ff16dcae 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 @@ -150,14 +150,14 @@ class SettingsAboutController : SettingsController() { override fun onCreateDialog(savedViewState: Bundle?): Dialog { return MaterialDialog.Builder(activity!!) .title(R.string.update_check_title) - .content(args.getString(BODY_KEY)) + .content(args.getString(BODY_KEY) ?: "") .positiveText(R.string.update_check_confirm) .negativeText(R.string.update_check_ignore) .onPositive { _, _ -> val appContext = applicationContext if (appContext != null) { // Start download - val url = args.getString(URL_KEY) + val url = args.getString(URL_KEY) ?: "" UpdaterService.downloadUpdate(appContext, url) } }