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

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

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

origin: mikepenz/FastAdapter

/**
 * Searches for the given item and calculates its global position
 *
 * @param item the item which is searched for
 * @return the global position, or -1 if not found
 */
public int getPosition(Item item) {
  if (item.getIdentifier() == -1) {
    Log.e("FastAdapter", "You have to define an identifier for your item to retrieve the position via this method");
    return -1;
  }
  return getPosition(item.getIdentifier());
}
origin: mikepenz/FastAdapter

for (Object subItem : ((IExpandable) parent).getSubItems()) {
  if (subItem instanceof IExpandable && ((IExpandable) subItem).isExpanded() && subItem != item) {
    expandedItemsList.add(mFastAdapter.getPosition((Item) subItem));
origin: mikepenz/FastAdapter

@Test
public void getPosition() throws Exception {
  TestItem testItem = TestDataGenerator.genTestItem(1);
  itemAdapter.add(testItem);
  assertThat(adapter.getPosition(testItem)).isEqualTo(0);
}
origin: mikepenz/FastAdapter

@Test
public void getPosition() throws Exception {
  TestItem testItem = TestDataGenerator.genTestItem(1);
  itemAdapter.add(testItem);
  assertThat(adapter.getPosition(testItem)).isEqualTo(0);
}
origin: mikepenz/FastAdapter

item = it.next();
pos = fastAdapter.getPosition(item);
  parentPos = fastAdapter.getPosition(parent);
  boolean success = ((IExpandable) parent).getSubItems().remove(item);
origin: mikepenz/FastAdapter

identifier = it.next();
pos = fastAdapter.getPosition(identifier);
item = fastAdapter.getItem(pos);
  parentPos = fastAdapter.getPosition(parent);
  boolean success = ((IExpandable) parent).getSubItems().remove(item);
origin: mikepenz/FastAdapter

int position = adapter.getPosition(header);
boolean expanded = header.isExpanded();
origin: mikepenz/FastAdapter

int position = adapter.getPosition(header);
if (header.isExpanded()) {
  for (int i = 0; i < subItems; i++) {
origin: mikepenz/FastAdapter

/**
 * @param position the global position of the current item
 * @return a set with the global positions of all expanded items on the root level
 */
public int[] getExpandedItemsRootLevel(int position) {
  int[] expandedItems;
  ArraySet<Integer> expandedItemsList = new ArraySet<>();
  Item item = mFastAdapter.getItem(position);
  for (int i = 0, size = mFastAdapter.getItemCount(); i < size; i++) {
    Item currItem = mFastAdapter.getItem(i);
    if (currItem instanceof ISubItem) {
      IItem parent = ((ISubItem) currItem).getParent();
      if (parent instanceof IExpandable && ((IExpandable) parent).isExpanded()) {
        i += ((IExpandable) parent).getSubItems().size();
        if (parent != item)
          expandedItemsList.add(mFastAdapter.getPosition((Item) parent));
      }
    }
  }
  int expandedItemsListLength = expandedItemsList.size();
  expandedItems = new int[expandedItemsListLength];
  for (int i = 0; i < expandedItemsListLength; i++) {
    expandedItems[i] = expandedItemsList.valueAt(i);
  }
  return expandedItems;
}
com.mikepenz.fastadapterFastAdaptergetPosition

Javadoc

Searches for the given item and calculates its global position

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 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