@Override
  public void setAdapter(@NonNull UniversalAdapter<Item, Holder> universalAdapter) {
    if (getAdapter() != null) {
      getAdapter().getListObserver().removeListener(internalListObserverListener);
    }

    this.universalAdapter = universalAdapter;
    universalAdapter.getListObserver().addListener(internalListObserverListener);
  }
  /**
   * Creates a {@link BaseAdapterConverter} converting the given {@link UniversalAdapter} into a
   * {@link BaseAdapter}.
   *
   * @param universalAdapter The adapter to convert.
   * @param adapterView The {@link AdapterView} to bind to. This may be null, but it is heavily
   *     recommended that it isn't. If null is passed, you'll likely want to call {@link
   *     #bindToAdapterView(AdapterView)} - see its documentation for more details.
   */
  public BaseAdapterConverter(
      @NonNull UniversalAdapter<Item, Holder> universalAdapter,
      AdapterView<? super BaseAdapter> adapterView) {
    universalAdapter.checkIfBoundAndSet();
    setAdapter(universalAdapter);

    bindToAdapterView(adapterView);

    notifyDataSetChanged();
  }
Пример #3
0
 public void notifyDataSetInvalidated() {
   if (parentAdapter != null) {
     parentAdapter.notifyDataSetInvalidated();
   }
 }
Пример #4
0
 public void notifyDataSetChanged() {
   if (parentAdapter != null) {
     parentAdapter.notifyDataSetChanged();
   }
 }