本文整理汇总了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();
}
}