本文整理汇总了Java中net.oschina.app.bean.SoftwareCatalogList.SoftwareType类的典型用法代码示例。如果您正苦于以下问题:Java SoftwareType类的具体用法?Java SoftwareType怎么用?Java SoftwareType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SoftwareType类属于net.oschina.app.bean.SoftwareCatalogList包,在下文中一共展示了SoftwareType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSuccess
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
@Override
public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
try {
SoftwareCatalogList list = XmlUtils.toBean(
SoftwareCatalogList.class, new ByteArrayInputStream(
arg2));
if (mState == STATE_REFRESH)
mCatalogAdapter.clear();
List<SoftwareType> data = list.getSoftwarecataloglist();
mCatalogAdapter.addData(data);
mEmptyView.setErrorType(EmptyLayout.HIDE_LAYOUT);
if (data.size() == 0 && mState == STATE_REFRESH) {
mEmptyView.setErrorType(EmptyLayout.NODATA);
} else {
mCatalogAdapter
.setState(ListBaseAdapter.STATE_LESS_ONE_PAGE);
}
} catch (Exception e) {
e.printStackTrace();
onFailure(arg0, arg1, arg2, e);
}
}
示例2: getRealView
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
@Override
protected View getRealView(int position, View convertView, ViewGroup parent) {
ViewHold vh = null;
if (convertView == null || convertView.getTag() == null) {
convertView = getLayoutInflater(parent.getContext()).inflate(R.layout
.list_cell_softwarecatalog, null);
vh = new ViewHold(convertView);
convertView.setTag(vh);
} else {
vh = (ViewHold) convertView.getTag();
}
SoftwareType softwareType = (SoftwareType) mDatas.get(position);
vh.name.setText(softwareType.getName());
return convertView;
}
示例3: onItemClick
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
SoftwareType type = (SoftwareType) mCatalogAdapter
.getItem(position);
if (type != null && type.getTag() > 0) {
// 加载二级分类
curScreen = SCREEN_TAG;
mScrollLayout.scrollToScreen(curScreen);
mCurrentTag = type.getTag();
sendRequestCatalogData(mTagHandler);
}
}
示例4: ListViewSoftwareCatalogAdapter
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
/**
* 实例化Adapter
* @param context
* @param data
* @param resource
*/
public ListViewSoftwareCatalogAdapter(Context context, List<SoftwareType> data,int resource) {
this.context = context;
this.listContainer = LayoutInflater.from(context); //创建视图容器并设置上下文
this.itemViewResource = resource;
this.listItems = data;
}
示例5: getView
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
/**
* ListView Item设置
*/
public View getView(int position, View convertView, ViewGroup parent) {
//Log.d("method", "getView");
//自定义视图
ListItemView listItemView = null;
if (convertView == null) {
//获取list_item布局文件的视图
convertView = listContainer.inflate(this.itemViewResource, null);
listItemView = new ListItemView();
//获取控件对象
listItemView.name = (TextView)convertView.findViewById(R.id.softwarecatalog_listitem_name);
//设置控件集到convertView
convertView.setTag(listItemView);
}else {
listItemView = (ListItemView)convertView.getTag();
}
//设置文字和图片
SoftwareType softwareType = listItems.get(position);
listItemView.name.setText(softwareType.name);
listItemView.name.setTag(softwareType);//设置隐藏参数(实体类)
return convertView;
}
示例6: initSoftwareCatalogListView
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
private void initSoftwareCatalogListView()
{
lvSoftwareCatalogAdapter = new ListViewSoftwareCatalogAdapter(this, lvSoftwareCatalogData, R.layout.softwarecatalog_listitem);
mlvSoftwareCatalog = (ListView)findViewById(R.id.frame_software_listview_catalog);
mlvSoftwareCatalog.setAdapter(lvSoftwareCatalogAdapter);
mlvSoftwareCatalog.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView name = (TextView)view.findViewById(R.id.softwarecatalog_listitem_name);
SoftwareType type = (SoftwareType)name.getTag();
if(type == null) return;
if(type.tag > 0){
curTitleLV1 = type.name;
mTitle.setText(curTitleLV1);
//加载二级分类
curScreen = SCREEN_TAG;
mScrollLayout.scrollToScreen(curScreen);
loadLvSoftwareCatalogData(type.tag, mSoftwareTagHandler, UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG);
}
}
});
mSoftwareCatalogHandler = new Handler()
{
public void handleMessage(Message msg) {
headButtonSwitch(DATA_LOAD_COMPLETE);
if(msg.what >= 0){
SoftwareCatalogList list = (SoftwareCatalogList)msg.obj;
Notice notice = list.getNotice();
//处理listview数据
switch (msg.arg1) {
case UIHelper.LISTVIEW_ACTION_INIT:
case UIHelper.LISTVIEW_ACTION_REFRESH:
case UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG:
lvSoftwareCatalogData.clear();//先清除原有数据
lvSoftwareCatalogData.addAll(list.getSoftwareTypelist());
break;
case UIHelper.LISTVIEW_ACTION_SCROLL:
break;
}
lvSoftwareCatalogAdapter.notifyDataSetChanged();
//发送通知广播
if(notice != null){
UIHelper.sendBroadCast(SoftwareLib.this, notice);
}
}
else if(msg.what == -1){
//有异常--显示加载出错 & 弹出错误消息
((AppException)msg.obj).makeToast(SoftwareLib.this);
}
}
};
}
示例7: initSoftwareTagListView
import net.oschina.app.bean.SoftwareCatalogList.SoftwareType; //导入依赖的package包/类
private void initSoftwareTagListView()
{
lvSoftwareTagAdapter = new ListViewSoftwareCatalogAdapter(this, lvSoftwareTagData, R.layout.softwarecatalog_listitem);
mlvSoftwareTag = (ListView)findViewById(R.id.frame_software_listview_tag);
mlvSoftwareTag.setAdapter(lvSoftwareTagAdapter);
mlvSoftwareTag.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TextView name = (TextView)view.findViewById(R.id.softwarecatalog_listitem_name);
SoftwareType type = (SoftwareType)name.getTag();
if(type == null) return;
if(type.tag > 0){
mTitle.setText(type.name);
//加载软件列表
curScreen = SCREEN_SOFTWARE;
mScrollLayout.scrollToScreen(curScreen);
curSearchTag = type.tag;
loadLvSoftwareTagData(curSearchTag, 0, mSoftwareHandler, UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG);
}
}
});
mSoftwareTagHandler = new Handler()
{
public void handleMessage(Message msg) {
headButtonSwitch(DATA_LOAD_COMPLETE);
if(msg.what >= 0){
SoftwareCatalogList list = (SoftwareCatalogList)msg.obj;
Notice notice = list.getNotice();
//处理listview数据
switch (msg.arg1) {
case UIHelper.LISTVIEW_ACTION_INIT:
case UIHelper.LISTVIEW_ACTION_REFRESH:
case UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG:
lvSoftwareTagData.clear();//先清除原有数据
lvSoftwareTagData.addAll(list.getSoftwareTypelist());
break;
case UIHelper.LISTVIEW_ACTION_SCROLL:
break;
}
lvSoftwareTagAdapter.notifyDataSetChanged();
//发送通知广播
if(notice != null){
UIHelper.sendBroadCast(SoftwareLib.this, notice);
}
}
else if(msg.what == -1){
//有异常--显示加载出错 & 弹出错误消息
((AppException)msg.obj).makeToast(SoftwareLib.this);
}
}
};
}