mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-08 20:12:39 +01:00
Ignore ioobe for NotificationWidget, resolves #1520
This commit is contained in:
parent
86df98094d
commit
65d527155e
@ -180,17 +180,21 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) :
|
||||
|
||||
override fun getViewAt(position: Int): RemoteViews {
|
||||
val views = RemoteViews(context.packageName, R.layout.widget_notification_item)
|
||||
val notif = content[position]
|
||||
views.setBackgroundColor(R.id.item_frame, Prefs.nativeBgColor(notif.unread))
|
||||
views.setTextColor(R.id.item_content, Prefs.textColor)
|
||||
views.setTextViewText(R.id.item_content, notif.text)
|
||||
views.setTextColor(R.id.item_date, Prefs.textColor.withAlpha(150))
|
||||
views.setTextViewText(R.id.item_date, notif.timestamp.toReadableTime(context))
|
||||
try {
|
||||
val notif = content[position]
|
||||
views.setBackgroundColor(R.id.item_frame, Prefs.nativeBgColor(notif.unread))
|
||||
views.setTextColor(R.id.item_content, Prefs.textColor)
|
||||
views.setTextViewText(R.id.item_content, notif.text)
|
||||
views.setTextColor(R.id.item_date, Prefs.textColor.withAlpha(150))
|
||||
views.setTextViewText(R.id.item_date, notif.timestamp.toReadableTime(context))
|
||||
|
||||
val avatar = glide.load(notif.profileUrl).transform(FrostGlide.circleCrop)
|
||||
.submit(avatarSize, avatarSize).get()
|
||||
views.setImageViewBitmap(R.id.item_avatar, avatar)
|
||||
views.setOnClickFillInIntent(R.id.item_frame, type.putContentExtra(Intent(), notif))
|
||||
val avatar = glide.load(notif.profileUrl).transform(FrostGlide.circleCrop)
|
||||
.submit(avatarSize, avatarSize).get()
|
||||
views.setImageViewBitmap(R.id.item_avatar, avatar)
|
||||
views.setOnClickFillInIntent(R.id.item_frame, type.putContentExtra(Intent(), notif))
|
||||
} catch (_: IndexOutOfBoundsException) {
|
||||
// Ignored; seems like an Android bug
|
||||
}
|
||||
return views
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user