RecyclerView change item layout on click
<p>I have this list-view like Activity:</p>

<p><a href="https://i.stack.imgur.com/GADEN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GADEN.jpg" alt="enter image description here"></a></p>

<p>I want to change the item layout on click like this:</p>

<p><a href="https://i.stack.imgur.com/y05cS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y05cS.jpg" alt="enter image description here"></a></p>

<p>My RecycleView Adapter:
      public class ComenziViewAdapter extends RecyclerView.Adapter {</p>

<pre><code>private final List&lt;Comanda&gt; mValues;
private final ComenziFragment.OnListFragmentInteractionListener listener;
public ComenziViewAdapter(List&lt;Comanda&gt; items, ComenziFragment.OnListFragmentInteractionListener listener) {
    mValues = items;
    this.listener = listener;
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.fragment_comenzi, parent, false);
    View expandedView = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.fragment_comenzi_expanded,parent,false);

    return new ViewHolder(view,expandedView);
}

@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
    holder.mItem = mValues.get(position);
    holder.mIdView.setText(""+mValues.get(position).getId());
    holder.mContentView.setText(mValues.get(position).getTraseu());

    holder.mView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            holder.setView(holder.getExpandedView());

            listener.onListFragmentInteraction(holder.mItem);
        }
    });
}

@Override
public int getItemCount() {
    return mValues.size();
}

public class ViewHolder extends RecyclerView.ViewHolder {
    public View mView;
    public View expandedView;
    public TextView mIdView;
    public TextView mContentView;
    public Comanda mItem;

    public ViewHolder(View view,View expandedView) {
        super(view);
        mView = view;
        this.expandedView = expandedView;
        mIdView = (TextView) view.findViewById(R.id.id);
        mContentView = (TextView) view.findViewById(R.id.content);
    }
    public View getView()
    {
        return this.mView;
    }
    public void setView(View view)
    {
        mView = view;
    }
    public View getExpandedView()
    {
        return this.expandedView;
    }
    @Override
    public String toString() {
        return super.toString() + " '" + mContentView.getText() + "'";
    }
}
</code></pre>

<p>}</p>

<p>How can I change the layout when users click on item ?</p>