In my android firebase chat app, I want to use recyclerview to display chatlist according to the type of message i.e either incoming or outgoing

Let me first tell you the firebase data structure

```
<ConversationId>
    <MsgId>
       text :"Hello"
       timestamp :<timestamp>
       sender :<sender's uid>
       receiver :<receiver's uid>

```

Following is my adapter class 

```
public class MultiViewTypeAdapter  extends RecyclerView.Adapter {

        private List<SingleChatList> chatList;
        int total_types;

        public class incoming extends RecyclerView.ViewHolder
        {
            public TextView message,time;
            //public CircleImageView dp;

            public incoming(View view)
            {
                super(view);
                message=(TextView)view.findViewById(R.id.message_text);
                time=(TextView)view.findViewById(R.id.timestamp_text);
            }
        }

        public class outgoing extends RecyclerView.ViewHolder
        {
            public TextView message,time;
            //public CircleImageView dp;

            public outgoing(View view)
            {
                super(view);
                message=(TextView)view.findViewById(R.id.message_text_view);
                time=(TextView)view.findViewById(R.id.timestamp_text_view);
            }
        }

        public MultiViewTypeAdapter(List<SingleChatList> data) {
            this.chatList = data;
            total_types = chatList.size();
        }

        @Override
        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

            View view;
            switch (viewType) {
                case 0:
                    view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_incoming_bubble, parent, false);
                    return new incoming(view);
                case 1:
                    view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_outgoing_bubble, parent, false);
                    return new outgoing(view);

            }
            return null;
        }
        @Override
        public int getItemViewType(int position) {

            int swi=0;
            if(chatList.get(position).getSender()== FirebaseAuth.getCurrentUser().getUid())
            {
                swi=1;
            }
            else
            {
                swi=0;
            }
            return swi;

        }
        @Override
        public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int listPosition) {

            SingleChatList chat=chatList.get(listPosition);

            if (chat != null) {
                int swi=0;
                if(chat.getSender()== FirebaseAuth.getCurrentUser().getUid())
                {
                    swi=1;
                }
                else
                {
                    swi=0;
                }
                switch (swi) {
                    case 0:
                        ((incoming) holder).message.setText(chat.getMsg());
                        ((incoming) holder).time.setText(String.valueOf(chat.getTimestamp()));

                        break;
                    case 1:
                        ((outgoing) holder).message.setText(chat.getMsg());
                        ((incoming) holder).time.setText(String.valueOf(chat.getTimestamp()));
                        break;

                }
            }
        }

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

```

Here, I am deciding viewtype using following logic

```
senderuid== FirebaseAuth.getCurrentUser().getUid();

```

If above condition is true then it should be an outgoing message.

I run above code, but nothing changes for all messages only incoming msg layout is applying