Tabnine Logo
FastAdapter.notifyAdapterItemRangeRemoved
Code IndexAdd Tabnine to your IDE (free)

How to use
notifyAdapterItemRangeRemoved
method
in
com.mikepenz.fastadapter.FastAdapter

Best Java code snippets using com.mikepenz.fastadapter.FastAdapter.notifyAdapterItemRangeRemoved (Showing top 6 results out of 315)

origin: mikepenz/FastAdapter

/**
 * wraps notifyItemRemoved
 *
 * @param position the global position
 */
public void notifyAdapterItemRemoved(int position) {
  notifyAdapterItemRangeRemoved(position, 1);
}
origin: mikepenz/FastAdapter

@Override
public void removeRange(int position, int itemCount, int preItemCount) {
  //global position to relative
  int length = mItems.size();
  //make sure we do not delete to many items
  int saveItemCount = Math.min(itemCount, length - position + preItemCount);
  for (int i = 0; i < saveItemCount; i++) {
    mItems.remove(position - preItemCount);
  }
  if (getFastAdapter() != null) {
    getFastAdapter().notifyAdapterItemRangeRemoved(position, saveItemCount);
  }
}
origin: mikepenz/FastAdapter

@Override
public void clear(int preItemCount) {
  int size = mItems.size();
  mItems.clear();
  if (getFastAdapter() != null) {
    getFastAdapter().notifyAdapterItemRangeRemoved(preItemCount, size);
  }
}
origin: mikepenz/FastAdapter

  @Override
  public boolean notify(FastAdapter fastAdapter, int newItemsCount, int previousItemsCount, int itemsBeforeThisAdapter) {
    //now properly notify the adapter about the changes
    if (newItemsCount > previousItemsCount) {
      if (previousItemsCount > 0) {
        fastAdapter.notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);
      }
      fastAdapter.notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);
    } else if (newItemsCount > 0 && newItemsCount < previousItemsCount) {
      fastAdapter.notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);
      fastAdapter.notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);
    } else if (newItemsCount == 0) {
      fastAdapter.notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);
    } else {
      //this condition should practically never happen
      fastAdapter.notifyAdapterDataSetChanged();
    }
    return false;
  }
};
origin: mikepenz/FastAdapter

  @Override
  public boolean notify(FastAdapter fastAdapter, int newItemsCount, int previousItemsCount, int itemsBeforeThisAdapter) {
    //now properly notify the adapter about the changes
    if (newItemsCount > previousItemsCount) {
      if (previousItemsCount > 0) {
        fastAdapter.notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, previousItemsCount);
      }
      fastAdapter.notifyAdapterItemRangeInserted(itemsBeforeThisAdapter + previousItemsCount, newItemsCount - previousItemsCount);
    } else if (newItemsCount > 0) {
      fastAdapter.notifyAdapterItemRangeChanged(itemsBeforeThisAdapter, newItemsCount);
      if (newItemsCount < previousItemsCount) {
        fastAdapter.notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter + newItemsCount, previousItemsCount - newItemsCount);
      }
    } else if (newItemsCount == 0) {
      fastAdapter.notifyAdapterItemRangeRemoved(itemsBeforeThisAdapter, previousItemsCount);
    } else {
      //this condition should practically never happen
      fastAdapter.notifyAdapterDataSetChanged();
    }
    return false;
  }
};
origin: mikepenz/FastAdapter

@Override
public void onRemoved(int position, int count) {
  adapter.getFastAdapter().notifyAdapterItemRangeRemoved(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + position, count);
}
com.mikepenz.fastadapterFastAdapternotifyAdapterItemRangeRemoved

Javadoc

wraps notifyItemRangeRemoved

Popular methods of FastAdapter

  • with
    creates a new FastAdapter with the provided adapters if adapters is null, a default ItemAdapter is d
  • getItem
    gets the IItem by a position, from all registered adapters
  • getItemCount
    calculates the total ItemCount over all registered adapters
  • getExtension
  • getAdapter
    Gets the adapter for the given position
  • getPosition
    Searches for the given item and calculates its global position
  • getSelections
  • withSelectable
    Set to true if you want the items to be selectable. By default, no items are selectable
  • addExtension
  • getPreItemCountByOrder
    calculates the item count up to a given (excluding this) order number
  • getRelativeInfo
    Internal method to get the Item as ItemHolder which comes with the relative position within its adap
  • notifyItemChanged
  • getRelativeInfo,
  • notifyItemChanged,
  • saveInstanceState,
  • select,
  • withSavedInstanceState,
  • addAdapter,
  • getItemId,
  • getItemViewType,
  • getPreItemCount,
  • getSelectedItems

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JPanel (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now