Skip to content

Commit

Permalink
Merge pull request #644 from pennlabs/trini/version-bump
Browse files Browse the repository at this point in the history
some bug fixes + semester date dining
  • Loading branch information
baronhsieh2005 authored Feb 2, 2025
2 parents 01afaec + b32f237 commit 128a6d3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions PennMobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<application
android:name="androidx.multidex.MultiDexApplication"
android:label="@string/app_name"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DiningInsightsCardAdapter(
private const val DINING_DOLLARS_PREDICTIONS = 2
private const val DINING_SWIPES_PREDICTIONS = 3

const val START_DAY_OF_SEMESTER = "2024-08-27"
const val START_DAY_OF_SEMESTER = "2025-01-15"
private const val DAYS_IN_SEMESTER = 117f
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import android.view.View
import android.view.ViewGroup
import android.widget.BaseExpandableListAdapter
import android.widget.ImageView
import android.widget.Switch
import android.widget.TextView
import androidx.appcompat.widget.SwitchCompat
import com.pennapps.labs.pennmobile.R
import com.pennapps.labs.pennmobile.laundry.LaundryViewModel
import com.pennapps.labs.pennmobile.laundry.classes.LaundryRoomSimple
Expand All @@ -20,7 +20,7 @@ class LaundrySettingsAdapter(
private val mContext: Context,
private val dataModel: LaundryViewModel,
) : BaseExpandableListAdapter() {
private val switches: MutableList<Switch> = ArrayList()
private val switches: MutableList<SwitchCompat> = ArrayList()

init {
dataModel.setToggled()
Expand Down Expand Up @@ -65,7 +65,7 @@ class LaundrySettingsAdapter(
val textView = view.findViewById<TextView>(R.id.laundry_building_name)
textView.text = laundryHallName
val imageView = view.findViewById<ImageView>(R.id.laundry_building_dropdown)
val buildingSwitch = view.findViewById<Switch>(R.id.laundry_building_favorite_switch)
val buildingSwitch = view.findViewById<SwitchCompat>(R.id.laundry_building_favorite_switch)

// if there is only one laundry room in the building, don't have dropdown
if (dataModel.getRooms(laundryHallName)!!.size == 1) {
Expand Down Expand Up @@ -122,7 +122,7 @@ class LaundrySettingsAdapter(
val textView = view.findViewById<TextView>(R.id.laundry_room_name)
val name = laundryRoom.name
textView.text = name
val favoriteSwitch = view.findViewById<Switch>(R.id.laundry_favorite_switch)
val favoriteSwitch = view.findViewById<SwitchCompat>(R.id.laundry_favorite_switch)

val roomId: Int = laundryRoom.id!!

Expand Down Expand Up @@ -153,15 +153,15 @@ class LaundrySettingsAdapter(

private fun updateSwitches() {
if (dataModel.isFull()) {
val iter: Iterator<Switch> = switches.iterator()
val iter: MutableIterator<SwitchCompat> = switches.iterator()
while (iter.hasNext()) {
val nextSwitch = iter.next()
if (!nextSwitch.isChecked) {
nextSwitch.isEnabled = false
}
}
} else {
val iter: Iterator<Switch> = switches.iterator()
val iter: MutableIterator<SwitchCompat> = switches.iterator()
while (iter.hasNext()) {
val nextSwitch = iter.next()
nextSwitch.isEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
android:textSize="20sp"
android:textStyle="bold" />

<Switch
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/laundry_building_favorite_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:visibility="gone" />

<ImageView
Expand Down

0 comments on commit 128a6d3

Please sign in to comment.