Skip to content

Commit

Permalink
Use localized list creation
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Oct 26, 2023
1 parent 19ec3ae commit d8131bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.content.res.AppCompatResources;
Expand All @@ -33,6 +32,7 @@
import be.ugent.zeus.hydra.common.ui.recyclerview.adapters.MultiSelectAdapter;
import be.ugent.zeus.hydra.common.ui.recyclerview.viewholders.DataViewHolder;
import be.ugent.zeus.hydra.common.utils.DateUtils;
import be.ugent.zeus.hydra.common.utils.StringUtils;
import net.cachapa.expandablelayout.ExpandableLayout;

/**
Expand Down Expand Up @@ -69,7 +69,7 @@ public void populate(EcologicalSandwich sandwich) {
name.setCompoundDrawables(null, null, null, null);
}
dates.setText(String.format(c.getString(R.string.date_between), start, end));
String ingredientsString = TextUtils.join(", ", sandwich.getIngredients());
String ingredientsString = StringUtils.formatList(sandwich.getIngredients());
ingredients.setText(String.format(c.getString(R.string.resto_sandwich_ingredients), ingredientsString));
expandableLayout.setExpanded(adapter.isChecked(getBindingAdapterPosition()), false);
itemView.setOnClickListener(v -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@

package be.ugent.zeus.hydra.wpi.tab.create;

import android.text.TextUtils;

import java.util.List;

import be.ugent.zeus.hydra.common.request.RequestException;
import be.ugent.zeus.hydra.common.utils.StringUtils;

/**
* Error when posting a transaction results in 422.
*
*
* @author Niko Strijbol
*/
public class TabRequestException extends RequestException {
private final List<String> messages;

public TabRequestException(List<String> messages) {
super(TextUtils.join(", ", messages));
super(StringUtils.formatList(messages));
this.messages = messages;
}

Expand Down

0 comments on commit d8131bf

Please sign in to comment.