Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 2e1228f

Browse files
authored
Merge branch 'development' into aryan/profile-page
2 parents c546850 + 78b8656 commit 2e1228f

File tree

70 files changed

+20762
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+20762
-174
lines changed

app/src/main/assets/swirling_oracle.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

app/src/main/java/org/hackillinois/android/API.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import org.hackillinois.android.model.scanner.DietaryRestrictions
99
import org.hackillinois.android.model.scanner.EventId
1010
import org.hackillinois.android.model.scanner.MentorId
1111
import org.hackillinois.android.model.scanner.Points
12+
import org.hackillinois.android.model.scanner.QRCode
1213
import org.hackillinois.android.model.scanner.UserEventPair
1314
import org.hackillinois.android.model.shop.ItemInstance
1415
import org.hackillinois.android.model.user.FavoritesResponse
@@ -68,6 +69,9 @@ interface API {
6869
@POST("shop/item/buy/")
6970
suspend fun buyShopItem(@Body body: ItemInstance): ShopItem
7071

72+
@POST("shop/cart/redeem/")
73+
suspend fun redeemCart(@Body body: QRCode): Cart
74+
7175
// STAFF
7276

7377
@POST("staff/attendance/")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.hackillinois.android.database.entity
2+
3+
import androidx.room.Entity
4+
import androidx.room.PrimaryKey
5+
6+
@Entity(tableName = "cart")
7+
data class Cart(
8+
@PrimaryKey val userId: String,
9+
val items: Map<String, Int> // Maps itemId to quantity
10+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package org.hackillinois.android.model.scanner
2+
3+
data class QRCode(val QRCode: String)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package org.hackillinois.android.model.scanner
22

3-
data class UserEventPair(val attendeeJWT: String, val eventId: String)
3+
data class UserEventPair(val eventId: String, val attendeeQRCode: String)

app/src/main/java/org/hackillinois/android/view/MainActivity.kt

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,26 @@ class MainActivity : AppCompatActivity() {
5656

5757
private fun setupBottomAppBar() {
5858
// by default, home button is selected
59-
val selectedIconColor = ContextCompat.getColor(this, R.color.selectedAppBarIcon)
60-
val unselectedIconColor = ContextCompat.getColor(this, R.color.unselectedAppBarIcon)
59+
val selectedIconColor = ContextCompat.getColor(this, R.color.black)
60+
val unselectedIconColor = ContextCompat.getColor(this, R.color.black)
6161

62+
// Set default icons (assume these are your unselected drawables)
63+
bottomAppBar.homeButton.setImageResource(R.drawable.battle_png)
64+
bottomAppBar.scheduleButton.setImageResource(R.drawable.schedule_png)
65+
bottomAppBar.shopButton.setImageResource(R.drawable.shop_png)
66+
bottomAppBar.profileButton.setImageResource(R.drawable.profile_png)
67+
68+
// Set default color filter on home button (as it's selected by default)
6269
bottomAppBar.homeButton.setColorFilter(selectedIconColor)
6370

6471
val bottomBarButtons = listOf(
6572
bottomAppBar.homeButton,
6673
bottomAppBar.scheduleButton,
6774
bottomAppBar.shopButton,
68-
bottomAppBar.profileButton,
75+
bottomAppBar.profileButton
6976
)
7077

71-
// make all buttons unselectedColor and then set selected button to selectedColor
78+
// Set click listeners for each button.
7279
bottomBarButtons.forEach { button ->
7380
button.setOnClickListener { view ->
7481
val newSelection = bottomBarButtons.indexOf(button)
@@ -77,15 +84,31 @@ class MainActivity : AppCompatActivity() {
7784
if (newSelection != currentSelection) {
7885
currentSelection = newSelection
7986

80-
// change icon colors
87+
// Reset all buttons: set unselected drawable and color filter.
88+
bottomAppBar.homeButton.setImageResource(R.drawable.battle_png)
89+
bottomAppBar.scheduleButton.setImageResource(R.drawable.schedule_png)
90+
bottomAppBar.shopButton.setImageResource(R.drawable.shop_png)
91+
bottomAppBar.profileButton.setImageResource(R.drawable.profile_png)
8192
bottomBarButtons.forEach { (it as ImageButton).setColorFilter(unselectedIconColor) }
82-
(view as ImageButton).setColorFilter(selectedIconColor)
8393

94+
// Set the clicked button to selected drawable and color filter.
8495
when (view) {
85-
bottomAppBar.homeButton -> switchFragment(HomeFragment(), false)
86-
bottomAppBar.scheduleButton -> switchFragment(ScheduleFragment(), false)
87-
bottomAppBar.shopButton -> switchFragment(ShopFragment(), false)
88-
bottomAppBar.profileButton -> switchFragment(ProfileFragment(), false)
96+
bottomAppBar.homeButton -> {
97+
bottomAppBar.homeButton.setImageResource(R.drawable.battle_underlined_png)
98+
switchFragment(HomeFragment(), false)
99+
}
100+
bottomAppBar.scheduleButton -> {
101+
bottomAppBar.scheduleButton.setImageResource(R.drawable.schedule_underlined_png)
102+
switchFragment(ScheduleFragment(), false)
103+
}
104+
bottomAppBar.shopButton -> {
105+
bottomAppBar.shopButton.setImageResource(R.drawable.shop_underlined_png)
106+
switchFragment(ShopFragment(), false)
107+
}
108+
bottomAppBar.profileButton -> {
109+
bottomAppBar.profileButton.setImageResource(R.drawable.profile_underlined_png)
110+
switchFragment(ProfileFragment(), false)
111+
}
89112
else -> return@setOnClickListener
90113
}
91114
}
@@ -113,7 +136,7 @@ class MainActivity : AppCompatActivity() {
113136
bottomAppBar.shopButton,
114137
bottomAppBar.profileButton,
115138
)
116-
val unselectedIconColor = ContextCompat.getColor(this, R.color.unselectedAppBarIcon)
139+
val unselectedIconColor = ContextCompat.getColor(this, R.color.black)
117140
bottomBarButtons.forEach { (it as ImageButton).setColorFilter(unselectedIconColor) }
118141

119142
// if not already on scanner selection page, switch fragment to scanner selection page

app/src/main/java/org/hackillinois/android/view/SplashScreenActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.os.Build
1111
import android.os.Bundle
1212
import android.util.Log
1313
import android.view.View
14+
import android.widget.ImageView
1415
import androidx.appcompat.app.AlertDialog
1516
import androidx.appcompat.app.AppCompatActivity
1617
import androidx.core.content.ContextCompat
@@ -36,6 +37,7 @@ class SplashScreenActivity : AppCompatActivity() {
3637
private var needsToUpdate = false
3738
private var hasInternet = true
3839
private var hasClickedOrAnimFinish = false
40+
private lateinit var splashBackground: ImageView
3941

4042
override fun onCreate(savedInstanceState: Bundle?) {
4143
super.onCreate(savedInstanceState)

app/src/main/java/org/hackillinois/android/view/home/CountdownManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CountdownManager(val listener: CountDownListener) {
1010
// 02-23-2024 15:30:00
1111
private val eventStartTime: Calendar = Calendar.getInstance().apply {
1212
timeZone = TimeZone.getTimeZone("America/Chicago")
13-
timeInMillis = 1708723800000
13+
timeInMillis = 1740722400000 // 1708723800000
1414
}
1515

1616
// 02-23-2024 19:00:00

app/src/main/java/org/hackillinois/android/view/home/EventProgressManager.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,50 @@ import java.util.*
99
class EventProgressManager(val listener: CountDownListener) {
1010

1111
// CORRECT TIMES ARE NOT SET YET
12-
// 02-23-2024 15:30:00
12+
// 02-28-2025 : 14:30
1313
private val checkInTime: Calendar = Calendar.getInstance().apply {
1414
timeZone = TimeZone.getTimeZone("America/Chicago")
15-
timeInMillis = 1708723800000
15+
timeInMillis = 1740774600000
1616
}
1717

18-
// 02-23-2024 16:00:00
18+
// 02-28-2025 : 15:00
1919
private val scavengerHuntTime: Calendar = Calendar.getInstance().apply {
2020
timeZone = TimeZone.getTimeZone("America/Chicago")
21-
timeInMillis = 1708725600000
21+
timeInMillis = 1740776400000
2222
}
2323

24-
// 02-23-2024 18:00:00
24+
// 02-28-2025 : 17:00
2525
private val openingCeremonyTime: Calendar = Calendar.getInstance().apply {
2626
timeZone = TimeZone.getTimeZone("America/Chicago")
27-
timeInMillis = 1708732800000
27+
timeInMillis = 1740783600000
2828
}
2929

30-
// 02-23-2024 19:00:00
30+
// 02-28-2025 : 18:00
3131
private val hackingTime: Calendar = Calendar.getInstance().apply {
3232
timeZone = TimeZone.getTimeZone("America/Chicago")
33-
timeInMillis = 1708736400000
33+
timeInMillis = 1740787200000
3434
}
3535

36-
// 02-25-2024 11:00:00
36+
// 03-02-2025 11:30
3737
private val projectShowcaseTime: Calendar = Calendar.getInstance().apply {
3838
timeZone = TimeZone.getTimeZone("America/Chicago")
39-
timeInMillis = 1708880400000
39+
timeInMillis = 1740936600000
4040
}
4141

42-
// 02-25-2024 15:00:00
42+
// 03-02-2025 15:00
4343
private val closingCeremonyTime: Calendar = Calendar.getInstance().apply {
4444
timeZone = TimeZone.getTimeZone("America/Chicago")
45-
timeInMillis = 1708894800000
45+
timeInMillis = 1740949200000
4646
}
4747

48-
// 02-25-2024 16:00:00
48+
// 03-02-2025 16:00
4949
private val afterHackathonTime: Calendar = Calendar.getInstance().apply {
5050
timeZone = TimeZone.getTimeZone("America/Chicago")
51-
timeInMillis = 1708898400000
51+
timeInMillis = 1740952800000
5252
}
5353

5454
private var times = listOf(checkInTime, scavengerHuntTime, openingCeremonyTime, hackingTime, projectShowcaseTime, closingCeremonyTime, afterHackathonTime)
55-
private var backgrounds = listOf(R.drawable.home_bg_start, R.drawable.home_check_in_bg, R.drawable.home_scavenger_hunt_bg, R.drawable.home_opening_bg, R.drawable.home_hacking_bg, R.drawable.home_project_showcase_bg, R.drawable.home_closing_bg, R.drawable.home_final_bg)
55+
private var backgrounds = listOf(R.drawable.home_background1_svg, R.drawable.home_background2_svg, R.drawable.home_background3_svg, R.drawable.home_background3_svg, R.drawable.home_background4_svg, R.drawable.home_background5_svg, R.drawable.home_background6_svg, R.drawable.home_background6_svg)
5656
private var timer: CountDownTimer? = null
5757
private var state = 0
5858

app/src/main/java/org/hackillinois/android/view/home/HomeFragment.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
3030

3131
override fun onCreate(savedInstanceState: Bundle?) {
3232
super.onCreate(savedInstanceState)
33-
3433
viewModel = ViewModelProvider(this).get(HomeViewModel::class.java)
3534
}
3635

3736
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
38-
val view = inflater.inflate(R.layout.fragment_home, container, false)
37+
val view = inflater.inflate(R.layout.fragment_home_2025, container, false)
3938

4039
daysValue = view.findViewById(R.id.daysValue)
4140
hoursValue = view.findViewById(R.id.hoursValue)
@@ -44,7 +43,7 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
4443
homeBackgroundImageView = view.findViewById(R.id.homeBackgroundImageView)
4544
homeBackgroundTagsImageView = view.findViewById(R.id.homeBackgroundTagsImageView)
4645
infoButton = view.findViewById(R.id.homeInfoImageView)
47-
46+
//
4847
// set info button's functionality to toggle tag descriptions on home page when pressed on/off
4948
infoButton.setOnClickListener {
5049
if (homeBackgroundTagsImageView.visibility == View.INVISIBLE) {
@@ -63,21 +62,21 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
6362
super.onStart()
6463
isActive = true
6564
countDownManager.start()
66-
eventProgressManager.start()
65+
// eventProgressManager.start()
6766
}
6867

6968
override fun onPause() {
7069
super.onPause()
7170
isActive = false
7271
countDownManager.onPause()
73-
eventProgressManager.onPause()
72+
// eventProgressManager.onPause()
7473
}
7574

7675
override fun onResume() {
7776
super.onResume()
7877
isActive = true
7978
countDownManager.onResume()
80-
eventProgressManager.onResume()
79+
// eventProgressManager.onResume()
8180
}
8281

8382
override fun onStop() {
@@ -103,7 +102,7 @@ class HomeFragment : Fragment(), CountdownManager.CountDownListener, EventProgre
103102

104103
override fun updateBackground(newBackgroundResource: Int) {
105104
if (isActive) {
106-
homeBackgroundImageView.setImageResource(newBackgroundResource)
105+
// homeBackgroundImageView.setImageResource(newBackgroundResource)
107106
}
108107
}
109108

0 commit comments

Comments
 (0)