Open khaledkhj opened 8 years ago
@khaledkhj You can use Recyclerview with ViewHolder to handle labelview.
I am still trying, but didn't work. this is how I implemented it
LabelView label = new LabelView(context); label.setText(value); label.setBackgroundColor(Color.parseColor(color)); label.setTargetView(row, 15, LabelView.Gravity.RIGHT_TOP, 20);
the above code is being used in ViewHolder class.
Any idea how should I use it !!
It have noted in tutorial:
LabelView in BaseAdpter if you using LabelView in BaseAdpter and reuse of convertView, you have to generate label ID manual. eg:
public View getItemView(int position, View convertView, ViewHolder holder) {
......
// you have to generate label ID manual
LabelView label = holder.getView(12345);
if (label == null) {
label = new LabelView(this);
label.setId(12345);
label.setBackgroundColor(0xffE91E63);
label.setTargetViewInBaseAdapter(imageView, 138, 10, LabelView.Gravity.LEFT_TOP);
}
label.setText(your data);
return convertView;
}
You can see example use this lib with recycler view here: http://pastebin.com/6dQmiHnk
Thanks for this great lib and I am trying to using it in recyclerview but it randomly changes labels' places as you scroll up and down. So could you please help in this?
Thanks in advanced.