/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * * This gets called when each new ViewHolder is created. This happens when the RecyclerView * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling. * * @param viewGroup The ViewGroup that these ViewHolders are contained within. * @param viewType If your RecyclerView has more than one type of item (which ours doesn't) you * can use this viewType integer to provide a different layout. See * {android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)} * for more details. * @return A new ArticleViewHolder that holds the View for each list item */ @Override public ArticleViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { Context context = viewGroup.getContext(); int layoutIdForListItem = R.layout.selector_list_item; LayoutInflater inflater = LayoutInflater.from(context); boolean shouldAttachToParentImmediately = false; View view = inflater.inflate(layoutIdForListItem, viewGroup, shouldAttachToParentImmediately); ArticleViewHolder viewHolder = new ArticleViewHolder(view); return viewHolder; }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }
/** * Called whenever a user clicks on an item in the list. * @param v The View that was clicked */ @Override public void onClick(View v) { int clickedPosition = getAdapterPosition(); mOnClickListener.onListItemClick(clickedPosition); } }