use of app.insti.ComplaintTag in project IITB-App by wncc.
the class FileComplaintFragment method populateTags.
private void populateTags(String cs, Boolean userAddedTag) {
if (!(cs.isEmpty())) {
tagList2.add(new ComplaintTag(cs));
ArrayList<Tag> tags = new ArrayList<>();
Tag tag;
for (int i = 0; i < tagList2.size(); i++) {
tag = new Tag(tagList2.get(i).getName());
tag.radius = 10f;
tag.isDeletable = true;
tags.add(tag);
}
tagView.addTags(tags);
for (int i = 0; i < tagList2.size(); i++) {
if (userAddedTag && tagList2.get(i).getName() == cs)
tagList2.get(i).setName(cs + " (U)");
}
} else {
linearLayoutScrollTags.setVisibility(View.INVISIBLE);
linearLayoutScrollTags.setVisibility(View.GONE);
Toast.makeText(getContext(), "Please enter some tags", Toast.LENGTH_SHORT).show();
}
}
use of app.insti.ComplaintTag in project IITB-App by wncc.
the class FileComplaintFragment method prepareTags.
private void prepareTags() {
try {
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.getTags("sessionid=" + getArguments().getString(Constants.SESSION_ID)).enqueue(new Callback<List<Venter.TagUri>>() {
@Override
public void onResponse(Call<List<Venter.TagUri>> call, Response<List<Venter.TagUri>> response) {
if (response != null && response.isSuccessful()) {
List<Venter.TagUri> tagsApiList = response.body();
tagList = new ArrayList<>();
for (int i = 0; i < tagsApiList.size(); i++) {
Venter.TagUri tagUri = tagsApiList.get(i);
ComplaintTag complaintTag = new ComplaintTag(tagUri.getTagUri());
tagList.add(complaintTag);
}
swipeContainer.setRefreshing(false);
linearLayoutAll.setVisibility(View.VISIBLE);
error_message_me.setVisibility(View.GONE);
getMapReady();
} else {
error_message_me.setVisibility(View.VISIBLE);
error_message_me.setText(getString(R.string.no_complaints));
swipeContainer.setRefreshing(false);
linearLayoutAll.setVisibility(View.GONE);
}
}
@Override
public void onFailure(Call<List<Venter.TagUri>> call, Throwable t) {
Log.i(TAG, "failure in getting Tags: " + t.toString());
swipeContainer.setRefreshing(false);
error_message_me.setVisibility(View.VISIBLE);
linearLayoutAll.setVisibility(View.GONE);
}
});
} catch (Exception e) {
e.printStackTrace();
swipeContainer.setRefreshing(false);
linearLayoutAll.setVisibility(View.GONE);
}
}
Aggregations