zahid-ali-shah / SignatureView

SignatureView is an open source Android library which allow developers to produce pen and paper like effect for creating signatures on Android
Apache License 2.0
243 stars 68 forks source link

Recyclerview bug when signature view is rendered #17

Open titosobabas opened 4 years ago

titosobabas commented 4 years ago

I have a recycler view and i'm implementing a signature in each item

imagen But i'm getting this behaivor:

imagen

I can't capture in each item of the recycler view the signature and seems it's duplicating and having some kind of bug. Any help?

I drop here my adapter code:

public class PersonaAdapter extends RecyclerView.Adapter<PersonaAdapter.ViewHolder> {

    public ArrayList<PersonasClass> personas;
    public Context context;

    public PersonaAdapter(ArrayList<PersonasClass> personas, Context context) {
        this.personas = personas;
        this.context = context;
    }

    @NonNull
    @Override
    public PersonaAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
        Context context = viewGroup.getContext();
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        View v = layoutInflater.inflate(R.layout.item_personsa, viewGroup, false);
        PersonaAdapter.ViewHolder viewHolder = new PersonaAdapter.ViewHolder(v);

        return viewHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull PersonaAdapter.ViewHolder viewHolder, int i) {
        viewHolder.number_element.setText((i+1) + ".");
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public int getItemCount() {
        return personas.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        public EditText full_name, email, phone;
        public TextView number_element;
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            full_name = (EditText) itemView.findViewById(R.id.full_name);
            email = (EditText) itemView.findViewById(R.id.email);
            phone = (EditText) itemView.findViewById(R.id.phone);
            number_element = (TextView) itemView.findViewById(R.id.number_element);
            SignatureView signatureView = (SignatureView) itemView.findViewById(R.id.signature_view);
        }
    }
}
Jeela13 commented 3 years ago

I also face this issue but I can't found any solution.

anamikapainuly commented 2 years ago

Me too..ANy luck with this?

mehrankasebvatan commented 2 years ago

still no solution? :)