@@ -0,0 +1,2277 @@
+package com.henriknero.chatapplication;%0A%0Aimport android.content.Context;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.BaseAdapter;%0Aimport android.widget.TextView;%0Aimport android.text.format.DateFormat;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by henri on 2017-03-21.%0A */%0A%0Apublic class MyListAdapter extends BaseAdapter %7B%0A%0A    Context context;%0A    List%3CChatMessage%3E messages;%0A    private static LayoutInflater inflater = null;%0A%0A    public MyListAdapter(Context context, List%3CChatMessage%3E messages)%0A    %7B%0A        this.context = context;%0A        this.messages = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C messages.size(); i++)%7B%0A            this.messages.add(new ChatMessage(messages.get(i).getMessageText(),messages.get(i).getMessageUser(),messages.get(i).getMessageTime()));%0A        %7D%0A        inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);%0A    %7D%0A    @Override%0A    public int getCount()%7B%0A        return messages.size();%0A    %7D%0A%0A    @Override%0A    public Object getItem(int position)%7B%0A        return messages.get(position);%0A    %7D%0A%0A    @Override%0A    public long getItemId(int position)%7B%0A        return position;%0A    %7D%0A%0A    @Override%0A    public View getView(int position, View convertView, ViewGroup parent)%7B%0A        View vi = convertView;%0A        if(vi == null) %7B%0A            vi = inflater.inflate(R.layout.list_item, null);%0A        %7D%0A        TextView messageText = (TextView)vi.findViewById(R.id.message_text);%0A        TextView messageUser = (TextView)vi.findViewById(R.id.message_user);%0A        TextView messageTime = (TextView)vi.findViewById(R.id.message_time);%0A        messageText.setText(messages.get(position).getMessageText());%0A        messageUser.setText(messages.get(position).getMessageUser());%0A        messageTime.setText(DateFormat.format(%22dd/MM-yy (HH:mm)%22 ,messages.get(position).getMessageTime()));%0A%0A        return vi;%0A    %7D%0A%0A    public void addListItem(ChatMessage message) %7B%0A        this.messages.add(message);%0A        this.notifyDataSetChanged();%0A    %7D%0A%0A%7D%0A/**%0A * Links that were used during process%0A * -----------------------------------%0A *http://stackoverflow.com/questions/15832335/android-custom-row-item-for-listview%0A */%0A

Create MyListAdapter.java