Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bug fixes + semester date dining #644

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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