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

SearchGym

class SearchGym : AsyncTask<Void, Void, Void>

Asynchronous Task to do a search for gyms based on parameters defined by the user in the background of the app for sg.edu.ntu.scse.cz2006.gymbuddies.tasks in Gym Buddies!

Author
Kenneth Soh

Since
2019-10-14

Types

OnComplete

Interface for when the task completes

interface OnComplete

Constructors

<init>

Returns an asynctask that handles search and filtering of gyms based on search parameters

SearchGym(activity: Activity, callback: OnComplete, searchParams: GymSearchBy, userLocaltion: LatLng)

Properties

actRef

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

val actRef: WeakReference<Activity!>

callback

OnComplete Callback that is called when the task completes

val callback: OnComplete

searchParams

GymSearchBy The search parameters to filter gyms by

val searchParams: GymSearchBy

userLocaltion

LatLng The current location of the user

val userLocaltion: LatLng

Functions

doInBackground

Internal background function to run the search in the background

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

furtherProcessing

Further filtering done when we retrieved data from Firebase Firestore DB such as reviews and favourite counts

fun furtherProcessing(fav: HashMap<String, FavGymFirestore>, ratings: HashMap<String, GymRatingStats>, gymList: GymList, activity: Activity): Unit