From 68df2f4ce75f280b53109af2609d06732379df44 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 4 Jul 2020 14:36:56 -0400 Subject: [PATCH] Point to GitHub releases for stable changelogs --- app/build.gradle | 3 - .../java/eu/kanade/tachiyomi/Migrations.kt | 2 +- .../ui/main/ChangelogDialogController.kt | 31 ---- .../kanade/tachiyomi/ui/main/MainActivity.kt | 24 +++- .../tachiyomi/ui/more/AboutController.kt | 13 +- .../res/layout/changelog_header_layout.xml | 25 ---- .../main/res/layout/changelog_row_layout.xml | 35 ----- app/src/main/res/raw/changelog_release.xml | 136 ------------------ app/src/main/res/values/strings.xml | 3 +- 9 files changed, 31 insertions(+), 241 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogController.kt delete mode 100644 app/src/main/res/layout/changelog_header_layout.xml delete mode 100644 app/src/main/res/layout/changelog_row_layout.xml delete mode 100644 app/src/main/res/raw/changelog_release.xml diff --git a/app/build.gradle b/app/build.gradle index 09e0f23974..5e1425fa06 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -192,9 +192,6 @@ dependencies { // HTML parser implementation 'org.jsoup:jsoup:1.13.1' - // Changelog - implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' - // Database implementation 'androidx.sqlite:sqlite:2.1.0' implementation 'com.github.inorichi.storio:storio-common:8be19de@aar' diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 2fdeeac235..3b748d77a2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -89,7 +89,7 @@ object Migrations { preferences.librarySortingMode().set(LibrarySort.ALPHA) } } - return !BuildConfig.DEBUG + return true } return false } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogController.kt deleted file mode 100644 index 69dd800987..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogController.kt +++ /dev/null @@ -1,31 +0,0 @@ -package eu.kanade.tachiyomi.ui.main - -import android.app.Dialog -import android.content.Context -import android.os.Bundle -import android.util.AttributeSet -import com.afollestad.materialdialogs.MaterialDialog -import com.afollestad.materialdialogs.customview.customView -import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.ui.base.controller.DialogController -import it.gmariotti.changelibs.library.view.ChangeLogRecyclerView - -class ChangelogDialogController : DialogController() { - - override fun onCreateDialog(savedViewState: Bundle?): Dialog { - val activity = activity!! - val view = WhatsNewRecyclerView(activity) - return MaterialDialog(activity) - .title(R.string.changelog) - .customView(view = view) - .positiveButton(R.string.action_close) - } - - class WhatsNewRecyclerView(context: Context) : ChangeLogRecyclerView(context) { - override fun initAttrs(attrs: AttributeSet?, defStyle: Int) { - mRowLayoutId = R.layout.changelog_row_layout - mRowHeaderLayoutId = R.layout.changelog_header_layout - mChangeLogFileResourceId = R.raw.changelog_release - } - } -} 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 37e91bfd5c..8756de8f77 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 @@ -3,7 +3,9 @@ package eu.kanade.tachiyomi.ui.main import android.app.Activity import android.app.SearchManager import android.content.Intent +import android.net.Uri import android.os.Bundle +import android.view.Gravity import android.view.View import android.view.ViewGroup import android.widget.Toast @@ -15,7 +17,9 @@ import com.bluelinelabs.conductor.Router import com.bluelinelabs.conductor.RouterTransaction import com.google.android.material.appbar.AppBarLayout import com.google.android.material.behavior.HideBottomViewOnScrollBehavior +import com.google.android.material.snackbar.Snackbar import com.google.android.material.tabs.TabLayout +import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.Migrations import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationReceiver @@ -38,6 +42,7 @@ import eu.kanade.tachiyomi.ui.recent.updates.UpdatesController import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.lang.launchUI import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.view.snack import java.util.Date import java.util.concurrent.TimeUnit import kotlinx.coroutines.delay @@ -144,9 +149,22 @@ class MainActivity : BaseActivity() { syncActivityViewWithController(router.backstack.lastOrNull()?.controller()) if (savedInstanceState == null) { - // Show changelog if needed - if (Migrations.upgrade(preferences)) { - ChangelogDialogController().showDialog(router) + // Show changelog prompt on update + if (Migrations.upgrade(preferences) && !BuildConfig.DEBUG) { + binding.controllerContainer.snack(getString(R.string.updated_version, BuildConfig.VERSION_NAME), Snackbar.LENGTH_INDEFINITE) { + setAction(R.string.whats_new) { + val url = "https://github.com/inorichi/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}" + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + startActivity(intent) + } + + // Ensure the snackbar sits above the bottom nav + val layoutParams = view.layoutParams as CoordinatorLayout.LayoutParams + layoutParams.anchorId = binding.bottomNav.id + layoutParams.anchorGravity = Gravity.TOP + layoutParams.gravity = Gravity.TOP + view.layoutParams = layoutParams + } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt index e5b6b96279..cd3382c45a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/AboutController.kt @@ -14,7 +14,6 @@ import eu.kanade.tachiyomi.data.updater.UpdateChecker import eu.kanade.tachiyomi.data.updater.UpdateResult import eu.kanade.tachiyomi.data.updater.UpdaterService import eu.kanade.tachiyomi.ui.base.controller.DialogController -import eu.kanade.tachiyomi.ui.main.ChangelogDialogController import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.util.lang.launchNow import eu.kanade.tachiyomi.util.lang.toDateTimestampString @@ -67,15 +66,17 @@ class AboutController : SettingsController() { } } preference { - titleRes = R.string.changelog + titleRes = R.string.whats_new onClick { - if (BuildConfig.DEBUG) { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/inorichi/tachiyomi/commits/dev")) - startActivity(intent) + val url = if (BuildConfig.DEBUG) { + "https://github.com/inorichi/tachiyomi/commits/dev" } else { - ChangelogDialogController().showDialog(router) + "https://github.com/inorichi/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}" } + + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + startActivity(intent) } } if (BuildConfig.DEBUG) { diff --git a/app/src/main/res/layout/changelog_header_layout.xml b/app/src/main/res/layout/changelog_header_layout.xml deleted file mode 100644 index 92942f1bce..0000000000 --- a/app/src/main/res/layout/changelog_header_layout.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/layout/changelog_row_layout.xml b/app/src/main/res/layout/changelog_row_layout.xml deleted file mode 100644 index 589fd1eb9c..0000000000 --- a/app/src/main/res/layout/changelog_row_layout.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/raw/changelog_release.xml b/app/src/main/res/raw/changelog_release.xml deleted file mode 100644 index c19a8e8a8c..0000000000 --- a/app/src/main/res/raw/changelog_release.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - Mostly minor fixes on top of v0.9.0 / v0.9.1. - Fix: backup failing when a source isn't installed - Fix: local manga page sorting - Fix: 32-bit color setting not showing up in reader settings (Android 8+) - Enhancement: collapse top and bottom toolbars on scroll - - - - Mostly minor fixes on top of v0.9.0. - Fix: sources tab not updating after installing an extension - Fix: disabled Proguard, which was causing issues with some extensions (e.g. Komga) - Fix: inverted selection in chapters list re-inverting after performing an action - Fix: manga info being cut off on smaller screens - Enhancement: removed notification sound when backup or restore is complete - Enhancement: move start/pause button in download queue to a Floating Action Button - Enhancement: remove extra confirmation step for passive biometric unlock (e.g. iris scan or face unlock) - New: Gray reader background - - - - This is a huge release! Please see [a href="https://github.com/inorichi/tachiyomi/releases/tag/v0.9.0"]the changelog on GitHub[/a]. - - - - [b]Future releases will only support Android 5+[/b] - New: open in browser/webview from catalogue - New: reader color filter blend modes - New: link to help website in sidebar - New: long press bookmark icon in manga info to change categories - New: update prioritization setting - New: Bangumi tracker - New: extension search - New: see changelog by pressing Settings > About > Build time - Enhancement: ignore case when sorting library - Enhancement: available extensions grouped by languages - Enhancement: webview navigation - Enhancement: improved loading speed when skipping pages in a chapter - Fix: Cloudflare issues - Fix: sharing issues when filename is long - Fix: handle errors during global search - Fix: looping GIFs now loop - Fix: .nomedia files generated to avoid pages appearing in gallery apps - Fix: download queue won't autostart if it was previously paused - Fix: remove DOWNLOADED text after marking chapter as read (if setting is enabled) - Fix: backup dialog showing "null" when saving to cloud storage - Fix: MAL and Shikimori tracker issues - - - - All the internal sources have been removed. They now need to be - installed as an extension. - Cloudflare is now resolved with a WebView in background which should put - an end to the recent updates to adapt to their changes. - Added an option to open manga details in a WebView. This - should also help when receiving a captcha confirmation page (usually 403 errors). - It can also be used to login with the website, as the app now shares cookies. - Added a deep link handler that extensions can use to perform - a search within the app. - Added an option to decode images in ARGB8888 format for - devices running Oreo or later. - Added Shikimori tracker. - Updated translations. - - - - Updated Cloudflare. - Fixed crashes with some translations. - - - - Fixed latest Cloudflare changes. - Bundled SQLite for better performance and new features. - Restored dark blue theme. - Added a MAL API workaround. - Fixed search issues on Kitsu and AniList. - Fixed an issue where the image was centered when using the vertical reader. - Updated translations. - - - - Added a new reader with many fixes. - Added GIF support. - Fixed loading errors with local compressed files. - Fixed an issue where images couldn't be shared. - Removed image decoders setting because it's not needed anymore. - Updated translations. - Show all entries in library even if their extensions are not installed - Fixed search issues on Kitsu and AniList. - Other minor bugfixes. - - - - Updated Anilist's API to v2. - Added Github link to about. - Fixed indonesian language not working. - Fixed an issue on KitKat that crashed the app when scheduling updates. - Fixed a few more issues introduced on the previous release. - - - - Fixed the tracking search layout when there are many results. - Separate english language into american and british so that dates are formatted according to that locale. - Added Firebase analytics, for Android API distribution. - Crop borders for webtoons now has a separate setting. - The downloader now runs in a foreground service to prevent it from being killed. - Fixed a few weird crashes. - - - - Fixed missing downloaded label in chapters screen. - Fixed updater in KitKat and lower due to TLS. - - - - Updated Cloudflare bypass. - Enabled TLS 1.1 and TLS 1.2 on Android KitKat and lower. - Minor UI changes. - - - - Added extensions support. You can now install and update extensions within the app. - If you installed any extension previously through F-Droid, you'll have to uninstall them first. - Added a custom download option to download N chapters. - Updated manga info layout, with clickable components to copy to clipboard or perform a global search. - Added an option to change the animation speed of a double tap in the reader. - Improved tracking results UI with covers. - Dropped support for simultaneous downloads. - Batoto is now a legacy source, you can only use it to migrate. - Updated dark theme and reader theme. - Bugfixes and minor UI/UX improvements. - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9804f75752..ed089c10f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -390,10 +390,11 @@ Website Version Build time - Changelog + What\'s new Preview build notices Open source licenses Check for updates + Updated to v%1$s Send crash reports