當前位置: 首頁>>代碼示例>>Java>>正文


Java SoftwareType類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:23,代碼來源:SoftwareCatalogListFragment.java

示例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;

}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:20,代碼來源:SoftwareCatalogListAdapter.java

示例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);
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:14,代碼來源:SoftwareCatalogListFragment.java

示例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;
}
 
開發者ID:WallaceLiu,項目名稱:oschina-android-app,代碼行數:13,代碼來源:ListViewSoftwareCatalogAdapter.java

示例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;
}
 
開發者ID:WallaceLiu,項目名稱:oschina-android-app,代碼行數:32,代碼來源:ListViewSoftwareCatalogAdapter.java

示例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);
		}
	}
};
  }
 
開發者ID:WallaceLiu,項目名稱:oschina-android-app,代碼行數:59,代碼來源:SoftwareLib.java

示例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);
		}
	}
};
  }
 
開發者ID:WallaceLiu,項目名稱:oschina-android-app,代碼行數:59,代碼來源:SoftwareLib.java


注:本文中的net.oschina.app.bean.SoftwareCatalogList.SoftwareType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。