Methods Summary |
---|
public int | getCount()
if (mRemoteViewsList != null) {
return mRemoteViewsList.size();
} else {
return 0;
}
|
public java.lang.Object | getItem(int position)
return null;
|
public long | getItemId(int position)
return position;
|
public int | getItemViewType(int position)
if (position < getCount()) {
int layoutId = mRemoteViewsList.get(position).getLayoutId();
return mViewTypes.indexOf(layoutId);
} else {
return 0;
}
|
public android.view.View | getView(int position, android.view.View convertView, android.view.ViewGroup parent)
if (position < getCount()) {
RemoteViews rv = mRemoteViewsList.get(position);
rv.setIsWidgetCollectionChild(true);
View v;
if (convertView != null && rv != null &&
convertView.getId() == rv.getLayoutId()) {
v = convertView;
rv.reapply(mContext, v);
} else {
v = rv.apply(mContext, parent);
}
return v;
} else {
return null;
}
|
public int | getViewTypeCount()
return mViewTypeCount;
|
public boolean | hasStableIds()
return false;
|
private void | init()
if (mRemoteViewsList == null) return;
mViewTypes.clear();
for (RemoteViews rv: mRemoteViewsList) {
if (!mViewTypes.contains(rv.getLayoutId())) {
mViewTypes.add(rv.getLayoutId());
}
}
if (mViewTypes.size() > mViewTypeCount || mViewTypeCount < 1) {
throw new RuntimeException("Invalid view type count -- view type count must be >= 1" +
"and must be as large as the total number of distinct view types");
}
|
public void | setViewsList(java.util.ArrayList remoteViews)
mRemoteViewsList = remoteViews;
init();
notifyDataSetChanged();
|