generated from NOW-SOPT-ANDROID/now-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
package com.sopt.now | ||
|
||
import android.view.View | ||
import android.widget.ImageView | ||
import android.widget.TextView | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.sopt.now.databinding.ItemFriendBinding | ||
import com.sopt.now.databinding.ItemUserBinding | ||
|
||
class FriendViewHolder(private val view: View) : RecyclerView.ViewHolder(view) { | ||
val ivProfile: ImageView = view.findViewById(R.id.iv_profile) | ||
val tvName: TextView = view.findViewById(R.id.tv_name) | ||
val tvSelfDescription: TextView = view.findViewById(R.id.tv_self_description) | ||
class FriendViewHolder(private val binding:ItemFriendBinding) : RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(friendData: HomeList) { | ||
binding.run { | ||
ivProfile.setImageResource(friendData.profileImage) | ||
tvName.text = friendData.name | ||
tvSelfDescription.text = friendData.selfDescription | ||
} | ||
} | ||
} | ||
|
||
class UserViewHolder(private val view: View) : RecyclerView.ViewHolder(view) { | ||
val ivProfile: ImageView = view.findViewById(R.id.iv_profile) | ||
val tvName: TextView = view.findViewById(R.id.tv_name) | ||
val tvSelfDescription: TextView = view.findViewById(R.id.tv_self_description) | ||
class UserViewHolder(private val binding:ItemUserBinding) : RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(friendData: HomeList) { | ||
binding.run { | ||
ivProfile.setImageResource(friendData.profileImage) | ||
tvName.text = friendData.name | ||
tvSelfDescription.text = friendData.selfDescription | ||
} | ||
} | ||
} |