mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
Workaround追加
This commit is contained in:
parent
0410377c77
commit
5da9e14d61
|
@ -1,5 +1,6 @@
|
||||||
package one.nem.lacerta.feature.library;
|
package one.nem.lacerta.feature.library;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -49,11 +50,14 @@ public class ListItemAdapter extends RecyclerView.Adapter<ListItemAdapter.ListIt
|
||||||
holder.description.setText(listItem.getDescription());
|
holder.description.setText(listItem.getDescription());
|
||||||
|
|
||||||
if (listItem.getTagList() != null && !listItem.getTagList().isEmpty()) {
|
if (listItem.getTagList() != null && !listItem.getTagList().isEmpty()) {
|
||||||
|
if (holder.tagGroup.getChildCount() > 0) { // ごまかし
|
||||||
|
holder.tagGroup.removeAllViews();
|
||||||
|
}
|
||||||
for (int i = 0; i < listItem.getTagList().size(); i++) {
|
for (int i = 0; i < listItem.getTagList().size(); i++) {
|
||||||
Toast.makeText(holder.tagGroup.getContext(), listItem.getTagList().get(i).getName(), Toast.LENGTH_SHORT).show();
|
|
||||||
ChipGroup chipGroup = holder.tagGroup;
|
ChipGroup chipGroup = holder.tagGroup;
|
||||||
Chip chip = new Chip(chipGroup.getContext());
|
Chip chip = new Chip(chipGroup.getContext());
|
||||||
chip.setText(listItem.getTagList().get(i).getName());
|
chip.setText(listItem.getTagList().get(i).getName());
|
||||||
|
chip.setBackgroundColor(Color.parseColor(listItem.getTagList().get(i).getColor()));
|
||||||
chipGroup.addView(chip);
|
chipGroup.addView(chip);
|
||||||
}
|
}
|
||||||
holder.tagGroup.setVisibility(View.VISIBLE);
|
holder.tagGroup.setVisibility(View.VISIBLE);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user