mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Add support for mystery items notifications
This commit is contained in:
parent
2cf3e29f4d
commit
81516734f5
8 changed files with 12 additions and 1 deletions
BIN
Habitica/res/drawable-hdpi/notification_mystery_item.webp
Normal file
BIN
Habitica/res/drawable-hdpi/notification_mystery_item.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 956 B |
BIN
Habitica/res/drawable-mdpi/notification_mystery_item.webp
Normal file
BIN
Habitica/res/drawable-mdpi/notification_mystery_item.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 174 B |
BIN
Habitica/res/drawable-xhdpi/notification_mystery_item.webp
Normal file
BIN
Habitica/res/drawable-xhdpi/notification_mystery_item.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Habitica/res/drawable-xxhdpi/notification_mystery_item.webp
Normal file
BIN
Habitica/res/drawable-xxhdpi/notification_mystery_item.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -867,6 +867,7 @@
|
|||
<string name="new_msg_guild"><![CDATA[<b>%1$s</b> has new posts]]></string>
|
||||
<string name="new_msg_party"><![CDATA[Your Party, <b>%1$s</b>, has new posts]]></string>
|
||||
<string name="unallocated_stats_points"><![CDATA[You have <b>%1$s unallocated Stat Points</b>]]></string>
|
||||
<string name="new_subscriber_item"><![CDATA[You have new <b>Mystery Items</b>]]></string>
|
||||
<string name="create">Create</string>
|
||||
<string name="only_leader_create_challenge">Only leader can create Challenges</string>
|
||||
<string name="create_party">Create Party</string>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.lang.reflect.Type
|
|||
enum class NotificationType(val type: String) {
|
||||
NEW_STUFF("NEW_STUFF"),
|
||||
NEW_CHAT_MESSAGE("NEW_CHAT_MESSAGE"),
|
||||
NEW_MYSTERY_ITEMS("NEW_MYSTERY_ITEMS"),
|
||||
UNALLOCATED_STATS_POINTS("UNALLOCATED_STATS_POINTS");
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class NotificationsActivity : BaseActivity(), androidx.swiperefreshlayout.widget
|
|||
NotificationType.NEW_CHAT_MESSAGE.type -> createNewChatMessageNotification(it)
|
||||
NotificationType.NEW_STUFF.type -> createNewStuffNotification(it)
|
||||
NotificationType.UNALLOCATED_STATS_POINTS.type -> createUnallocatedStatsNotification(it)
|
||||
NotificationType.NEW_MYSTERY_ITEMS.type -> createMysteryItemsNotification(it)
|
||||
//TODO rest of the notification types
|
||||
else -> null
|
||||
}
|
||||
|
|
@ -143,6 +144,14 @@ class NotificationsActivity : BaseActivity(), androidx.swiperefreshlayout.widget
|
|||
)
|
||||
}
|
||||
|
||||
private fun createMysteryItemsNotification(notification: GlobalNotification): View? {
|
||||
return createNotificationItem(
|
||||
notification,
|
||||
fromHtml(getString(R.string.new_subscriber_item)),
|
||||
R.drawable.notification_mystery_item
|
||||
)
|
||||
}
|
||||
|
||||
private fun createNotificationItem(notification: GlobalNotification, messageText: CharSequence, imageResourceId: Int? = null): View? {
|
||||
val item = inflater.inflate(R.layout.notification_item, notification_items, false)
|
||||
|
||||
|
|
|
|||
|
|
@ -61,4 +61,4 @@ open class NotificationsViewModel : BaseViewModel() {
|
|||
//TODO("not implemented")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue