use of br.ufrj.caronae.models.modelsforjson.RideFiltersForJson in project caronae-android by caronae.
the class MainAct method startFilterCard.
private void startFilterCard() {
String filtersJsonString = SharedPref.getFiltersPref();
if (!filtersJsonString.equals(SharedPref.MISSING_PREF)) {
RideFiltersForJson filters = loadFilters(filtersJsonString);
String resumeLocations = filters.getResumeLocation();
String center = filters.getCenter();
String campus = filters.getCampus();
String zone = filters.getZone();
String filtering = "Filtrando: ";
SpannableString cardText;
if (!resumeLocations.equals("")) {
if (center.equals("")) {
if (campus.equals("")) {
center = "Todos os Campi";
} else {
center = campus;
}
}
if (center.equals("Todos os Campi")) {
cardText = new SpannableString(filtering + resumeLocations);
} else if (zone.equals("Todos os Bairros")) {
cardText = new SpannableString(filtering + center);
} else {
cardText = new SpannableString(filtering + center + ", " + resumeLocations);
}
cardText.setSpan(new StyleSpan(Typeface.BOLD), 0, filtering.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
filterText.setText(cardText);
filterCard.setVisibility(View.VISIBLE);
} else {
if (zone.equals("")) {
zone = "Todos os Bairros";
}
if (center.equals("")) {
if (campus.equals("")) {
center = "Todos os Campi";
} else {
center = campus;
}
}
if (center.equals("Todos os Campi")) {
cardText = new SpannableString(filtering + zone);
} else if (zone.equals("Todos os Bairros")) {
cardText = new SpannableString(filtering + center);
} else {
cardText = new SpannableString(filtering + center + ", " + zone);
}
cardText.setSpan(new StyleSpan(Typeface.BOLD), 0, filtering.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
filterText.setText(cardText);
filterCard.setVisibility(View.VISIBLE);
}
}
}
Aggregations