1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Added some lines to improve code-readability

This commit is contained in:
litetex 2021-11-02 23:36:46 +01:00
parent 94219b78e7
commit f0112a2de2

View File

@ -69,6 +69,8 @@ class NotificationHelper(val context: Context) {
.setColorized(true) .setColorized(true)
.setAutoCancel(true) .setAutoCancel(true)
.setCategory(NotificationCompat.CATEGORY_SOCIAL) .setCategory(NotificationCompat.CATEGORY_SOCIAL)
// Build style
val style = NotificationCompat.InboxStyle() val style = NotificationCompat.InboxStyle()
for (stream in newStreams) { for (stream in newStreams) {
style.addLine(stream.name) style.addLine(stream.name)
@ -76,6 +78,7 @@ class NotificationHelper(val context: Context) {
style.setSummaryText(summary) style.setSummaryText(summary)
style.setBigContentTitle(data.name) style.setBigContentTitle(data.name)
builder.setStyle(style) builder.setStyle(style)
// open the channel page when clicking on the notification // open the channel page when clicking on the notification
builder.setContentIntent( builder.setContentIntent(
PendingIntent.getActivity( PendingIntent.getActivity(
@ -87,6 +90,7 @@ class NotificationHelper(val context: Context) {
0 0
) )
) )
return Single.create(NotificationIcon(context, data.avatarUrl)) return Single.create(NotificationIcon(context, data.avatarUrl))
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())