Skip to content

Commit

Permalink
made sponsor variable nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
dominick-deseta committed Jan 25, 2024
1 parent d2260d4 commit f0b079e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/schemas/org.hackillinois.android.database.Database/6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 6,
"identityHash": "e24cc0644f69cc729d1cdb02c1ae0503",
"identityHash": "c6810ed81ba5a5537bff4e50678e7706",
"entities": [
{
"tableName": "qr_codes",
Expand Down Expand Up @@ -120,7 +120,7 @@
},
{
"tableName": "events",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`eventId` TEXT NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `startTime` INTEGER NOT NULL, `endTime` INTEGER NOT NULL, `locations` TEXT NOT NULL, `sponsor` TEXT NOT NULL, `eventType` TEXT NOT NULL, `points` TEXT NOT NULL, `isAsync` INTEGER NOT NULL, `isPrivate` INTEGER NOT NULL, `displayOnStaffCheckIn` INTEGER NOT NULL, PRIMARY KEY(`eventId`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`eventId` TEXT NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `startTime` INTEGER NOT NULL, `endTime` INTEGER NOT NULL, `locations` TEXT NOT NULL, `sponsor` TEXT, `eventType` TEXT NOT NULL, `points` TEXT NOT NULL, `isAsync` INTEGER NOT NULL, `isPrivate` INTEGER NOT NULL, `displayOnStaffCheckIn` INTEGER NOT NULL, PRIMARY KEY(`eventId`))",
"fields": [
{
"fieldPath": "eventId",
Expand Down Expand Up @@ -162,7 +162,7 @@
"fieldPath": "sponsor",
"columnName": "sponsor",
"affinity": "TEXT",
"notNull": true
"notNull": false
},
{
"fieldPath": "eventType",
Expand Down Expand Up @@ -390,7 +390,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'e24cc0644f69cc729d1cdb02c1ae0503')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'c6810ed81ba5a5537bff4e50678e7706')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import org.hackillinois.android.database.entity.*
Roles::class,
Profile::class,
Leaderboard::class,
Shift::class,
Shift::class
],
version = 6,
version = 7
)

abstract class Database : RoomDatabase() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ data class Event(
val startTime: Long,
val endTime: Long,
val locations: List<EventLocation>,
val sponsor: String,
val sponsor: String?,
val eventType: String,
val points: String,
val isAsync: Boolean = false,
val isPrivate: Boolean,
val displayOnStaffCheckIn: Boolean,
val displayOnStaffCheckIn: Boolean
) : ScheduleListItem {

override fun getStartTimeMs() = startTime * 1000L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class EventInfoFragment : Fragment() {
event_name.text = it.name
event_points.text = "+ ${it.points} pts"
event_sponsor.text = "Sponsored by ${it.sponsor}"
event_sponsor.visibility = if (it.sponsor.isEmpty()) View.GONE else View.VISIBLE
sponsoredIcon.visibility = if (it.sponsor.isEmpty()) View.GONE else View.VISIBLE
event_sponsor.visibility = if (it.sponsor == null) View.GONE else View.VISIBLE
sponsoredIcon.visibility = if (it.sponsor == null) View.GONE else View.VISIBLE
favorites_button.visibility = if (!isAttendeeViewing) View.GONE else View.VISIBLE
if (it.locations.isEmpty()) {
event_location.text = "N/A"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class EventsAdapter(
true -> "Asynchronous event"
}
sponsoredTextView.text = "Sponsored by ${event.sponsor}"
sponsoredTextView.visibility = if (event.sponsor.isEmpty()) View.GONE else View.VISIBLE
sponsored_marker.visibility = if (event.sponsor.isEmpty()) View.GONE else View.VISIBLE
sponsoredTextView.visibility = if (event.sponsor == null) View.GONE else View.VISIBLE
sponsored_marker.visibility = if (event.sponsor == null) View.GONE else View.VISIBLE
if (event.locations.isEmpty()) {
locationTextView.text = "N/A"
} else {
Expand Down

0 comments on commit f0b079e

Please sign in to comment.