app / sg.edu.ntu.scse.cz2006.gymbuddies.adapter / GymReviewAdapter

GymReviewAdapter

class GymReviewAdapter : Adapter<ReviewViewHolder>

Recycler Adapter for Gym Reviews For sg.edu.ntu.scse.cz2006.gymbuddies.adapter in Gym Buddies!

Author
Kenneth Soh

Since
2019-10-12

Types

ReviewViewHolder

Inner class to store the review data in

inner class ReviewViewHolder : ViewHolder

Constructors

<init>

Creates a adapter for the Gym Reviews List RecyclerView

GymReviewAdapter(activity: Activity, reviews: List<GymRatings>)

Properties

actRef

val actRef: WeakReference<Activity!>

reviewList

List The list of all reviews for the specific gym

var reviewList: List<GymRatings>

Functions

getItemCount

Gets the number of gyms stored in this adapter

fun getItemCount(): Int

getList

Gets the gym list stored in this adapter

fun getList(): List<GymRatings>

onBindViewHolder

Internal function to bind the view holder at the current RecyclerView position to a specific data

fun onBindViewHolder(holder: ReviewViewHolder, position: Int): Unit

onCreateViewHolder

Creates the required View Holder to store the data in

fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ReviewViewHolder