Update the glance section

This commit is contained in:
Tommaso Berlose
2020-10-13 16:55:42 +02:00
parent abafe108c6
commit 0a0c5a90a7
60 changed files with 665 additions and 709 deletions

View File

@ -9,15 +9,17 @@ import android.service.notification.NotificationListenerService
import android.service.notification.StatusBarNotification
import android.util.Log
import com.chibatching.kotpref.bulk
import com.google.gson.Gson
import com.tommasoberlose.anotherwidget.global.Preferences
import com.tommasoberlose.anotherwidget.helpers.MediaPlayerHelper
import com.tommasoberlose.anotherwidget.helpers.WidgetHelper
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
class MusicNotificationListener : NotificationListenerService() {
class NotificationListener : NotificationListenerService() {
override fun onListenerConnected() {
MediaPlayerHelper.updatePlayingMediaInfo(this)
MainWidget.updateWidget(this)
super.onListenerConnected()
}
@ -27,11 +29,17 @@ class MusicNotificationListener : NotificationListenerService() {
MediaPlayerHelper.updatePlayingMediaInfo(this)
}
}
Log.d("ciao", Gson().toJson(sbn?.notification?.smallIcon))
Log.d("ciao", Gson().toJson(sbn?.notification?.contentIntent))
Log.d("ciao", Gson().toJson(sbn?.notification))
MainWidget.updateWidget(this)
super.onNotificationPosted(sbn)
}
override fun onNotificationRemoved(sbn: StatusBarNotification?) {
MediaPlayerHelper.updatePlayingMediaInfo(this)
MainWidget.updateWidget(this)
super.onNotificationRemoved(sbn)
}
}