@Test public void testOnProcessItemWithEmptyText() { final Module module = new Module(); module.onProcessItem(0, createItem("")); assertThat(module.size(), is(0)); }
protected final void onProcessItem(final int position, @NonNull final AlphabeticItem item) { final String name = item.getText().toString(); if (!TextUtils.isEmpty(name)) { final String firstLetter = name.substring(0, 1); if (!firstLetter.equals(lastProcessedLetter)) { putHeader(size() + position, new SimpleHeader(firstLetter)); } this.lastProcessedLetter = firstLetter; } }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { protected final void onProcessItem(final int position, @NonNull final AlphabeticItem item) { final String name = item.getText().toString(); if (!TextUtils.isEmpty(name)) { final String firstLetter = name.substring(0, 1); if (!firstLetter.equals(lastProcessedLetter)) { putHeader(size() + position, new SimpleHeader(firstLetter)); } this.lastProcessedLetter = firstLetter; } } }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { protected final void onProcessItem(final int position, @NonNull final AlphabeticItem item) { final String name = item.getText().toString(); if (!TextUtils.isEmpty(name)) { final String firstLetter = name.substring(0, 1); if (!firstLetter.equals(lastProcessedLetter)) { putHeader(size() + position, new SimpleHeader(firstLetter)); } this.lastProcessedLetter = firstLetter; } }  }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { protected final void onProcessItem(final int position, @NonNull final AlphabeticItem item) { final String name = item.getText().toString(); if (!TextUtils.isEmpty(name)) { final String firstLetter = name.substring(0, 1); if (!firstLetter.equals(lastProcessedLetter)) { putHeader(size() + position, new SimpleHeader(firstLetter)); } this.lastProcessedLetter = firstLetter; } }  void fromAlphabeticCursor(@NonNull final C cursor); void fromAlphabeticCollection(@NonNull final Collection<Item> collection); @Override @CallSuper void clearHeaders(); }
AlphabeticHeaders extends HeadersModule<VH, HeadersModule.SimpleHeader> { protected final void onProcessItem(final int position, @NonNull final AlphabeticItem item) { final String name = item.getText().toString(); if (!TextUtils.isEmpty(name)) { final String firstLetter = name.substring(0, 1); if (!firstLetter.equals(lastProcessedLetter)) { putHeader(size() + position, new SimpleHeader(firstLetter)); } this.lastProcessedLetter = firstLetter; } }  void fromAlphabeticCursor(@NonNull final C cursor); void fromAlphabeticCollection(@NonNull final Collection<Item> collection); @Override @CallSuper void clearHeaders();  }