public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var layout = _isCompact ? Resource.Layout.listItemAuthCompact: Resource.Layout.listItemAuth; var itemView = LayoutInflater.From(parent.Context).Inflate(layout, parent, false); var holder = new AuthenticatorListHolder(itemView); holder.Click += ItemClick; holder.MenuClick += MenuClick; holder.RefreshClick += OnRefreshClick; return(holder); }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var layout = _viewMode switch { ViewMode.Compact => Resource.Layout.listItemAuthCompact, ViewMode.Tile => Resource.Layout.listItemAuthTile, _ => Resource.Layout.listItemAuth }; var itemView = LayoutInflater.From(parent.Context).Inflate(layout, parent, false); var holder = new AuthenticatorListHolder(itemView); holder.ItemView.Click += delegate { ItemClick.Invoke(this, holder.AdapterPosition); }; holder.MenuButton.Click += delegate { MenuClick.Invoke(this, holder.AdapterPosition); }; holder.RefreshButton.Click += delegate { OnRefreshClick(holder.AdapterPosition); }; return(holder); }