Make tapping library update and backup restore error notifications open log

This commit is contained in:
arkon 2021-10-18 09:49:58 -04:00
parent 3800065230
commit 9352e249ee
3 changed files with 6 additions and 17 deletions

View File

@ -139,10 +139,12 @@ class BackupNotifier(private val context: Context) {
val destFile = File(path, file) val destFile = File(path, file)
val uri = destFile.getUriCompat(context) val uri = destFile.getUriCompat(context)
val errorLogIntent = NotificationReceiver.openErrorLogPendingActivity(context, uri)
setContentIntent(errorLogIntent)
addAction( addAction(
R.drawable.ic_folder_24dp, R.drawable.ic_folder_24dp,
context.getString(R.string.action_show_errors), context.getString(R.string.action_show_errors),
NotificationReceiver.openErrorLogPendingActivity(context, uri) errorLogIntent,
) )
} }

View File

@ -117,23 +117,10 @@ class LibraryUpdateNotifier(private val context: Context) {
Notifications.ID_LIBRARY_ERROR, Notifications.ID_LIBRARY_ERROR,
context.notificationBuilder(Notifications.CHANNEL_LIBRARY_ERROR) { context.notificationBuilder(Notifications.CHANNEL_LIBRARY_ERROR) {
setContentTitle(context.resources.getQuantityString(R.plurals.notification_update_error, errors.size, errors.size)) setContentTitle(context.resources.getQuantityString(R.plurals.notification_update_error, errors.size, errors.size))
setStyle( setContentText(context.getString(R.string.action_show_errors))
NotificationCompat.BigTextStyle().bigText(
errors.joinToString("\n") {
it.chop(NOTIF_TITLE_MAX_LEN)
}
)
)
setSmallIcon(R.drawable.ic_tachi) setSmallIcon(R.drawable.ic_tachi)
val errorLogIntent = NotificationReceiver.openErrorLogPendingActivity(context, uri) setContentIntent(NotificationReceiver.openErrorLogPendingActivity(context, uri))
setContentIntent(errorLogIntent)
addAction(
R.drawable.ic_folder_24dp,
context.getString(R.string.action_show_errors),
errorLogIntent
)
} }
.build() .build()
) )

View File

@ -119,7 +119,7 @@
<string name="action_reset">Reset</string> <string name="action_reset">Reset</string>
<string name="action_undo">Undo</string> <string name="action_undo">Undo</string>
<string name="action_open_log">Open log</string> <string name="action_open_log">Open log</string>
<string name="action_show_errors">Show errors</string> <string name="action_show_errors">See full error details</string>
<string name="action_create">Create</string> <string name="action_create">Create</string>
<string name="action_restore">Restore</string> <string name="action_restore">Restore</string>
<string name="action_webview_back">Back</string> <string name="action_webview_back">Back</string>