Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use it without databinding ? #1

Open
ahmadmssm opened this issue Jan 30, 2021 · 4 comments
Open

Can we use it without databinding ? #1

ahmadmssm opened this issue Jan 30, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@ahmadmssm
Copy link

No description provided.

@RaviKoradiya RaviKoradiya added the enhancement New feature or request label Feb 1, 2021
@RaviKoradiya RaviKoradiya self-assigned this Feb 1, 2021
@RaviKoradiya
Copy link
Owner

@ahmadmssm
I will try to add it in the next version and release it soon.

@ahmadmssm
Copy link
Author

Thanks, I will wait for this feature.

@RaviKoradiya
Copy link
Owner

@ahmadmssm
try version 1.3.4-alpha for implementation without data-binding.

    val dummyList = listOf<Any>(1, "Test Item 2", 4.5, 7, 5.8, "Dummy Item 3")

    LiveAdapter(dummyList)
            .map<Int>(R.layout.item_rv) {
                onBind {
                    it.binding.getViewById<TextView>(R.id.text_item_label)?.text = "Int Item ${it.binding.data}"
                }
            }
            .map<Double>(R.layout.item_rv) {
                onBind {
                    it.binding.getViewById<TextView>(R.id.text_item_label)?.text = "Float Item ${it.binding.data}"
                }
            }
            .map<String>(R.layout.item_rv) {
                onBind {
                    it.binding.getViewById<TextView>(R.id.text_item_label)?.text = it.binding.data
                }
            }
            .into(findViewById(R.id.rv_dummy))

If you are using kotlin, Don't forget to add apply plugin: 'kotlin-kapt' at the top section and
kapt 'com.android.databinding:compiler:GRADLE_PLUGIN_VERSION' in dependencies block of the module's build.gradle file.

@RaviKoradiya
Copy link
Owner

@ahmadmssm
let me know if you face any issues with it.
I will move this version to stable and close this issue after a week from now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants