android.widget.Filterable Java Examples

The following examples show how to use android.widget.Filterable. 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: HeaderViewListAdapter.java    From Klyph with MIT License 6 votes vote down vote up
public HeaderViewListAdapter(ArrayList<FixedViewInfo> headerViewInfos,
                             ArrayList<FixedViewInfo> footerViewInfos,
                             ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
            && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #2
Source File: PLA_HeaderViewListAdapter.java    From EverMemo with MIT License 6 votes vote down vote up
public PLA_HeaderViewListAdapter(ArrayList<PLA_ListView.FixedViewInfo> headerViewInfos,
                             ArrayList<PLA_ListView.FixedViewInfo> footerViewInfos,
                             ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
            && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #3
Source File: HeaderViewListAdapter.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
public HeaderViewListAdapter(ArrayList<StaggeredGridView.FixedViewInfo> headerViewInfos,
                             ArrayList<StaggeredGridView.FixedViewInfo> footerViewInfos,
                             ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
                    && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #4
Source File: RecipientEditTextView.java    From talk-android with MIT License 6 votes vote down vote up
@Override
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
    super.setAdapter(adapter);
    BaseRecipientAdapter baseAdapter = (BaseRecipientAdapter) adapter;
    baseAdapter.registerUpdateObserver(new BaseRecipientAdapter.EntriesUpdatedObserver() {
        @Override
        public void onChanged(List<RecipientEntry> entries) {
            // Scroll the chips field to the top of the screen so
            // that the user can see as many results as possible.
            if (entries != null && entries.size() > 0) {
                scrollBottomIntoView();
            }
        }
    });
    baseAdapter.setDropdownChipLayouter(mDropdownChipLayouter);
}
 
Example #5
Source File: TextChipsEditView.java    From talk-android with MIT License 6 votes vote down vote up
@Override
public <T extends ListAdapter & Filterable> void setAdapter(T adapter) {
    super.setAdapter(adapter);
    BaseRecipientAdapter baseAdapter = (BaseRecipientAdapter) adapter;
    baseAdapter.registerUpdateObserver(new BaseRecipientAdapter.EntriesUpdatedObserver() {
        @Override
        public void onChanged(List<RecipientEntry> entries) {
            // Scroll the chips field to the top of the screen so
            // that the user can see as many results as possible.
            if (entries != null && entries.size() > 0) {
                scrollBottomIntoView();
            }
        }
    });
    baseAdapter.setDropdownChipLayouter(mDropdownChipLayouter);
}
 
Example #6
Source File: RecipientEditTextView.java    From ChipsLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public <T extends ListAdapter & Filterable> void setAdapter(final T adapter)
  {
  super.setAdapter(adapter);
  ((BaseRecipientAdapter)adapter).registerUpdateObserver(new BaseRecipientAdapter.EntriesUpdatedObserver()
    {
      @Override
      public void onChanged(final List<RecipientEntry> entries)
        {
        // Scroll the chips field to the top of the screen so
        // that the user can see as many results as possible.
        if(entries!=null&&entries.size()>0)
          scrollBottomIntoView();
        }
    });
  }
 
Example #7
Source File: PLAHeaderViewListAdapter.java    From Lay-s with MIT License 6 votes vote down vote up
public PLAHeaderViewListAdapter(ArrayList<PLAListView.FixedViewInfo> headerViewInfos,
                                ArrayList<PLAListView.FixedViewInfo> footerViewInfos,
                                ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
            && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #8
Source File: ObservableGridView.java    From Android-ObservableScrollView with Apache License 2.0 6 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;
    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footViewInfos;
    }
    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos)
        && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #9
Source File: FooterViewGridAdapter.java    From PagingGridView with Apache License 2.0 6 votes vote down vote up
public FooterViewGridAdapter(ArrayList<HeaderGridView.FixedViewInfo> headerViewInfos,
                             ArrayList<HeaderGridView.FixedViewInfo> footerViewInfos,
                             ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;



    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #10
Source File: HeaderViewListAdapter.java    From PullToRefreshLibrary with Apache License 2.0 6 votes vote down vote up
public HeaderViewListAdapter(ArrayList<StaggeredGridView.FixedViewInfo> headerViewInfos,
                             ArrayList<StaggeredGridView.FixedViewInfo> footerViewInfos,
                             ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
                    && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #11
Source File: PLAHeaderViewListAdapter.java    From SimplifyReader with Apache License 2.0 6 votes vote down vote up
public PLAHeaderViewListAdapter(ArrayList<PLAListView.FixedViewInfo> headerViewInfos,
                                ArrayList<PLAListView.FixedViewInfo> footerViewInfos,
                                ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        mHeaderViewInfos = headerViewInfos;
    }

    if (footerViewInfos == null) {
        mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        mFooterViewInfos = footerViewInfos;
    }

    mAreAllFixedViewsSelectable =
            areAllListInfosSelectable(mHeaderViewInfos)
            && areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #12
Source File: HeaderGridView.java    From MutiPhotoChoser with Mozilla Public License 2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mFooterViewInfos = footerViewInfos;

    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) & areAllListInfosSelectable(mFooterViewInfos);
}
 
Example #13
Source File: HeaderGridView.java    From HeartbeatFixerForGCM with Apache License 2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;
    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos);
}
 
Example #14
Source File: HeaderGridView.java    From MutiPhotoChoser with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #15
Source File: HeaderFooterViewListAdapter.java    From ProjectX with Apache License 2.0 5 votes vote down vote up
public HeaderFooterViewListAdapter(
        ArrayList<HeaderFooterGridView.FixedViewInfo> headerItemInfo,
        ArrayList<HeaderFooterGridView.FixedViewInfo> footerItemInfo,
        ListAdapter adapter, ArrayList<View> headerViews,
        ArrayList<View> footerViews, int numColumns) {
    mAdapter = adapter;
    if (headerViews == null) {
        mHeaderViews = EMPTY_VIEW_LIST;
    } else {
        mHeaderViews = headerViews;
    }
    if (footerViews == null) {
        mFooterViews = EMPTY_VIEW_LIST;
    } else {
        mFooterViews = footerViews;
    }
    mIsFilterable = adapter instanceof Filterable;
    if (headerItemInfo == null) {
        mHeaderItemInfo = EMPTY_INFO_LIST;
    } else {
        mHeaderItemInfo = headerItemInfo;
    }
    if (footerItemInfo == null) {
        mFooterItemInfo = EMPTY_INFO_LIST;
    } else {
        mFooterItemInfo = footerItemInfo;
    }
    mAreAllFixedViewsSelectable = areAllListInfoSelectable(mHeaderItemInfo)
            && areAllListInfoSelectable(mFooterItemInfo);
    if (numColumns > 0)
        mNumColumns = numColumns;
    else
        mNumColumns = 1;

}
 
Example #16
Source File: HeaderFooterViewListAdapter.java    From ProjectX with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #17
Source File: HeaderFooterGridView.java    From android-HeaderFooterGridView with Apache License 2.0 5 votes vote down vote up
public HeaderFooterViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ArrayList<FixedViewInfo> footerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    if (footerViewInfos == null) {
        throw new IllegalArgumentException("footerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mFooterViewInfos = footerViewInfos;

    mAreAllFixedViewsSelectable = (areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable(mFooterViewInfos));
}
 
Example #18
Source File: HeaderFooterGridView.java    From android-HeaderFooterGridView with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #19
Source File: HeaderGridView.java    From AcDisplay with GNU General Public License v2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;
    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos);
}
 
Example #20
Source File: HeaderGridView.java    From AcDisplay with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #21
Source File: PlacesAutocompleteTextView.java    From android-PlacesAutocompleteTextView with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * @param adapter the adapter for displaying the list of results in the popup window, must
 *                extend {@link AbstractPlacesAutocompleteAdapter} to maintain certain logic
 */
@Override
public final <T extends ListAdapter & Filterable> void setAdapter(@NonNull final T adapter) {
    if (!(adapter instanceof AbstractPlacesAutocompleteAdapter)) {
        throw new IllegalArgumentException("Custom adapters must inherit from " + AbstractPlacesAutocompleteAdapter.class.getSimpleName());
    }

    this.adapter = (AbstractPlacesAutocompleteAdapter) adapter;

    historyManager = this.adapter.getHistoryManager();
    resultType = this.adapter.getResultType();
    api = this.adapter.getApi();

    super.setAdapter(adapter);
}
 
Example #22
Source File: HeaderGridView.java    From HeartbeatFixerForGCM with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #23
Source File: ObservableGridView.java    From Android-ObservableScrollView with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #24
Source File: HeaderGridView.java    From AnimatedGridView with Apache License 2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;

    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;

    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos);
}
 
Example #25
Source File: MaterialAutoCompleteTextView.java    From material-components-android with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private <T extends ListAdapter & Filterable> void updateText(Object selectedItem) {
  if (VERSION.SDK_INT >= 17) {
    setText(convertSelectionToString(selectedItem), false);
  } else {
    ListAdapter adapter = getAdapter();
    setAdapter(null);
    setText(convertSelectionToString(selectedItem));
    setAdapter((T) adapter);
  }
}
 
Example #26
Source File: HeaderGridView.java    From AnimatedGridView with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #27
Source File: HeaderGridView.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}
 
Example #28
Source File: HeaderGridView.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;
    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos);
}
 
Example #29
Source File: HeaderGridView.java    From HeadsUp with GNU General Public License v2.0 5 votes vote down vote up
public HeaderViewGridAdapter(ArrayList<FixedViewInfo> headerViewInfos, ListAdapter adapter) {
    mAdapter = adapter;
    mIsFilterable = adapter instanceof Filterable;
    if (headerViewInfos == null) {
        throw new IllegalArgumentException("headerViewInfos cannot be null");
    }
    mHeaderViewInfos = headerViewInfos;
    mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos);
}
 
Example #30
Source File: HeaderGridView.java    From HeadsUp with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Filter getFilter() {
    if (mIsFilterable) {
        return ((Filterable) mAdapter).getFilter();
    }
    return null;
}