Search in sources :

Example 11 with RequiresApi

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);
            }
        }
    });
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) RequiresApi(android.support.annotation.RequiresApi)

Aggregations

RequiresApi (android.support.annotation.RequiresApi)11 Handler (android.os.Handler)3 RecyclerView (android.support.v7.widget.RecyclerView)3 View (android.view.View)3 TextView (android.widget.TextView)3 DatePickerDialog (android.app.DatePickerDialog)2 Intent (android.content.Intent)2 Uri (android.net.Uri)2 Button (android.widget.Button)2 EditText (android.widget.EditText)2 LovelyCustomDialog (com.yarolegovich.lovelydialog.LovelyCustomDialog)2 DataReceiver (dz.easy.androidclient.Services.DataReceiver)2 SessionManager (dz.easy.androidclient.Util.SessionManager)2 SuppressLint (android.annotation.SuppressLint)1 IntentFilter (android.content.IntentFilter)1 ContentObserver (android.database.ContentObserver)1 Cursor (android.database.Cursor)1 Bitmap (android.graphics.Bitmap)1 BitmapFactory (android.graphics.BitmapFactory)1 Point (android.graphics.Point)1