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

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

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

origin: mikepenz/FastAdapter

private void undoChange() {
  if (mHistory != null) {
    if (mHistory.action == ACTION_REMOVE) {
      for (int i = 0, size = mHistory.items.size(); i < size; i++) {
        FastAdapter.RelativeInfo<Item> relativeInfo = mHistory.items.get(i);
        if (relativeInfo.adapter instanceof IItemAdapter) {
          IItemAdapter<?, Item> adapter = (IItemAdapter<?, Item>) relativeInfo.adapter;
          adapter.addInternal(relativeInfo.position, asList(relativeInfo.item));
          if (relativeInfo.item.isSelected()) {
            mAdapter.select(relativeInfo.position);
          }
        }
      }
    }
  }
  mHistory = null;
}
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

@Test
public void select() throws Exception {
  adapter.withSelectable(true);
  itemAdapter.set(TestDataGenerator.genTestItemList(100));
  assertThat(adapter.getSelectedItems().size()).isEqualTo(0);
  assertThat(adapter.getSelections().size()).isEqualTo(0);
  adapter.select(10);
  assertThat(adapter.getSelectedItems().size()).isEqualTo(1);
  assertThat(adapter.getSelectedItems().iterator().next().getIdentifier()).isEqualTo(10);
  assertThat(adapter.getSelections().size()).isEqualTo(1);
  assertThat(adapter.getSelections().iterator().next()).isEqualTo(10);
}
origin: mikepenz/MaterialDrawer

/**
 * set the selection of the MiniDrawer
 *
 * @param identifier the identifier of the item which should be selected (-1 for none)
 */
public void setSelection(long identifier) {
  if (identifier == -1) {
    mAdapter.deselect();
  }
  int count = mAdapter.getItemCount();
  for (int i = 0; i < count; i++) {
    IDrawerItem item = mAdapter.getItem(i);
    if (item.getIdentifier() == identifier && !item.isSelected()) {
      mAdapter.deselect();
      mAdapter.select(i);
    }
  }
}
origin: mikepenz/MaterialDrawer

mAdapter.select(mSelectedItemPosition);
origin: mikepenz/MaterialDrawer

mAdapter.select(select + profileOffset);
com.mikepenz.fastadapterFastAdapterselect

Javadoc

select all items

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,
  • withSavedInstanceState,
  • addAdapter,
  • getItemId,
  • getItemViewType,
  • getPreItemCount,
  • getSelectedItems

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Table (org.hibernate.mapping)
    A relational table
  • 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