本文整理汇总了Java中android.widget.Adapter.getViewTypeCount方法的典型用法代码示例。如果您正苦于以下问题:Java Adapter.getViewTypeCount方法的具体用法?Java Adapter.getViewTypeCount怎么用?Java Adapter.getViewTypeCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.Adapter
的用法示例。
在下文中一共展示了Adapter.getViewTypeCount方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemViewType
import android.widget.Adapter; //导入方法依赖的package包/类
@Override
public int getItemViewType(int position)
{
int type = 1;
for (final Object section : sectionMap.keySet())
{
final Adapter adapter = sectionMap.get(section);
final int size = adapter.getCount() + (hasSectionHeader ? 1 : 0);
if (position == 0 && hasSectionHeader)
return TYPE_SECTION_HEADER;
if (position < size)
return type + adapter.getItemViewType(position - 1);
position -= size;
type += adapter.getViewTypeCount();
}
return -1;
}
示例2: getItemViewType
import android.widget.Adapter; //导入方法依赖的package包/类
@Override
public int getItemViewType(int position) {
int type = 1;
for (Object section : this.sections.keySet()) {
Adapter adapter = sections.get(section);
int size = adapter.getCount() + 1;
// check if position inside this section
if (position == 0) return TYPE_SECTION_HEADER;
if (position < size) return type + adapter.getItemViewType(position - 1);
// otherwise jump into next section
position -= size;
type += adapter.getViewTypeCount();
}
return -1;
}
示例3: getItemViewType
import android.widget.Adapter; //导入方法依赖的package包/类
public int getItemViewType(int position) {
int type = 1;
for(Object section : this.sections.keySet()) {
Adapter adapter = sections.get(section);
int size = adapter.getCount() + 1;
// check if position inside this section
if(position == 0) return TYPE_SECTION_HEADER;
if(position < size) return type + adapter.getItemViewType(position - 1);
// otherwise jump into next section
position -= size;
type += adapter.getViewTypeCount();
}
return -1;
}
示例4: getViewTypeCount
import android.widget.Adapter; //导入方法依赖的package包/类
@Override
public int getViewTypeCount()
{
int total = 1;
for (final Adapter adapter : sectionMap.values())
total += adapter.getViewTypeCount();
return total;
}
示例5: getViewTypeCount
import android.widget.Adapter; //导入方法依赖的package包/类
@Override
public int getViewTypeCount() {
// assume that headers count as one, then total all sections
int total = 1;
for (Adapter adapter : this.sections.values())
total += adapter.getViewTypeCount();
return total;
}
示例6: getViewTypeCount
import android.widget.Adapter; //导入方法依赖的package包/类
public int getViewTypeCount() {
// assume that headers count as one, then total all sections
int total = 1;
for(Adapter adapter : this.sections.values())
total += adapter.getViewTypeCount();
return total;
}