Switch order of literals to prevent NullPointerException (#4)

Co-authored-by: pixeebot[bot] <23113631+pixeebot@users.noreply.github.com>
This commit is contained in:
pixeebot[bot]
2023-09-22 08:24:09 -04:00
committed by Hosted Weblate
parent aae1a4d65d
commit 83445cfde0
6 changed files with 12 additions and 12 deletions
@@ -245,7 +245,7 @@ public class TrackListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
String category = activityType == null ? activityTypeLocalized : null;
String categoryDescription = StringUtils.getCategoryDescription(category, description);
viewBinding.trackListItemCategoryDescription.setText(categoryDescription);
viewBinding.trackListItemCategoryDescription.setVisibility(categoryDescription.equals("") ? View.GONE : View.VISIBLE);
viewBinding.trackListItemCategoryDescription.setVisibility("".equals(categoryDescription) ? View.GONE : View.VISIBLE);
setSelected(selection.get(getLayoutPosition()));
}
@@ -44,8 +44,8 @@ public class RecordingLayoutIO {
private static DataField fromCSV(String[] fieldParts, @NonNull Resources resources) {
return new DataField(
fieldParts[0],
fieldParts[1].equals(YES_VALUE),
fieldParts[2].equals(YES_VALUE),
YES_VALUE.equals(fieldParts[1]),
YES_VALUE.equals(fieldParts[2]),
fieldParts[0].equals(resources.getString(R.string.stats_custom_layout_coordinates_key)));
}