Skip to content

Commit

Permalink
Also show a toast on error notification
Browse files Browse the repository at this point in the history
since the notification is silent, also show a toast, otherwise the user is confused
  • Loading branch information
Stypox committed Dec 4, 2021
1 parent c000c1d commit 950956e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/org/schabi/newpipe/error/ErrorUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.view.View
import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
Expand Down Expand Up @@ -87,6 +88,10 @@ class ErrorUtil {
)

notificationManager!!.notify(ERROR_REPORT_NOTIFICATION_ID, notificationBuilder.build())

// since the notification is silent, also show a toast, otherwise the user is confused
Toast.makeText(context, R.string.error_report_notification_toast, Toast.LENGTH_SHORT)
.show()
}

private fun getErrorActivityIntent(context: Context, errorInfo: ErrorInfo): Intent {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
<string name="permission_display_over_apps">Give permission to display over other apps</string>
<!-- error activity -->
<string name="error_report_notification_title">NewPipe encountered an error, tap to report</string>
<string name="error_report_notification_toast">An error occurred, see the notification</string>
<string name="sorry_string">Sorry, that should not have happened.</string>
<string name="guru_meditation" translatable="false">Guru Meditation.</string>
<string name="error_report_button_text">Report this error via e-mail</string>
Expand Down

0 comments on commit 950956e

Please sign in to comment.