com.example.instilostandfound

## Class NewsfeedAdaptor

- java.lang.Object
- - androidx.recyclerview.widget.RecyclerView.Adapter<NewsfeedAdaptor.myViewHolder>
  - - com.example.instilostandfound.NewsfeedAdaptor

    public class NewsfeedAdaptor
    extends androidx.recyclerview.widget.RecyclerView.Adapter<NewsfeedAdaptor.myViewHolder>

Adapter class for news feed

### Nested Class Summary

Nested Classes
`class` `NewsfeedAdaptor.myViewHolder` Creates recycler view for viewing item image and the title
`static interface` `NewsfeedAdaptor.OnItemClickListener` Implements item on click methods on the recycler view

### Constructor Summary

Constructors
Constructor and Description
`NewsfeedAdaptor(android.content.Context context, java.util.List<CreateFoundObject> uploads)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getItemCount()` Gets the count of total data /objects
`void` `onBindViewHolder(NewsfeedAdaptor.myViewHolder holder, int position)` Sets the image uri onto the view
`NewsfeedAdaptor.myViewHolder` `onCreateViewHolder(android.view.ViewGroup parent, int viewType)` Creates view holder for adapter class
`void` `setOnItemClickListener(NewsfeedAdaptor.OnItemClickListener listener)` Declaration for on click listener

### Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter

`bindViewHolder, createViewHolder, getItemId, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### NewsfeedAdaptor

    public NewsfeedAdaptor(android.content.Context context,
                           java.util.List<CreateFoundObject> uploads)

### Method Detail

#### onCreateViewHolder

    @NonNull
    public NewsfeedAdaptor.myViewHolder onCreateViewHolder(@NonNull
                                                                    android.view.ViewGroup parent,
                                                                    int viewType)

Creates view holder for adapter class

Specified by:
  `onCreateViewHolder` in class `androidx.recyclerview.widget.RecyclerView.Adapter<NewsfeedAdaptor.myViewHolder>`
Parameters:
  `parent` - default parent
  `viewType` - type
Returns:

#### onBindViewHolder

    public void onBindViewHolder(@NonNull
                                 NewsfeedAdaptor.myViewHolder holder,
                                 int position)

Sets the image uri onto the view

Specified by:
  `onBindViewHolder` in class `androidx.recyclerview.widget.RecyclerView.Adapter<NewsfeedAdaptor.myViewHolder>`
Parameters:
  `holder` - image holder view layout
  `position` - position of image

#### getItemCount

    public int getItemCount()

Gets the count of total data /objects

Specified by:
  `getItemCount` in class `androidx.recyclerview.widget.RecyclerView.Adapter<NewsfeedAdaptor.myViewHolder>`
Returns:
  count value

#### setOnItemClickListener

    public void setOnItemClickListener(NewsfeedAdaptor.OnItemClickListener listener)

Declaration for on click listener

Parameters:
  `listener` - listener