Skip to content

Commit

Permalink
UI: Add festival emojis and dates for loading screen (#561)
Browse files Browse the repository at this point in the history
### TL;DR
Added support for additional festivals and their corresponding emojis in the loading screen.

### What changed?
- Added new festival types including Australia Day, Rose Day, Propose Day, and various Valentine's week celebrations
- Expanded festival emoji mappings with culturally diverse celebrations like Holi, Eid, Mardi Gras, and Vivid Sydney
- Updated Christmas emojis with additional seasonal icons
- Added date mappings for new festivals, including multi-day events like Mardi Gras 2025
- Added TODO comments for future improvements regarding date range handling and remote configuration

### How to test?
1. Change system date to match different festival dates
2. Verify appropriate festival emojis appear on loading screens
3. Key dates to test:
   - Valentine's week (Feb 7-14)
   - Mardi Gras (Feb 15 - March 2, 2025)
   - Vivid Sydney (May 23-29)
   - Australia Day (Jan 26)

### Why make this change?
To enhance user experience by displaying culturally relevant and diverse festival emojis during loading screens, making the app more engaging and inclusive for users across different cultural celebrations and events.
  • Loading branch information
ksharma-xyz authored Jan 23, 2025
1 parent aa9f01b commit 9eab850
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ enum class FestivalType {
BOXING_DAY,
NEW_YEAR_EVE,
NEW_YEAR,
AUSTRALIA_DAY,
ANZAC_DAY,
EASTER,
ROSE_DAY,
PROPOSE_DAY,
CHOCOLATE_DAY,
TEDDY_DAY,
PROMISE_DAY,
HUG_DAY,
KISS_DAY,
VALENTINES_DAY,
HALLOWEEN,
CHINESE_NEW_YEAR,
HOLI,
EID,
MARDI_GRAS,
VIVID_SYDNEY
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import kotlinx.datetime.number
import kotlinx.datetime.todayIn
import kotlin.random.Random

// TODO - Add better logic
// 1. should be able to create range of dates with exhaustive statements.
// 2. Should be able to fetch festival dates / emoji from remote config rather than hard code.
object LoadingEmojiManager {

private val commonEmojiList = persistentListOf(
Expand All @@ -23,8 +26,7 @@ object LoadingEmojiManager {
private val rareEmojiList = persistentListOf("🐦‍🔥")

private val festivalEmojiMap = mapOf(
FestivalType.CHRISTMAS to listOf("🎄", "🎅", "\uFE0F"),
FestivalType.CHRISTMAS to listOf("🎁"),
FestivalType.CHRISTMAS to listOf("🎄", "\uD83C\uDF85", "\uFE0F", "🎁"),
FestivalType.NEW_YEAR to listOf("🎉"),
FestivalType.NEW_YEAR_EVE to listOf("🎆"),
FestivalType.ANZAC_DAY to listOf(
Expand All @@ -34,25 +36,89 @@ object LoadingEmojiManager {
"\uD83C\uDF3F" // Herb Rosemary
),
FestivalType.EASTER to listOf("🐰", "🐣", "🥚"),
FestivalType.VALENTINES_DAY to listOf("❤️", "🌹"),
FestivalType.HALLOWEEN to listOf("🎃", "👻"),
FestivalType.CHINESE_NEW_YEAR to listOf("🧧"),

FestivalType.ROSE_DAY to listOf("🌹"),
FestivalType.PROPOSE_DAY to listOf("💍", "💞", "💌"),
FestivalType.CHOCOLATE_DAY to listOf("🍫", "💞"),
FestivalType.TEDDY_DAY to listOf("🧸", "💖"),
FestivalType.PROMISE_DAY to listOf("🤝", "💖"),
FestivalType.HUG_DAY to listOf("🤗", "💖"),
FestivalType.KISS_DAY to listOf("💋", "💖", "❤️", "💞"),
FestivalType.VALENTINES_DAY to listOf("❤️", "🌹", "💖"),

FestivalType.HOLI to listOf("🎨", "🌈", "🎉", "🎈"),

FestivalType.AUSTRALIA_DAY to listOf("🇦🇺", "🎉", "🎆"),
FestivalType.EID to listOf("🌙", "🕌", "🎉", "🎁"),
FestivalType.MARDI_GRAS to listOf("🏳️‍🌈", "💃", "🎭", "🪩", "🎉"),
FestivalType.VIVID_SYDNEY to listOf("🎆", "🌈", "🌟", ""),
)

// TODO - test logic
// TODO - test logic add UT
data class MonthDay(val month: Int, val dayOfMonth: Int) {
companion object {
fun of(month: Int, dayOfMonth: Int) = MonthDay(month, dayOfMonth)
}
}

private val knownFestivalDates = mapOf(
// Sure dates
FestivalType.CHRISTMAS to MonthDay.of(12, 25),
FestivalType.BOXING_DAY to MonthDay.of(12, 26),
FestivalType.NEW_YEAR_EVE to MonthDay.of(12, 31),
FestivalType.NEW_YEAR to MonthDay.of(1, 1),
FestivalType.VALENTINES_DAY to MonthDay.of(2, 14),
FestivalType.ANZAC_DAY to MonthDay.of(4, 25),

// Valentines day
FestivalType.ROSE_DAY to MonthDay.of(2, 7),
FestivalType.PROPOSE_DAY to MonthDay.of(2, 8),
FestivalType.CHOCOLATE_DAY to MonthDay.of(2, 9),
FestivalType.TEDDY_DAY to MonthDay.of(2, 10),
FestivalType.PROMISE_DAY to MonthDay.of(2, 11),
FestivalType.HUG_DAY to MonthDay.of(2, 12),
FestivalType.KISS_DAY to MonthDay.of(2, 13),
FestivalType.VALENTINES_DAY to MonthDay.of(2, 14),

FestivalType.AUSTRALIA_DAY to MonthDay.of(1, 26),

// Can change dates

// Chinese New Year
FestivalType.CHINESE_NEW_YEAR to MonthDay.of(1, 29),
FestivalType.HOLI to MonthDay.of(3, 14),
FestivalType.EID to MonthDay.of(3, 30),
FestivalType.EID to MonthDay.of(3, 31),

// Mardi Gras 2025
FestivalType.MARDI_GRAS to MonthDay.of(2, 15),
FestivalType.MARDI_GRAS to MonthDay.of(2, 16),
FestivalType.MARDI_GRAS to MonthDay.of(2, 17),
FestivalType.MARDI_GRAS to MonthDay.of(2, 18),
FestivalType.MARDI_GRAS to MonthDay.of(2, 19),
FestivalType.MARDI_GRAS to MonthDay.of(2, 20),
FestivalType.MARDI_GRAS to MonthDay.of(2, 21),
FestivalType.MARDI_GRAS to MonthDay.of(2, 22),
FestivalType.MARDI_GRAS to MonthDay.of(2, 23),
FestivalType.MARDI_GRAS to MonthDay.of(2, 24),
FestivalType.MARDI_GRAS to MonthDay.of(2, 25),
FestivalType.MARDI_GRAS to MonthDay.of(2, 26),
FestivalType.MARDI_GRAS to MonthDay.of(2, 27),
FestivalType.MARDI_GRAS to MonthDay.of(2, 28),
FestivalType.MARDI_GRAS to MonthDay.of(3, 1),
FestivalType.MARDI_GRAS to MonthDay.of(3, 2),

// Easter 2025
FestivalType.EASTER to MonthDay.of(4, 20),

FestivalType.VIVID_SYDNEY to MonthDay.of(5, 23),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 24),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 25),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 26),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 27),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 28),
FestivalType.VIVID_SYDNEY to MonthDay.of(5, 29),// till 14 june
)

internal fun getRandomEmoji(overrideEmoji: String? = null): String {
Expand Down

0 comments on commit 9eab850

Please sign in to comment.