congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
FastAdapter.notifyItemChanged
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: mikepenz/FastAdapter

/**
 * deselects an item and removes its position in the selections list
 * also takes an iterator to remove items from the map
 *
 * @param item     the item to deselected
 * @param position the global position (or < 0 if the item is not displayed)
 * @param entries  the iterator which is used to deselect all
 */
public void deselect(Item item, int position, @Nullable Iterator<Integer> entries) {
  item.withSetSelected(false);
  if (entries != null) {
    entries.remove();
  }
  if (position >= 0) {
    mFastAdapter.notifyItemChanged(position);
  }
  if (mSelectionListener != null) {
    mSelectionListener.onSelectionChanged(item, false);
  }
}
origin: mikepenz/FastAdapter

  @Override
  public void onClick(View v, int position, FastAdapter<RadioButtonSampleItem> fastAdapter, RadioButtonSampleItem item) {
    if (!item.isSelected()) {
      Set<Integer> selections = fastAdapter.getSelections();
      if (!selections.isEmpty()) {
        int selectedPosition = selections.iterator().next();
        fastAdapter.deselect();
        fastAdapter.notifyItemChanged(selectedPosition);
      }
      fastAdapter.select(position);
    }
  }
}
origin: mikepenz/FastAdapter

/**
 * selects an item and remembers its position in the selections list
 *
 * @param adapter                adapter holding this item (or it's parent)
 * @param item                   the item to select
 * @param position               the global position (or &lt; 0 if the item is not displayed)
 * @param fireEvent              true if the onClick listener should be called
 * @param considerSelectableFlag true if the select method should not select an item if its not selectable
 */
public void select(IAdapter<Item> adapter, Item item, int position, boolean fireEvent, boolean considerSelectableFlag) {
  if (considerSelectableFlag && !item.isSelectable()) {
    return;
  }
  item.withSetSelected(true);
  mFastAdapter.notifyItemChanged(position);
  if (mSelectionListener != null)
    mSelectionListener.onSelectionChanged(item, true);
  if (mFastAdapter.getOnClickListener() != null && fireEvent) {
    mFastAdapter.getOnClickListener().onClick(null, adapter, item, position);
  }
}
origin: mikepenz/FastAdapter

/**
 * opens the expandable item at the given position
 *
 * @param position          the global position
 * @param notifyItemChanged true if we need to call notifyItemChanged. DEFAULT: false
 */
public void expand(int position, boolean notifyItemChanged) {
  Item item = mFastAdapter.getItem(position);
  if (item != null && item instanceof IExpandable) {
    IExpandable expandable = (IExpandable) item;
    //if this item is not already expanded and has sub items we go on
    if (!expandable.isExpanded() && expandable.getSubItems() != null && expandable.getSubItems().size() > 0) {
      IAdapter<Item> adapter = mFastAdapter.getAdapter(position);
      if (adapter != null && adapter instanceof IItemAdapter) {
        ((IItemAdapter<?, Item>) adapter).addInternal(position + 1, expandable.getSubItems());
      }
      //remember that this item is now opened (not collapsed)
      expandable.withIsExpanded(true);
      //we need to notify to get the correct drawable if there is one showing the current state
      if (notifyItemChanged) {
        mFastAdapter.notifyItemChanged(position);
      }
    }
  }
}
origin: mikepenz/FastAdapter

adapter.notifyItemChanged(position, payload);
origin: mikepenz/FastAdapter

mFastAdapter.notifyItemChanged(position);
com.mikepenz.fastadapterFastAdapternotifyItemChanged

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
  • saveInstanceState
    add the values to the bundle for saveInstanceState
  • getRelativeInfo,
  • saveInstanceState,
  • select,
  • withSavedInstanceState,
  • addAdapter,
  • getItemId,
  • getItemViewType,
  • getPreItemCount,
  • getSelectedItems

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Join (org.hibernate.mapping)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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