本文整理匯總了Java中android.widget.SectionIndexer.getSections方法的典型用法代碼示例。如果您正苦於以下問題:Java SectionIndexer.getSections方法的具體用法?Java SectionIndexer.getSections怎麽用?Java SectionIndexer.getSections使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.SectionIndexer
的用法示例。
在下文中一共展示了SectionIndexer.getSections方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAdapter
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setAdapter(RecyclerView.Adapter adapter) {
if (adapter instanceof SectionIndexer) {
adapter.registerAdapterDataObserver(this);
mIndexer = (SectionIndexer) adapter;
mSections = (String[]) mIndexer.getSections();
}
}
開發者ID:myinnos,項目名稱:AlphabetIndex-Fast-Scroll-RecyclerView,代碼行數:8,代碼來源:IndexFastScrollRecyclerSection.java
示例2: setAdapter
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setAdapter(ListAdapter adapter) {
if(adapter instanceof SectionIndexer) {
mSectionIndexer = (SectionIndexer) adapter;
mSections = (String[]) mSectionIndexer.getSections();
} else {
throw new IllegalArgumentException("adapter must implement SectionIndexer interface.");
}
}
示例3: setListView
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setListView(GridView list){
this.list = list;
sectionIndexer = (SectionIndexer) list.getAdapter();
Object[] sectionsArr = sectionIndexer.getSections();
sections = new String[sectionsArr.length];
for(int i=0; i<sectionsArr.length; i++){
sections[i] = sectionsArr[i].toString();
}
this.invalidate();
}
示例4: setListView
import android.widget.SectionIndexer; //導入方法依賴的package包/類
/**
* Adds the section index to the ListView.
*
* @param _list
* The ListView with which the section index is to be associated.
*/
public void setListView(ListView _list) {
list = _list;
selectionIndexer = (SectionIndexer) _list.getAdapter();
Object[] sectionsArr = selectionIndexer.getSections();
sections = new String[sectionsArr.length];
for (int i = 0; i < sectionsArr.length; i++) {
sections[i] = sectionsArr[i].toString();
}
}
示例5: setAdapter
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setAdapter(Adapter adapter) {
if (adapter instanceof SectionIndexer) {
mIndexer = (SectionIndexer) adapter;
mSections = (String[]) mIndexer.getSections();
}
}
示例6: setAdapter
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setAdapter(Indexer adapter) {
mIndexer = (SectionIndexer) adapter;
mSections = (String[]) mIndexer.getSections();
}
示例7: setAdapter
import android.widget.SectionIndexer; //導入方法依賴的package包/類
public void setAdapter(Adapter adapter) {
if (adapter instanceof SectionIndexer) {
mIndexer = (SectionIndexer) adapter;
mSections = (String[]) mIndexer.getSections();
}
}