cleaned code
This commit is contained in:
parent
53e4a12056
commit
d8e2989b76
@ -34,14 +34,7 @@ class ServerListAdapter(private val mServers: MutableList<Server>, private val o
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: ServerViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: ServerViewHolder, position: Int) {
|
||||||
|
|
||||||
holder.bind(mServers[position])
|
holder.bind(mServers[position])
|
||||||
|
|
||||||
//
|
|
||||||
// holder.itemView.setOnLongClickListener(v -> {
|
|
||||||
// Log.v("ServerListAdapter", "setOnLongClickListener " + position);
|
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setServers(servers: List<Server>) {
|
fun setServers(servers: List<Server>) {
|
||||||
@ -51,8 +44,6 @@ class ServerListAdapter(private val mServers: MutableList<Server>, private val o
|
|||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
// getItemCount() is called many times, and when it is first called,
|
|
||||||
// mServers has not been updated (means initially, it's null, and we can't return null).
|
|
||||||
override fun getItemCount(): Int {
|
override fun getItemCount(): Int {
|
||||||
return mServers.size
|
return mServers.size
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user