use of android.support.annotation.RequiresApi in project HumaneApp by Ganesh1010.
the class NeedReceivalCard method onBindViewHolder.
@RequiresApi(api = Build.VERSION_CODES.ECLAIR_MR1)
@Override
public void onBindViewHolder(final NeedCardHolder holder, int position) {
/*DonationDetails items = (DonationDetails) donatedCardDetails.get(position);
holder.itemName.setText(items.getItemName());
holder.donorName.setText(items.getDonorName());
holder.quantity.setText(items.getQuantity());
*/
DonationDetails items = (DonationDetails) donatedCardDetails.get(position);
holder.donorName.setText(items.getUser());
Toast.makeText(context, "donor Name" + items.getUser(), Toast.LENGTH_LONG).show();
donatedItem = items.getDonatedItemDetails();
needId = donatedItem.getDonated_item_id();
needQuantity = donatedItem.getQuantity();
needItemDetails = new NeedItemDetails(needId, needQuantity);
needItems = new ArrayList<>();
needItems.add(needItemDetails);
Toast.makeText(context, "size" + needItems.size(), Toast.LENGTH_LONG).show();
// needItemDetails.setNeed_item_id(needId);
//needItemDetails.setQuantity(needQuantity);
///needItemDetails = new DonatedItemDetails(2,100);
//needItems = new ArrayList();
// needItems.add(needItemDetails);
// holder.itemName.setText(donatedItem.getDonated_item_id());
// holder.quantity.setText(donatedItem.getQuantity());
holder.itemName.setText("1");
holder.quantity.setText("123");
// Toast.makeText(context,"Quantity"+donatedItem.getQuantity(),Toast.LENGTH_LONG).show();
holder.donatedItemDetails.setAdapter(adapter);
//Toast.makeText(context,"after adapter",Toast.LENGTH_LONG).show();
holder.donatedItemDetails.setLayoutManager(new LinearLayoutManager(context));
// Toast.makeText(context,"donor NAme"+items.getItemName(),Toast.LENGTH_LONG).show();*/
holder.listImg.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(context," list image",Toast.LENGTH_LONG).show();
if (holder.layout.getVisibility() == View.GONE) {
holder.layout.setVisibility(View.VISIBLE);
holder.cardListHeading.setVisibility(View.VISIBLE);
} else {
holder.layout.setVisibility(View.GONE);
holder.cardListHeading.setVisibility(View.GONE);
}
}
});
}
Aggregations