public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { switch ((ViewType)viewType) { case ViewType.Post: { var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_description_item, parent, false); var vh = new PostDescriptionViewHolder(itemView, (post) => CommentAction?.Invoke(ActionType.Profile, post), TagAction); return vh; } default: { var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_comment_item, parent, false); var vh = new CommentViewHolder(itemView, CommentAction, RootClickAction); return vh; } } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { switch ((ViewType)viewType) { case ViewType.Post: { var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_description_item, parent, false); var vh = new PostDescriptionViewHolder(itemView, UserAction, TagAction); return(vh); } default: { var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_comment_item, parent, false); var vh = new CommentViewHolder(itemView, LikeAction, UserAction, VotersClick, FlagAction, HideAction, ReplyAction, DeleteAction, RootClickAction); return(vh); } } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { switch ((ViewType)viewType) { case ViewType.Post: { var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_description_item, parent, false); var vh = new PostDescriptionViewHolder(itemView, post => CommentAction?.Invoke(ActionType.Profile, post), AutoLinkAction, RootClickAction); return(vh); } default: { var itemView = (SwipeLayout)LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.lyt_comment_item, parent, false); itemView.ClickToClose = true; itemView.SwipeEnabled = AppSettings.User.HasPostingPermission; itemView.Opening += SwipeLayoutOnOpening; var vh = new CommentViewHolder(itemView, CommentAction, AutoLinkAction, RootClickAction); return(vh); } } }