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

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

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

origin: mikepenz/FastAdapter

/**
 * Set to true if you want the items to be selectable. 
 * By default, no items are selectable
 *
 * @param selectable true if items are selectable
 * @return this
 */
public FastAdapter<Item> withSelectable(boolean selectable) {
  if (selectable) {
    addExtension(mSelectExtension);
  } else {
    mExtensions.remove(mSelectExtension.getClass());
  }
  //TODO revisit this --> false means anyways that it is not in the extension list!
  mSelectExtension.withSelectable(selectable);
  return this;
}
origin: mikepenz/MaterialDrawer

/**
 * Define a custom Adapter which will be used in the drawer
 * NOTE: this is not recommender
 * WARNING: if you do this after adding items you will loose those!
 *
 * @param adapter the FastAdapter to use with this drawer
 * @return this
 */
public DrawerBuilder withAdapter(@NonNull FastAdapter<IDrawerItem> adapter) {
  this.mAdapter = adapter;
  //we have to rewrap as a different FastAdapter was provided
  adapter.addAdapter(0, mHeaderAdapter);
  adapter.addAdapter(1, mItemAdapter);
  adapter.addAdapter(2, mFooterAdapter);
  adapter.addExtension(mExpandableExtension);
  return this;
}
origin: mikepenz/FastAdapter

/**
 * creates a new FastAdapter with the provided adapters
 * if adapters is null, a default ItemAdapter is defined
 *
 * @param adapters the adapters which this FastAdapter should use
 * @return a new FastAdapter
 */
@SuppressWarnings("unchecked")
public static <Item extends IItem, A extends IAdapter> FastAdapter<Item> with(@Nullable Collection<A> adapters, @Nullable Collection<IAdapterExtension<Item>> extensions) {
  FastAdapter<Item> fastAdapter = new FastAdapter<>();
  if (adapters == null) {
    fastAdapter.mAdapters.add((IAdapter<Item>) items());
  } else {
    fastAdapter.mAdapters.addAll((Collection<IAdapter<Item>>) adapters);
  }
  for (int i = 0; i < fastAdapter.mAdapters.size(); i++) {
    fastAdapter.mAdapters.get(i).withFastAdapter(fastAdapter).setOrder(i);
  }
  fastAdapter.cacheSizes();
  if (extensions != null) {
    for (IAdapterExtension<Item> extension : extensions) {
      fastAdapter.addExtension(extension);
    }
  }
  return fastAdapter;
}
origin: mikepenz/FastAdapter

@Before
public void setUp() throws Exception {
  itemAdapter = new ItemAdapter<>();
  adapter = FastAdapter.with(itemAdapter);
  selectExtension = new SelectExtension<>();
  adapter.addExtension(selectExtension);
  //adapter.withPositionBasedStateManagement(true);
}
origin: mikepenz/FastAdapter

@Before
public void setUp() throws Exception {
  itemAdapter = new ItemAdapter<>();
  expandableExtension = new ExpandableExtension<>();
  adapter = FastAdapter.with(itemAdapter);
  adapter.addExtension(expandableExtension);
  //adapter.withPositionBasedStateManagement(true);
}
com.mikepenz.fastadapterFastAdapteraddExtension

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
  • 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

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • 21 Best Atom Packages for 2021
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