manabreak / adapt Goto Github PK
View Code? Open in Web Editor NEWGeneric RecyclerView adapter promoting simplicity and re-use
License: MIT License
Generic RecyclerView adapter promoting simplicity and re-use
License: MIT License
Make it possible to inject dependencies for bind rules. API would be something like adapter.inject(foo);
.
It's currently not possible to bind to an ImageView using Picasso/Glide unless I expose them via a public static method and reference them from within bind()
.
The library relies on the class having a no-args constructor, it would be much nicer if it allowed us to pass in the BindRule instance instead like this:
picasso = daggerComponent.providePicasso();
adapter.addType(R.layout.test_item, Test.class, new TestRule(picasso));
Here's an example of how my class was meant to be setup:
public class TestRule extends BindRule<Test> {
private final Picasso picasso;
private TextView name;
private ImageView thumb;
public TestRule(Picasso picasso) {
this.picasso = picasso;
}
@Override
public void init() {
name = find(R.id.name);
thumb = find(R.id.thumbnail);
}
@Override
public void bind(@NonNull Test test) {
name.setText(test.name());
picasso.load(test.image()).into(thumb);
}
}
Allowing users to provide their own BindRule
instance gives more flexibility regarding how the views are bound.
Are there any plans to support long clicks, drag and drop type functionalities?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.