Tabnine Logo
com.mikepenz.fastadapter
Code IndexAdd Tabnine to your IDE (free)

How to use com.mikepenz.fastadapter

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

origin: mikepenz/FastAdapter

/**
 * finds the int ItemId from the IItem which exists at the given position
 *
 * @param position the global position
 * @return the itemId for this position
 */
@Override
public long getItemId(int position) {
  return getItem(position).getIdentifier();
}
origin: mikepenz/FastAdapter

/**
 * finds the int ItemViewType from the IItem which exists at the given position
 *
 * @param position the global position
 * @return the viewType for this position
 */
@Override
public int getItemViewType(int position) {
  return getItem(position).getType();
}
origin: mikepenz/FastAdapter

/**
 * is called inside the onCreateViewHolder method and creates the viewHolder based on the provided viewTyp
 *
 * @param parent   the parent which will host the View
 * @param viewType the type of the ViewHolder we want to create
 * @return the generated ViewHolder based on the given viewType
 */
@Override
public RecyclerView.ViewHolder onPreCreateViewHolder(FastAdapter<Item> fastAdapter, ViewGroup parent, int viewType) {
  return fastAdapter.getTypeInstance(viewType).getViewHolder(parent);
}
origin: mikepenz/FastAdapter

public ModelAdapter<Model, Item> addInternal(List<Item> items) {
  if (mUseIdDistributor) {
    getIdDistributor().checkIds(items);
  }
  FastAdapter<Item> fastAdapter = getFastAdapter();
  if (fastAdapter != null) {
    mItems.addAll(items, fastAdapter.getPreItemCountByOrder(getOrder()));
  } else {
    mItems.addAll(items, 0);
  }
  mapPossibleTypes(items);
  return this;
}
origin: mikepenz/FastAdapter

public ModelAdapter<Model, Item> setInternal(int position, Item item) {
  if (mUseIdDistributor) {
    getIdDistributor().checkId(item);
  }
  mItems.set(position, item, getFastAdapter().getPreItemCount(position));
  mFastAdapter.registerTypeInstance(item);
  return this;
}
origin: mikepenz/FastAdapter

/**
 * make sure we return the count from the FastAdapter so we retrieve the count from all adapters
 *
 * @return
 */
@Override
public int getItemCount() {
  return mFastAdapter.getItemCount();
}
origin: mikepenz/MaterialDrawer

/**
 * check if the item is within the bounds of the list
 *
 * @param position
 * @param includeOffset
 * @return
 */
protected boolean checkDrawerItem(int position, boolean includeOffset) {
  return getAdapter().getItem(position) != null;
}
origin: mikepenz/FastAdapter

/**
 * register a new type into the TypeInstances to be able to efficiently create thew ViewHolders
 *
 * @param item an IItem which will be shown in the list
 */
@SuppressWarnings("unchecked")
public void registerTypeInstance(Item item) {
  if (getTypeInstanceCache().register(item)) {
    //check if the item implements hookable when its added for the first time
    if (item instanceof IHookable) {
      withEventHooks(((IHookable<Item>) item).getEventHooks());
    }
  }
}
origin: mikepenz/FastAdapter

/**
 * overwrite the getItemViewType to correctly return the value from the FastAdapter
 *
 * @param position
 * @return
 */
@Override
public int getItemViewType(int position) {
  return mFastAdapter.getItemViewType(position);
}
origin: mikepenz/MaterialDrawer

/**
 * define this if you want enable hasStableIds for the adapter which is generated.
 * WARNING: only use this if you have set an identifer for all of your items else this could cause
 * many weird things
 *
 * @param hasStableIds
 * @return
 */
public DrawerBuilder withHasStableIds(boolean hasStableIds) {
  this.mHasStableIds = hasStableIds;
  if (mAdapter != null) {
    mAdapter.setHasStableIds(hasStableIds);
  }
  return this;
}
origin: mikepenz/MaterialDrawer

/**
 * Remove a drawerItem at a specific position
 *
 * @param position
 */
public void removeItemByPosition(int position) {
  if (mDrawerBuilder.checkDrawerItem(position, false)) {
    mDrawerBuilder.getItemAdapter().remove(position);
  }
}
origin: mikepenz/MaterialDrawer

/**
 * deselects all selected items
 */
public void deselect() {
  getAdapter().deselect();
}
origin: mikepenz/FastAdapter

/**
 * the onCreateViewHolder is managed by the FastAdapter so forward this correctly
 *
 * @param parent
 * @param viewType
 * @return
 */
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  return mFastAdapter.onCreateViewHolder(parent, viewType);
}
origin: mikepenz/FastAdapter

/**
 * gets the TypeInstance remembered within the FastAdapter for an item
 *
 * @param type the int type of the item
 * @return the Item typeInstance
 */
public Item getTypeInstance(int type) {
  return getTypeInstanceCache().get(type);
}
origin: mikepenz/FastAdapter

/**
 * clears the internal mapper - be sure, to remap everything before going on
 */
public void clearTypeInstance() {
  getTypeInstanceCache().clear();
}
origin: mikepenz/FastAdapter

/**
 * the onAttachedToRecyclerView is managed by the FastAdapter so forward this correctly
 *
 * @param recyclerView
 */
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
  mFastAdapter.onAttachedToRecyclerView(recyclerView);
}
origin: mikepenz/FastAdapter

/**
 * overwrite the getItemViewType to correctly return the value from the FastAdapter
 *
 * @param position
 * @return
 */
@Override
public int getItemViewType(int position) {
  return mFastAdapter.getItemViewType(position);
}
origin: mikepenz/MaterialDrawer

/**
 * deselects the item with the given identifier
 *
 * @param identifier the identifier to search for
 */
public void deselect(long identifier) {
  getAdapter().deselect(getPosition(identifier));
}
origin: mikepenz/FastAdapter

/**
 * the onCreateViewHolder is managed by the FastAdapter so forward this correctly
 *
 * @param parent
 * @param viewType
 * @return
 */
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  return mFastAdapter.onCreateViewHolder(parent, viewType);
}
origin: mikepenz/FastAdapter

/**
 * the onAttachedToRecyclerView is managed by the FastAdapter so forward this correctly
 *
 * @param recyclerView
 */
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
  mFastAdapter.onAttachedToRecyclerView(recyclerView);
}
com.mikepenz.fastadapter

Most used classes

  • FastAdapter
    The `FastAdapter` class is the core managing class of the `FastAdapter` library, it handles all `IAd
  • ItemAdapter
    Created by mikepenz on 27.12.15. A general ItemAdapter implementation based on the AbstractAdapter t
  • AbstractItem
    Created by mikepenz on 14.07.15. Implements the general methods of the IItem interface to speed up d
  • SelectExtension
    Created by mikepenz on 04/06/2017.
  • IExpandable
    Created by mikepenz on 30.12.15.
  • FastItemAdapter,
  • ExpandableExtension,
  • IItem,
  • IItemAdapter,
  • FastAdapterUIUtils,
  • ISubItem,
  • ItemFilter,
  • FastAdapterDiffUtil,
  • OnBindViewHolderListener,
  • ComparableItemListImpl,
  • IIdDistributor,
  • IInterceptor,
  • TestDataGenerator,
  • TestItem$ViewHolder
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