Commit e217fd9a authored by sshivam95's avatar sshivam95

Venter: clean the changes for merge

parent 346905ff
package app.insti;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import java.util.ArrayList;
import java.util.Random;
......@@ -13,22 +18,6 @@ public class TagClass {
public TagClass(String name) {
this.name = name;
this.color = getRandomColor();
}
public String getRandomColor() {
ArrayList<String> colors = new ArrayList<>();
colors.add("#ED7D31");
colors.add("#00B0F0");
colors.add("#FF0000");
colors.add("#D0CECE");
colors.add("#00B050");
colors.add("#9999FF");
colors.add("#FF5FC6");
colors.add("#FFC000");
colors.add("#7F7F7F");
colors.add("#4800FF");
return colors.get(new Random().nextInt(colors.size()));
}
public String getName() {
......@@ -38,12 +27,4 @@ public class TagClass {
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
\ No newline at end of file
......@@ -90,20 +90,9 @@ public class CommentRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
try {
textViewName.setText(comment.getUser().getUserName());
} catch (Exception e) {
e.printStackTrace();
}
try {
String time = DateTimeUtil.getDate(comment.getTime().toString());
Log.i(TAG, "time: " + time);
Log.i(TAG, "inside try");
textViewCommentTime.setText(time);
} catch (Exception e) {
Log.i(TAG, "Inside catch");
e.printStackTrace();
}
try {
textViewComment.setText(comment.getText());
} catch (Exception e) {
e.printStackTrace();
......
......@@ -86,50 +86,23 @@ public class ComplaintsRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
Venter.Complaint complaint = complaintList.get(position);
try {
textViewDescription.setText(complaint.getDescription());
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewLocation.setText(complaint.getLocationDescription());
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewUserName.setText(complaint.getComplaintCreatedBy().getUserName());
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewStatus.setText(complaint.getStatus().toUpperCase());
if (complaint.getStatus().equalsIgnoreCase("Reported")) {
textViewStatus.setBackgroundColor(Color.parseColor("#FF0000"));
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorRed));
textViewStatus.setTextColor(context.getResources().getColor(R.color.primaryTextColor));
} else if (complaint.getStatus().equalsIgnoreCase("In Progress")) {
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorSecondary));
textViewStatus.setTextColor(context.getResources().getColor(R.color.secondaryTextColor));
} else if (complaint.getStatus().equalsIgnoreCase("Resolved")) {
textViewStatus.setBackgroundColor(Color.parseColor("#00FF00"));
textViewStatus.setBackgroundColor(context.getResources().getColor(R.color.colorGreen));
textViewStatus.setTextColor(context.getResources().getColor(R.color.secondaryTextColor));
}
} catch (Exception e) {
e.printStackTrace();
}
try {
String time = DateTimeUtil.getDate(complaint.getComplaintReportDate().toString());
Log.i(TAG, "time: " + time);
textViewReportDate.setText(time);
} catch (Exception e) {
e.printStackTrace();
}
try {
buttonComments.setText("COMMENTS(" + complaint.getComment().size() + ")");
} catch (Exception e) {
e.printStackTrace();
}
try {
buttonVotes.setText("UP VOTES(" + complaint.getUsersUpVoted().size() + ")");
} catch (Exception e) {
e.printStackTrace();
......
......@@ -175,30 +175,11 @@ public class DetailedComplaintFragment extends Fragment {
private void populateViews() {
try {
textViewUserName.setText(detailedComplaint.getComplaintCreatedBy().getUserName());
} catch (Exception e) {
e.printStackTrace();
}
try {
String time = DateTimeUtil.getDate(detailedComplaint.getComplaintReportDate().toString());
Log.i(TAG, " time: " + time);
Log.i(TAG, "inside try");
textViewReportDate.setText(time);
} catch (Exception e) {
Log.i(TAG, "Inside catch");
e.printStackTrace();
}
try {
textViewLocation.setText(detailedComplaint.getLocationDescription());
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewDescription.setText(detailedComplaint.getDescription());
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewStatus.setText(detailedComplaint.getStatus().toUpperCase());
if (detailedComplaint.getStatus().equalsIgnoreCase("Reported")) {
textViewStatus.setBackgroundColor(Color.parseColor("#FF0000"));
......@@ -210,25 +191,9 @@ public class DetailedComplaintFragment extends Fragment {
textViewStatus.setBackgroundColor(Color.parseColor("#00FF00"));
textViewStatus.setTextColor(getResources().getColor(R.color.secondaryTextColor));
}
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewCommentLabel.setText("COMMENTS");
} catch (Exception e) {
e.printStackTrace();
}
try {
textViewVoteUpLabel.setText("UP VOTES");
} catch (Exception e) {
e.printStackTrace();
}
try {
addVotesToView(detailedComplaint);
} catch (Exception e) {
e.printStackTrace();
}
try {
addCommentsToView(detailedComplaint);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -535,7 +535,6 @@ public class FileComplaintFragment extends Fragment {
for (int i = 0; i < tagList2.size(); i++) {
tag = new Tag(tagList2.get(i).getName());
tag.radius = 10f;
tag.layoutColor = Color.parseColor(tagList2.get(i).getColor());
tag.isDeletable = true;
tags.add(tag);
}
......@@ -552,7 +551,6 @@ public class FileComplaintFragment extends Fragment {
tagsLayout.setVisibility(View.VISIBLE);
tag = new Tag(tagList.get(i).getName());
tag.radius = 10f;
tag.layoutColor = Color.parseColor(tagList.get(i).getColor());
tag.isDeletable = false;
tags.add(tag);
}
......
......@@ -12,6 +12,8 @@
<color name="colorGray">#757575</color>
<color name="colorWhite">#FFFFFF</color>
<color name="colorRed">#FF0000</color>
<color name="colorGreen">#00FF00</color>
<!-- Map -->
<item name="transparent_black" type="color">#20000000</item>
<item name="list_item_gray_even" type="color">#ffe6e6e6</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment