android - How can I show the graph in recyclerview? -
public class myadapter extends snappingrecyclerview.adapter<myviewholder>{ @override public myviewholder oncreateviewholder(viewgroup parent, int viewtype) { view view = layoutinflater.from(parent.getcontext()).inflate(r.layout.adapter_recyclerview,parent,false); return new myviewholder(view); } @override public void onbindviewholder(myviewholder holder, int position) { holder.textviewtemperature.settext(items.get(position).gettemperature()); holder.textviewprecipitation.settext(items.get(position).getprecipitation()); holder.textviewhumidity.settext(items.get(position).gethumidity()); holder.textviewdirection.settext(items.get(position).getdirection()); holder.textviewwritetime.settext(items.get(position).getwritetime()); } @override public int getitemcount() { return items.size(); } } public class myviewholder extends recyclerview.viewholder { textview textviewtemperature; textview textviewprecipitation; textview textviewhumidity; textview textviewdirection; textview textviewwritetime; public myviewholder(view itemview) { super(itemview); textviewtemperature = (textview) itemview.findviewbyid(r.id.adapter_textview_temperature); textviewprecipitation = (textview) itemview.findviewbyid(r.id.adapter_textview_precipitation); textviewhumidity = (textview) itemview.findviewbyid(r.id.adapter_textview_humidity); textviewdirection = (textview) itemview.findviewbyid(r.id.adapter_textview_direction); textviewwritetime = (textview) itemview.findviewbyid(r.id.adapter_textview_writetime); } }
this code
i want draw linechart temperature data on there.
i understand recyclerview, viewholder contains items view.
but in linechart, connect each other 1 one.
i think viewholder container indepedent viewholder how can
show that.
if know that,
please me.
Comments
Post a Comment