Skip to content

Instantly share code, notes, and snippets.

@pedrovgs
Created October 16, 2015 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrovgs/2c822b44226f337814d3 to your computer and use it in GitHub Desktop.
Save pedrovgs/2c822b44226f337814d3 to your computer and use it in GitHub Desktop.
How to use footers and headers with Renderers
import com.pedrogomez.renderers.ListAdapteeCollection;
public class FooterAdapteeCollection<T> extends ListAdapteeCollection<T> {
private boolean showFooter;
public void showFooter() {
this.showFooter = true;
}
public void hideFooter() {
this.showFooter = false;
}
public boolean hasFooter() {
return showFooter;
}
@Override public int size() {
int size = super.size();
return hasFooter() ? size + 1 : size;
}
@Override public T get(int i) {
T item = null;
if (i < super.size()) {
item = super.get(i);
}
return item;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment