From a20874f6a15f443025367f6ed988ff93a30ccd6c Mon Sep 17 00:00:00 2001 From: MCAxiaz Date: Fri, 8 May 2020 18:44:01 -0700 Subject: [PATCH] String Formatting Fixes (#3118) String Formatting Fixes --- .../eu/kanade/tachiyomi/data/download/DownloadNotifier.kt | 5 +++-- .../eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt | 5 +++-- .../kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) 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 9a5714422..85769b45d 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 @@ -94,8 +94,9 @@ internal class DownloadNotifier(private val context: Context) { ) } - val downloadingProgressText = context.getString(R.string.chapter_downloading_progress) - .format(download.downloadedImages, download.pages!!.size) + val downloadingProgressText = context.getString( + R.string.chapter_downloading_progress, download.downloadedImages, download.pages!!.size + ) if (preferences.hideNotificationContent()) { setContentTitle(downloadingProgressText) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt index eb922988a..ed7b76eee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/history/HistoryHolder.kt @@ -58,8 +58,9 @@ class HistoryHolder( // Set chapter number + timestamp val formattedNumber = adapter.decimalFormat.format(chapter.chapter_number.toDouble()) - manga_subtitle.text = itemView.context.getString(R.string.recent_manga_time) - .format(formattedNumber, Date(history.last_read).toTimestampString()) + manga_subtitle.text = itemView.context.getString( + R.string.recent_manga_time, formattedNumber, Date(history.last_read).toTimestampString() + ) // Set cover GlideApp.with(itemView.context).clear(cover) diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt index 740a3681b..f4bf873f3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/TrackLogoutDialog.kt @@ -19,7 +19,7 @@ class TrackLogoutDialog(bundle: Bundle? = null) : DialogController(bundle) { override fun onCreateDialog(savedViewState: Bundle?): Dialog { return MaterialDialog(activity!!) - .title(R.string.logout_title, service.name) + .title(text = activity!!.getString(R.string.logout_title, service.name)) .positiveButton(R.string.logout) { service.logout() (targetController as? Listener)?.trackLogoutDialogClosed(service)