@@ -6,8 +6,8 @@ import android.view.View
66import android.view.ViewGroup
77import android.widget.BaseExpandableListAdapter
88import android.widget.ImageView
9- import android.widget.Switch
109import android.widget.TextView
10+ import androidx.appcompat.widget.SwitchCompat
1111import com.pennapps.labs.pennmobile.R
1212import com.pennapps.labs.pennmobile.laundry.LaundryViewModel
1313import com.pennapps.labs.pennmobile.laundry.classes.LaundryRoomSimple
@@ -20,7 +20,7 @@ class LaundrySettingsAdapter(
2020 private val mContext : Context ,
2121 private val dataModel : LaundryViewModel ,
2222) : BaseExpandableListAdapter() {
23- private val switches: MutableList <Switch > = ArrayList ()
23+ private val switches: MutableList <SwitchCompat > = ArrayList ()
2424
2525 init {
2626 dataModel.setToggled()
@@ -65,7 +65,7 @@ class LaundrySettingsAdapter(
6565 val textView = view.findViewById<TextView >(R .id.laundry_building_name)
6666 textView.text = laundryHallName
6767 val imageView = view.findViewById<ImageView >(R .id.laundry_building_dropdown)
68- val buildingSwitch = view.findViewById<Switch >(R .id.laundry_building_favorite_switch)
68+ val buildingSwitch = view.findViewById<SwitchCompat >(R .id.laundry_building_favorite_switch)
6969
7070 // if there is only one laundry room in the building, don't have dropdown
7171 if (dataModel.getRooms(laundryHallName)!! .size == 1 ) {
@@ -122,7 +122,7 @@ class LaundrySettingsAdapter(
122122 val textView = view.findViewById<TextView >(R .id.laundry_room_name)
123123 val name = laundryRoom.name
124124 textView.text = name
125- val favoriteSwitch = view.findViewById<Switch >(R .id.laundry_favorite_switch)
125+ val favoriteSwitch = view.findViewById<SwitchCompat >(R .id.laundry_favorite_switch)
126126
127127 val roomId: Int = laundryRoom.id!!
128128
@@ -153,15 +153,15 @@ class LaundrySettingsAdapter(
153153
154154 private fun updateSwitches () {
155155 if (dataModel.isFull()) {
156- val iter: Iterator < Switch > = switches.iterator()
156+ val iter: MutableIterator < SwitchCompat > = switches.iterator()
157157 while (iter.hasNext()) {
158158 val nextSwitch = iter.next()
159159 if (! nextSwitch.isChecked) {
160160 nextSwitch.isEnabled = false
161161 }
162162 }
163163 } else {
164- val iter: Iterator < Switch > = switches.iterator()
164+ val iter: MutableIterator < SwitchCompat > = switches.iterator()
165165 while (iter.hasNext()) {
166166 val nextSwitch = iter.next()
167167 nextSwitch.isEnabled = true
0 commit comments