linisme / SlimAdapter

A slim & clean & typeable Adapter without# VIEWHOLDER
https://raw.githubusercontent.com/MEiDIK/SlimAdapter/master/SlimAdapter.jpg
MIT License
931 stars 117 forks source link

checkbox position issue #13

Closed haris15 closed 7 years ago

haris15 commented 7 years ago

i have add checkbox in user_item checkbox position is change on scroll how to solve it please help.

and also how to get position on item is click or select

haris15 commented 7 years ago

please reply how to get position of item on click

bluemix commented 7 years ago

the same here, how to know the item's position? thanks in advance...

linisme commented 7 years ago

sorry for reply so late..i am a little busy recently...

maybe this code would help:

(in kotlin)

        SlimAdapter.create()
                .register<SlimPickerImage>(R.layout.item_image_picker) { data, injector ->
                    injector
                            .image(R.id.image, data.originalPath)
                            .with<SmoothCheckBox>(R.id.checkbox) { view ->
                                view.setOnCheckedChangeListener { _, isChecked ->
                                    if (isChecked) {
                                        if (selectedData.add(data)) onSelectedDataChanged()
                                    } else {
                                        if (selectedData.remove(data)) onSelectedDataChanged()
                                    }
                                }
                            }
                            .checked(R.id.checkbox, selectedData.contains(data))
                }
                .enableDiff()
                .attachTo(recyclerView)

if not work, please show me some codes with the problem??

sorry again

haris15 commented 7 years ago

thanks my problem its solved thanks for a great library.