Tabnine Logo
FastAdapter.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.mikepenz.fastadapter.FastAdapter
constructor

Best Java code snippets using com.mikepenz.fastadapter.FastAdapter.<init> (Showing top 3 results out of 315)

origin: mikepenz/FastAdapter

/**
 * creates a new FastAdapter with the provided adapters
 * if adapters is null, a default ItemAdapter is defined
 *
 * @param adapter the adapters which this FastAdapter should use
 * @return a new FastAdapter
 */
@SuppressWarnings("unchecked")
public static <Item extends IItem, A extends IAdapter> FastAdapter<Item> with(A adapter) {
  FastAdapter<Item> fastAdapter = new FastAdapter<>();
  fastAdapter.addAdapter(0, adapter);
  return fastAdapter;
}
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

  @Test
  public void testAddPreviouslyFilledAdapterPropagatesPossibleTypesToParentFastAdapter() {
    final TestItem testItem = new TestItem("example name");
    ItemAdapter<TestItem> itemAdapter = new ItemAdapter<>();
    itemAdapter.add(testItem);
    FastAdapter<TestItem> adapter = new FastAdapter<>();
    adapter.addAdapter(0, itemAdapter);
    final ViewGroup dummyParent = new FrameLayout(RuntimeEnvironment.application);
    adapter.onCreateViewHolder(dummyParent, testItem.getType());
  }
}
com.mikepenz.fastadapterFastAdapter<init>

Javadoc

default CTOR

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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • 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