class StringRecyclerAdapter : Adapter<StringViewHolder>
Recycler Adapter for Strings of text For sg.edu.ntu.scse.cz2006.gymbuddies.adapter in Gym Buddies!
Author
Kenneth Soh
Since
2019-09-17
StringViewHolder |
Inner class to store the string data in inner class StringViewHolder : ViewHolder, OnClickListener |
<init> |
Creates a adapter for the Gym Favourites List RecyclerView StringRecyclerAdapter(string: List<String>) StringRecyclerAdapter(string: List<String>, announce: Boolean) |
announce |
Boolean Whether to display a toast message in onClick or not var announce: Boolean |
onClickListener |
OnClickListener? Set this to override the default onClick listener defined in StringRecyclerAdapter.StringViewHolder.onClick var onClickListener: OnClickListener? |
stringList |
List The list of all strings to display var stringList: List<String> |
getItemCount |
Gets the number of strings stored in this adapter fun getItemCount(): Int |
onBindViewHolder |
Internal function to bind the view holder at the current RecyclerView position to a specific data fun onBindViewHolder(holder: StringViewHolder, position: Int): Unit |
onCreateViewHolder |
Creates the required View Holder to store the data in fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StringViewHolder |
setOnClickListener |
Overrides the default on click listener fun setOnClickListener(listener: OnClickListener): Unit |
updateStrings |
Updates internal string list fun updateStrings(newString: List<String>): Unit |