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

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

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

origin: mikepenz/FastAdapter

/**
 * wraps notifyItemRangeChanged
 *
 * @param position  the global position
 * @param itemCount the count of items changed
 */
public void notifyAdapterItemRangeChanged(int position, int itemCount) {
  notifyAdapterItemRangeChanged(position, itemCount, null);
}
origin: mikepenz/FastAdapter

/**
 * wraps notifyItemChanged
 *
 * @param position the global position
 * @param payload  additional payload
 */
public void notifyAdapterItemChanged(int position, @Nullable Object payload) {
  notifyAdapterItemRangeChanged(position, 1, payload);
}
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 onChanged(int position, int count, Object payload) {
    adapter.getFastAdapter().notifyAdapterItemRangeChanged(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + position, count, payload);
  }
}
com.mikepenz.fastadapterFastAdapternotifyAdapterItemRangeChanged

Javadoc

wraps notifyItemRangeChanged

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

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • startActivity (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • From CI to AI: The AI layer in your organization
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