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

Commit 78033d6

Browse files
authored
Merge branch 'development' into sneh/points-page
2 parents 3fd2b23 + 0b0be2c commit 78033d6

File tree

116 files changed

+21601
-601
lines changed

Some content is hidden

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

116 files changed

+21601
-601
lines changed

app/schemas/org.hackillinois.android.database.Database/3.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"formatVersion": 1,
33
"database": {
44
"version": 3,
5-
"identityHash": "64145a0d233925fd28a80a38316cd145",
5+
"identityHash": "f39906469f336ff1fd8c3c6c6f1907a4",
66
"entities": [
77
{
88
"tableName": "qr_codes",
@@ -250,7 +250,7 @@
250250
},
251251
{
252252
"tableName": "profiles",
253-
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` TEXT NOT NULL, `displayName` TEXT NOT NULL, `discordTag` TEXT NOT NULL, `avatarUrl` TEXT NOT NULL, `points` INTEGER NOT NULL, `userId` TEXT NOT NULL, `foodWave` INTEGER NOT NULL, `coins` INTEGER NOT NULL, `key` INTEGER NOT NULL, PRIMARY KEY(`key`))",
253+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` TEXT NOT NULL, `userId` TEXT NOT NULL, `avatrUrl` TEXT NOT NULL, `discordTag` TEXT NOT NULL, `displayName` TEXT NOT NULL, `foodWave` INTEGER NOT NULL, `points` INTEGER NOT NULL, `pointsAccumulated` INTEGER NOT NULL, `key` INTEGER NOT NULL, PRIMARY KEY(`key`))",
254254
"fields": [
255255
{
256256
"fieldPath": "_id",
@@ -259,32 +259,26 @@
259259
"notNull": true
260260
},
261261
{
262-
"fieldPath": "displayName",
263-
"columnName": "displayName",
262+
"fieldPath": "userId",
263+
"columnName": "userId",
264264
"affinity": "TEXT",
265265
"notNull": true
266266
},
267267
{
268-
"fieldPath": "discordTag",
269-
"columnName": "discordTag",
268+
"fieldPath": "avatrUrl",
269+
"columnName": "avatrUrl",
270270
"affinity": "TEXT",
271271
"notNull": true
272272
},
273273
{
274-
"fieldPath": "avatarUrl",
275-
"columnName": "avatarUrl",
274+
"fieldPath": "discordTag",
275+
"columnName": "discordTag",
276276
"affinity": "TEXT",
277277
"notNull": true
278278
},
279279
{
280-
"fieldPath": "points",
281-
"columnName": "points",
282-
"affinity": "INTEGER",
283-
"notNull": true
284-
},
285-
{
286-
"fieldPath": "userId",
287-
"columnName": "userId",
280+
"fieldPath": "displayName",
281+
"columnName": "displayName",
288282
"affinity": "TEXT",
289283
"notNull": true
290284
},
@@ -295,8 +289,14 @@
295289
"notNull": true
296290
},
297291
{
298-
"fieldPath": "coins",
299-
"columnName": "coins",
292+
"fieldPath": "points",
293+
"columnName": "points",
294+
"affinity": "INTEGER",
295+
"notNull": true
296+
},
297+
{
298+
"fieldPath": "pointsAccumulated",
299+
"columnName": "pointsAccumulated",
300300
"affinity": "INTEGER",
301301
"notNull": true
302302
},
@@ -458,7 +458,7 @@
458458
"views": [],
459459
"setupQueries": [
460460
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
461-
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '64145a0d233925fd28a80a38316cd145')"
461+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'f39906469f336ff1fd8c3c6c6f1907a4')"
462462
]
463463
}
464464
}

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
@@ -10,6 +10,7 @@ import org.hackillinois.android.model.scanner.DietaryRestrictions
1010
import org.hackillinois.android.model.scanner.EventId
1111
import org.hackillinois.android.model.scanner.MentorId
1212
import org.hackillinois.android.model.scanner.Points
13+
import org.hackillinois.android.model.scanner.QRCode
1314
import org.hackillinois.android.model.scanner.UserEventPair
1415
import org.hackillinois.android.model.shop.ItemInstance
1516
import org.hackillinois.android.model.user.FavoritesResponse
@@ -82,6 +83,9 @@ interface API {
8283
@DELETE("shop/cart/{itemId}")
8384
suspend fun removeItemCart(@Path("itemId") itemId: String): Response<ResponseBody>
8485

86+
@POST("shop/cart/redeem/")
87+
suspend fun redeemCart(@Body body: QRCode): Cart
88+
8589
// STAFF
8690

8791
@POST("staff/attendance/")

app/src/main/java/org/hackillinois/android/database/Database.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.hackillinois.android.database.entity.*
1717
Shift::class,
1818
ShopItem::class,
1919
],
20-
version = 3,
20+
version = 4,
2121
)
2222

2323
abstract class Database : RoomDatabase() {

app/src/main/java/org/hackillinois/android/database/entity/Profile.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import org.hackillinois.android.database.Converters
99
@TypeConverters(Converters::class)
1010
data class Profile(
1111
var _id: String,
12-
var displayName: String,
13-
var discordTag: String,
14-
var avatarUrl: String,
15-
var points: Int,
1612
var userId: String,
13+
var avatarUrl: String,
14+
var discordTag: String,
15+
var displayName: String,
1716
var foodWave: Int,
18-
var coins: Int,
17+
var points: Int,
18+
var pointsAccumulated: Int
1919
) {
2020
@PrimaryKey
2121
var key = 1
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: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,27 @@ 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)
6159

60+
val selectedIconColor = ContextCompat.getColor(this, R.color.black)
61+
val unselectedIconColor = ContextCompat.getColor(this, R.color.black)
62+
63+
// Set default icons (assume these are your unselected drawables)
64+
bottomAppBar.homeButton.setImageResource(R.drawable.battle_png)
65+
bottomAppBar.scheduleButton.setImageResource(R.drawable.schedule_png)
66+
bottomAppBar.shopButton.setImageResource(R.drawable.shop_png)
67+
bottomAppBar.profileButton.setImageResource(R.drawable.profile_png)
68+
69+
// Set default color filter on home button (as it's selected by default)
6270
bottomAppBar.homeButton.setColorFilter(selectedIconColor)
6371

6472
val bottomBarButtons = listOf(
6573
bottomAppBar.homeButton,
6674
bottomAppBar.scheduleButton,
6775
bottomAppBar.shopButton,
68-
bottomAppBar.profileButton,
76+
bottomAppBar.profileButton
6977
)
7078

71-
// make all buttons unselectedColor and then set selected button to selectedColor
79+
// Set click listeners for each button.
7280
bottomBarButtons.forEach { button ->
7381
button.setOnClickListener { view ->
7482
val newSelection = bottomBarButtons.indexOf(button)
@@ -77,15 +85,31 @@ class MainActivity : AppCompatActivity() {
7785
if (newSelection != currentSelection) {
7886
currentSelection = newSelection
7987

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

95+
// Set the clicked button to selected drawable and color filter.
8496
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)
97+
bottomAppBar.homeButton -> {
98+
bottomAppBar.homeButton.setImageResource(R.drawable.battle_underlined_png)
99+
switchFragment(HomeFragment(), false)
100+
}
101+
bottomAppBar.scheduleButton -> {
102+
bottomAppBar.scheduleButton.setImageResource(R.drawable.schedule_underlined_png)
103+
switchFragment(ScheduleFragment(), false)
104+
}
105+
bottomAppBar.shopButton -> {
106+
bottomAppBar.shopButton.setImageResource(R.drawable.shop_underlined_png)
107+
switchFragment(ShopFragment(), false)
108+
}
109+
bottomAppBar.profileButton -> {
110+
bottomAppBar.profileButton.setImageResource(R.drawable.profile_underlined_png)
111+
switchFragment(ProfileFragment(), false)
112+
}
89113
else -> return@setOnClickListener
90114
}
91115
}
@@ -113,7 +137,7 @@ class MainActivity : AppCompatActivity() {
113137
bottomAppBar.shopButton,
114138
bottomAppBar.profileButton,
115139
)
116-
val unselectedIconColor = ContextCompat.getColor(this, R.color.unselectedAppBarIcon)
140+
val unselectedIconColor = ContextCompat.getColor(this, R.color.black)
117141
bottomBarButtons.forEach { (it as ImageButton).setColorFilter(unselectedIconColor) }
118142

119143
// 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

0 commit comments

Comments
 (0)