diff --git a/app/src/main/java/com/example/cosmosclient/views/CheeseDynamicAdapter.java b/app/src/main/java/com/example/cosmosclient/views/CheeseDynamicAdapter.java index 455dddc..6f11200 100644 --- a/app/src/main/java/com/example/cosmosclient/views/CheeseDynamicAdapter.java +++ b/app/src/main/java/com/example/cosmosclient/views/CheeseDynamicAdapter.java @@ -5,13 +5,16 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ArrayAdapter; import android.widget.ImageView; +import android.widget.ListView; import android.widget.TextView; import com.example.cosmosclient.R; import org.askerov.dynamicgrid.BaseDynamicGridAdapter; +import java.util.ArrayList; import java.util.List; public class CheeseDynamicAdapter extends BaseDynamicGridAdapter { @@ -58,18 +61,28 @@ private class CheeseViewHolder { private TextView titleText; - //private TextView itemText; - + private ListView itemList; //private ImageView image; private CheeseViewHolder(View view) { titleText = (TextView) view.findViewById(R.id.item_title); - //itemText = (TextView) view.findViewById(R.id.item_list); + itemList = (ListView) view.findViewById(R.id.listview); //image = (ImageView) view.findViewById(R.id.item_img); + + ArrayList items = new ArrayList<>(); + items.add("からし"); + items.add("わさび"); + items.add("砂糖"); + + ArrayAdapter adapter = new ArrayAdapter(getContext(), R.layout.item_list, items); + itemList.setAdapter(adapter); } + + void build(String title) { titleText.setText(title); + //itemText.setText(items); //image.setImageResource(R.drawable.ic_launcher); }