mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-21 21:29:00 +00:00
Merge pull request #1902 from Hafizzle/Fiz/mystery_item_fixes
Mystery Item Sprite fixes
This commit is contained in:
commit
062303de1e
2 changed files with 6 additions and 2 deletions
|
|
@ -181,6 +181,10 @@ class ItemRecyclerAdapter(val context: Context) : BaseRecyclerViewAdapter<OwnedI
|
|||
if ((ownedItem?.numberOwned ?: 0) > 0) {
|
||||
menu.addMenuItem(BottomSheetMenuItem(resources.getString(R.string.use_item)))
|
||||
}
|
||||
} else if (ownedItem?.itemType == "special") {
|
||||
if ((ownedItem?.numberOwned ?: 0) > 0) {
|
||||
menu.addMenuItem(BottomSheetMenuItem(resources.getString(R.string.use_item)))
|
||||
}
|
||||
}
|
||||
menu.setSelectionRunnable { index ->
|
||||
item?.let { selectedItem ->
|
||||
|
|
|
|||
|
|
@ -160,12 +160,12 @@ class ItemRecyclerFragment : BaseFragment<FragmentItemsBinding>(), SwipeRefreshL
|
|||
val dialog = OpenedMysteryitemDialog(activity)
|
||||
dialog.isCelebratory = true
|
||||
dialog.setTitle(R.string.mystery_item_title)
|
||||
dialog.binding.iconView.loadImage("shop_${it.key}")
|
||||
dialog.binding.iconView.loadImage("shop_${item.key}")
|
||||
dialog.binding.titleView.text = item.text
|
||||
dialog.binding.descriptionView.text = item.notes
|
||||
dialog.addButton(R.string.equip, true) { _, _ ->
|
||||
lifecycleScope.launchCatching {
|
||||
inventoryRepository.equip("equipped", it.key)
|
||||
item.key?.let { mysteryItem -> inventoryRepository.equip("equipped", mysteryItem) }
|
||||
}
|
||||
}
|
||||
dialog.addCloseButton()
|
||||
|
|
|
|||
Loading…
Reference in a new issue