Update the glance section
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user