Git Product home page Git Product logo

natario1 / elements Goto Github PK

View Code? Open in Web Editor NEW
82.0 4.0 5.0 1.52 MB

⚒ Modular components for RecyclerView development enforcing clean, reusable and testable code, with built-in support for paging and complex hierarchies of data.

Home Page: https://natario1.github.io/Elements

License: Apache License 2.0

Kotlin 100.00%
android recyclerview recyclerview-adapter recyclerview-section recyclerview-header list android-recyclerview android-recycler android-recyclerview-pagination pagination

elements's People

Contributors

natario1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elements's Issues

Hi! - sponsoring Elements development

Hi! 👋

I am Mattia, the main developer and maintainer here, and I have enabled the GitHub Sponsor button on this repository which will let you support the library development by sponsoring my open source work through GitHub itself.

In the last years, I have spent countless unpaid hours on this and other projects, designing and developing tools that solve real problems, for everyone to use. I am very happy to know that companies of all sizes benefit from my work everyday.

GitHub is now offering you the opportunity to thank back with a sponsorship. For individuals, it could be a small amount. For companies that are powered by my tools, it could be a fairly small percentage of their revenue. In any case, your support will be greatly appreciated (and for bigger amounts, you get things like private support hours, or something else if you prefer).

https://github.com/sponsors/natario1

I will experiment leaving this as a pinned issue - for a while at least - since it's where people are most likely to see it. Sorry if this bothers you, and thank you all for your help.

Loading/Empty presenters not shown?

First of all, thank you for Elements - while I'm just starting to evaluate it, it looks quite nice and I hope to be able to contribute some features in the future.

As for now:

        val adapter = Adapter.builder(this)
                .addSource(Source.fromLiveData(viewModel.conversationsLiveData))
                .addPresenter(ConversationsPresenter(context, ::onElementClick))
                .addPresenter(Presenter.forLoadingIndicator(context, R.layout.loading_state))
                .addPresenter(Presenter.forEmptyIndicator(context, R.layout.message_state))
                .addPresenter(Presenter.forErrorIndicator(context, R.layout.message_state) { view, throwable ->
                    view.messageStateTextView.setText(R.string.nc_oops)
                    view.messageStateImageView.setImageDrawable(context.getDrawable(drawable.ic_announcement_white_24dp))
                })
                .into(view.recyclerView)

This is the code I have. Unfortunately neither the loading nor the empty states (when live data is empty) ever appear (even though they should). Any ideas?

Pager two-ways?

From what I can understand the docs, the pager would fire when you reach the bottom. Can I have it fire when it reaches top as well, and if I can, how?

Thanks in advance for your assistance!

Feedback

As some of you start to discover and use this, I'd like to get any kind of feedback from you!
If you have some, please comment here.

View Recycling Question.

How do I?

Is there any way to listen to onViewRecycled to unbind the data from viewholder in presenter or anywhere? Am I missing something?

Version used

Library version 0.4.0

Headers are lost when updating values in LiveData

Hi! So I use MainSource through LiveData

class ContactsViewSource(private val data: LiveData<List>, private val elementType: Int = 0, loadingIndicatorsEnabled: Boolean = true, errorIndicatorEnabled: Boolean = true, emptyIndicatorEnabled: Boolean = true) : MainSource(loadingIndicatorsEnabled, errorIndicatorEnabled, emptyIndicatorEnabled) {

And unfortunately, when the livedata gets updated the headers from another source get lost. Any ideas what is causing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.