Comments (8)
pseudo code :
public final static class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.RecyclerHolder> {
private final List<Object> list = new ArrayList<>();
private final ExpansionLayoutCollection expansionsCollection = new ExpansionLayoutCollection();
public RecyclerAdapter(){
expansionsCollection.openOnlyOne(true);
}
@Override
public RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return RecyclerHolder.buildFor(parent);
}
@Override
public void onBindViewHolder(RecyclerHolder holder, int position) {
holder.bind(list.get(position));
expansionsCollection.add(holder.getExpansionLayout());
}
@Override
public int getItemCount() {
return list.size();
}
public void setItems(List<Object> items) {
this.list.addAll(items);
notifyDataSetChanged();
}
public final static class RecyclerHolder extends RecyclerView.ViewHolder {
private static final int LAYOUT = R.layout.recycler_cell;
@BindView(R.id.expansion)
ExpansionLayout expansionLayout;
public static RecyclerHolder buildFor(ViewGroup viewGroup){
return new RecyclerHolder(LayoutInflater.from(viewGroup.getContext()).inflate(LAYOUT, viewGroup, false));
}
public RecyclerHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bind(Object object){
}
public ExpansionLayout getExpansionLayout(){
return expansionLayout;
}
}
}
from expansionpanel.
I updated my sample
from expansionpanel.
you can do it with the ExpansionLayoutCollection ? didn't try
save the ExpansionLayoutCollection object into your recycler and add in it the ExpansionLayouts from viewholder
from expansionpanel.
can you send to me code?
i download your project and test on it. can you edit your code for this feature know?
please, because i really need your library with this feature know
pleaseee
from expansionpanel.
hey my friend i wait for your answer , because now need this feature in project
from expansionpanel.
haven't tested
from expansionpanel.
If it does not work, you can make a pull request to fix it ;)
from expansionpanel.
wow! it's woooooooooork 💋 💋 ❤️ thanks my friend for your great libraries ❤️
from expansionpanel.
Related Issues (20)
- app:expansion_openOnlyOne="true" 没有效果,咋办呀?
- scroll to bottom : when click on ExpansionLayout
- Manifest error After add to project HOT 1
- NestedScrollView isn't scolling when start scrolling on ExpansionHeader (the scroll event isn't triggered)
- problem with expansion panel in recyclerview HOT 3
- Expand upward
- Expandblelayout won`t take as much place as it should take
- Remove listener when used in adapter
- Add an option to not set click listener on the header by default HOT 1
- ExpansionPanel problem in recyclerview
- Change expansion and collapse image on ExpansionHeader? HOT 1
- is it possible to perform click listener header_indication?
- [BUG] Broken in RecyclerView+SwipeRefreshLayout HOT 2
- CollapseAll
- onSaveInstanceState don't save the state of ExpansionLayout HOT 1
- Expension panel
- Arrow content
- Moving to MavenCentral HOT 3
- Cutting content when expanding
- ExpansionLayout content is scrolled, how can I turn it off? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expansionpanel.