android.widget.ListView.FixedViewInfo Java Examples
The following examples show how to use
android.widget.ListView.FixedViewInfo.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 6 votes |
public void addHeaderView(View v, Object data, boolean isSelectable) { FixedViewInfo info = new ListView(getContext()).new FixedViewInfo(); info.view = v; info.data = data; info.isSelectable = isSelectable; mHeaderViewInfos.add(info); setupView(v); int topPadding = this.getPaddingTop(); if(initialTopPadding == 0){ initialTopPadding = topPadding; } this.setPadding(this.getPaddingLeft(), topPadding+v.getMeasuredHeight(), this.getPaddingRight(), this.getPaddingBottom()); // in the case of re-adding a header view, or adding one later on, // we need to notify the observer this.notifiyChanged(); }
Example #2
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 6 votes |
/** * Remove all headers * * @return true if headers were removed, false otherwise */ public boolean clearHeaders(boolean dispatchDetach) { boolean removed = false; if (!headers.isEmpty()) { FixedViewInfo[] infos = headers.toArray(new FixedViewInfo[headers .size()]); for (FixedViewInfo info : infos) { removed = super.removeHeader(info.view) || removed; if (dispatchDetach && ViewUtils.isAttachedToWindow(info.view)) { ViewUtils.callDispatchDetachedFromWindow(info.view); } } } if (removed) wrapped.notifyDataSetChanged(); return removed; }
Example #3
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 6 votes |
/** * Remove all footers * * @return true if headers were removed, false otherwise */ public boolean clearFooters(boolean dispatchDetach) { boolean removed = false; if (!footers.isEmpty()) { FixedViewInfo[] infos = footers.toArray(new FixedViewInfo[footers .size()]); for (FixedViewInfo info : infos) { removed = super.removeFooter(info.view) || removed; if (dispatchDetach && ViewUtils.isAttachedToWindow(info.view)) { ViewUtils.callDispatchDetachedFromWindow(info.view); } } } if (removed) wrapped.notifyDataSetChanged(); return removed; }
Example #4
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 6 votes |
public void addHeaderView(View v, Object data, boolean isSelectable) { FixedViewInfo info = new ListView(getContext()).new FixedViewInfo(); info.view = v; info.data = data; info.isSelectable = isSelectable; mHeaderViewInfos.add(info); setupView(v); int topPadding = this.getPaddingTop(); if(initialTopPadding == 0){ initialTopPadding = topPadding; } this.setPadding(this.getPaddingLeft(), topPadding+v.getMeasuredHeight(), this.getPaddingRight(), this.getPaddingBottom()); // in the case of re-adding a header view, or adding one later on, // we need to notify the observer this.notifiyChanged(); }
Example #5
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 6 votes |
/** * Remove all headers * * @return true if headers were removed, false otherwise */ public boolean clearHeaders(boolean dispatchDetach) { boolean removed = false; if (!headers.isEmpty()) { FixedViewInfo[] infos = headers.toArray(new FixedViewInfo[headers .size()]); for (FixedViewInfo info : infos) { removed = super.removeHeader(info.view) || removed; if (dispatchDetach && ViewUtils.isAttachedToWindow(info.view)) { ViewUtils.callDispatchDetachedFromWindow(info.view); } } } if (removed) wrapped.notifyDataSetChanged(); return removed; }
Example #6
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 6 votes |
/** * Remove all footers * * @return true if headers were removed, false otherwise */ public boolean clearFooters(boolean dispatchDetach) { boolean removed = false; if (!footers.isEmpty()) { FixedViewInfo[] infos = footers.toArray(new FixedViewInfo[footers .size()]); for (FixedViewInfo info : infos) { removed = super.removeFooter(info.view) || removed; if (dispatchDetach && ViewUtils.isAttachedToWindow(info.view)) { ViewUtils.callDispatchDetachedFromWindow(info.view); } } } if (removed) wrapped.notifyDataSetChanged(); return removed; }
Example #7
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private boolean removeFixedViewInfo(View v, ArrayList<FixedViewInfo> where) { int len = where.size(); int count = 0; for (int i = 0; i < len; ++i) { FixedViewInfo info = where.get(i); if (info.view == v) { this.setPadding(this.getPaddingLeft(), getPaddingTop()-v.getMeasuredHeight(), this.getPaddingRight(), this.getPaddingBottom()); where.remove(i); count++; break; } } return count > 0; }
Example #8
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private int getTotalHeaderHeight(){ int totalHeaderHeight = 0; for(FixedViewInfo h: mHeaderViewInfos){ totalHeaderHeight += h.view.getMeasuredHeight(); } return totalHeaderHeight; }
Example #9
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private void drawHeaders(Canvas canvas) { int startPos = -mScrollOfsset; // translate view all way up first... int saveCount = canvas.save(); for(FixedViewInfo header: mHeaderViewInfos){ View view = header.view; canvas.translate(0, startPos); startPos = view.getMeasuredHeight(); view.draw(canvas); } canvas.restoreToCount(saveCount); }
Example #10
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private boolean removeFixedViewInfo(View v, ArrayList<FixedViewInfo> where) { int len = where.size(); int count = 0; for (int i = 0; i < len; ++i) { FixedViewInfo info = where.get(i); if (info.view == v) { this.setPadding(this.getPaddingLeft(), getPaddingTop()-v.getMeasuredHeight(), this.getPaddingRight(), this.getPaddingBottom()); where.remove(i); count++; break; } } return count > 0; }
Example #11
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private int getTotalHeaderHeight(){ int totalHeaderHeight = 0; for(FixedViewInfo h: mHeaderViewInfos){ totalHeaderHeight += h.view.getMeasuredHeight(); } return totalHeaderHeight; }
Example #12
Source File: HeaderGridView.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private void drawHeaders(Canvas canvas) { int startPos = -mScrollOfsset; // translate view all way up first... int saveCount = canvas.save(); for(FixedViewInfo header: mHeaderViewInfos){ View view = header.view; canvas.translate(0, startPos); startPos = view.getMeasuredHeight(); view.draw(canvas); } canvas.restoreToCount(saveCount); }
Example #13
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
/** * Add footer * * @param view * @param data * @param isSelectable * @return this adapter */ public HeaderFooterListAdapter<E> addFooter(View view, Object data, boolean isSelectable) { FixedViewInfo info = list.new FixedViewInfo(); info.view = view; info.data = data; info.isSelectable = isSelectable; footers.add(info); wrapped.notifyDataSetChanged(); return this; }
Example #14
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
/** * Add header * * @param view * @param data * @param isSelectable * @return this adapter */ public HeaderFooterListAdapter<E> addHeader(View view, Object data, boolean isSelectable) { FixedViewInfo info = list.new FixedViewInfo(); info.view = view; info.data = data; info.isSelectable = isSelectable; headers.add(info); wrapped.notifyDataSetChanged(); return this; }
Example #15
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
private HeaderFooterListAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footerViewInfos, ListView view, E adapter) { super(headerViewInfos, footerViewInfos, adapter); headers = headerViewInfos; footers = footerViewInfos; list = view; wrapped = adapter; }
Example #16
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
/** * Add footer * * @param view * @param data * @param isSelectable * @return this adapter */ public HeaderFooterListAdapter<E> addFooter(View view, Object data, boolean isSelectable) { FixedViewInfo info = list.new FixedViewInfo(); info.view = view; info.data = data; info.isSelectable = isSelectable; footers.add(info); wrapped.notifyDataSetChanged(); return this; }
Example #17
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
/** * Add header * * @param view * @param data * @param isSelectable * @return this adapter */ public HeaderFooterListAdapter<E> addHeader(View view, Object data, boolean isSelectable) { FixedViewInfo info = list.new FixedViewInfo(); info.view = view; info.data = data; info.isSelectable = isSelectable; headers.add(info); wrapped.notifyDataSetChanged(); return this; }
Example #18
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 5 votes |
private HeaderFooterListAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footerViewInfos, ListView view, E adapter) { super(headerViewInfos, footerViewInfos, adapter); headers = headerViewInfos; footers = footerViewInfos; list = view; wrapped = adapter; }
Example #19
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 2 votes |
/** * Create header footer adapter * * @param view * @param adapter */ public HeaderFooterListAdapter(ListView view, E adapter) { this(new ArrayList<FixedViewInfo>(), new ArrayList<FixedViewInfo>(), view, adapter); }
Example #20
Source File: HeaderFooterListAdapter.java From Pioneer with Apache License 2.0 | 2 votes |
/** * Create header footer adapter * * @param view * @param adapter */ public HeaderFooterListAdapter(ListView view, E adapter) { this(new ArrayList<FixedViewInfo>(), new ArrayList<FixedViewInfo>(), view, adapter); }