Created
August 27, 2020 20:26
-
-
Save lelandrichardson/e41c3a99e8b9566aaa0853e3c0912ecb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun updateCount(count: Int) { | |
if (count > 0 && !hasBadge()) { | |
addBadge() | |
} else if (count == 0 && hasBadge()) { | |
removeBadge() | |
} | |
if (count > 99 && !hasFire()) { | |
addFire() | |
setBadgeText("99+") | |
} else if (count <= 99 && hasFire()) { | |
removeFire() | |
} | |
if (count > 0 && !hasPaper()) { | |
addPaper() | |
} else if (count == 0 && hasPaper()) { | |
removePaper() | |
} | |
if (count <= 99) { | |
setBadgeText("$count") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment