OnBind
of recyclervIEW:-
@Override
public void onBindViewHolder(final ItemViewHolder holder, final int position)
{
holder. tv_bill_no.setText(context.getString(R.string.bill_no_display ,
String.valueOf(12)) );
holder.tv_total_amt_label.setBackground(context.getResources().getDrawable(R.drawable.textline));
holder.lv_product_sub_totals.setEmptyView(holder.emptyview);
Typeface typeface=Typeface.createFromAsset(context.getAssets(),"Capture_it.ttf");
holder.tv_dist_name.setTypeface(typeface);
holder.tv_generate.setTypeface(typeface);
holder.btn_generate_pdf.setVisibility(View.GONE);
// itemView.setVisibility(View.GONE);
holder.btn_generate.setVisibility(View.GONE);
holder.btn_share.setVisibility(View.GONE);
holder.ll.setDrawingCacheEnabled(true);
// ImageView iv = (ImageView) rootview.findViewById(R.id.bdf_iv_bill);
Bitmap bm = Utility.screenShot(holder.ll);
bitmap_pdf_pages.add(bm);
Log.e("width",""+holder.ll.getWidth());
}
Its throwing an error
java.lang.IllegalArgumentException: width and height must be > 0
What I am doing is in OnBind
i am taking a screenshot
of each view and adding it ta ArrayList<Bitmap>
but I am unable to do so. I want a solution where I can take the screenshots
of views
of a listview
separately not in a single go. Others opinions are accepted.