app / sg.edu.ntu.scse.cz2006.gymbuddies.tasks / UpdateGymFavourites

UpdateGymFavourites

class UpdateGymFavourites : AsyncTask<Void, Void, Void>

Task to handle updating gym favourites when the favourites button is clicked For sg.edu.ntu.scse.cz2006.gymbuddies.tasks in Gym Buddies!

Author
Kenneth Soh

Since
2019-10-02

Types

Callback

Internal interface to handle callbacks

interface Callback

Constructors

<init>

Initializees the task to execute

UpdateGymFavourites(activity: Activity, userid: String, gymId: String?, favStatus: Boolean, callback: Callback)

Properties

actRef

WeakReference<(android.app.Activity..android.app.Activity?)> A weak reference to the activity

val actRef: WeakReference<Activity!>

callback

Callback Callback to call when task completes

val callback: Callback

favStatus

Boolean The toggle state (true if we are favouriting, false if you are unfavouriting)

val favStatus: Boolean

gymId

String? The gym being favourited or unfavourited

val gymId: String?

userid

String User ID of the user who clicked the button

val userid: String

Functions

doInBackground

Internal task to execute in the background on a seperate thread

fun doInBackground(vararg params: Void?): Void?

Companion Object Properties

TAG

Activity Tag for logs

const val TAG: String