@@ -0,0 +1,3206 @@
+package ca.ualberta.cmput301w14t08.geochan.adapters;%0A%0Aimport java.math.RoundingMode;%0Aimport java.text.DecimalFormat;%0Aimport java.util.ArrayList;%0A%0Aimport android.content.Context;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.BaseAdapter;%0Aimport android.widget.Button;%0Aimport android.widget.TextView;%0Aimport ca.ualberta.cmput301w14t08.geochan.R;%0Aimport ca.ualberta.cmput301w14t08.geochan.models.Comment;%0Aimport ca.ualberta.cmput301w14t08.geochan.models.GeoLocation;%0A%0Apublic class FavouriteCommentsAdapter extends BaseAdapter %7B%0A    private ArrayList%3CComment%3E list;%0A    Context context;%0A    %0A    public FavouriteCommentsAdapter(ArrayList%3CComment%3E list, Context context) %7B%0A        this.list = list;%0A    %7D%0A%0A    @Override%0A    public int getCount() %7B%0A        return list.size();%0A    %7D%0A%0A    @Override%0A    public Comment getItem(int position) %7B%0A        return list.get(position);%0A    %7D%0A%0A    @Override%0A    public long getItemId(int position) %7B%0A        // TODO Auto-generated method stub%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public View getView(int position, View convertView, ViewGroup parent) %7B%0A        // TODO Auto-generated method stub%0A        Comment comment = (Comment) getItem(position);%0A        if (convertView == null) %7B%0A            LayoutInflater inflater = (LayoutInflater) context%0A                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);%0A            convertView = inflater.inflate(R.layout.thread_view_comment_0, null);%0A        %7D%0A        // Comment body%0A        TextView commentBody = (TextView) convertView%0A                .findViewById(R.id.thread_view_comment_commentBody);%0A        commentBody.setText(comment.getTextPost());%0A        // Comment creator%0A        TextView commentBy = (TextView) convertView.findViewById(R.id.thread_view_comment_commentBy);%0A        commentBy.setText(%22Posted by %22 + comment.getUser() + %22#%22 + comment.getHash());%0A        // Comment timestamp%0A        TextView commentTime = (TextView) convertView%0A                .findViewById(R.id.thread_view_comment_commentDate);%0A        commentTime.setText(comment.getCommentDateString());%0A        // Comment location%0A        TextView commentLocationText = (TextView) convertView%0A                .findViewById(R.id.thread_view_comment_locationText);%0A        GeoLocation repLocCom = comment.getLocation();%0A        if (repLocCom != null) %7B%0A            DecimalFormat format = new DecimalFormat();%0A            format.setRoundingMode(RoundingMode.HALF_EVEN);%0A            format.setMinimumFractionDigits(0);%0A            format.setMaximumFractionDigits(4);%0A%0A            commentLocationText.setText(%22Latitude: %22 + format.format(repLocCom.getLatitude())%0A                    + %22 Longitude: %22 + format.format(repLocCom.getLongitude()));%0A        %7D else %7B%0A            commentLocationText.setText(%22Error: No location found%22);%0A        %7D%0A        Button replyButton = (Button) convertView.findViewById(R.id.comment_reply_button);%0A        replyButton.setVisibility(View.GONE);%0A        %0A        Button starButton = (Button) convertView.findViewById(R.id.comment_star_button);%0A        starButton.setVisibility(View.GONE);%0A        %0A        return convertView;%0A    %7D%0A%0A%7D%0A

work on the adapter for displaying favourite comments