/** 初始化控件 */ private void initView() { // findView lvproduct = (MyListView) findViewById(R.id.product_listView); salTypeTv = (TextView) findViewById(R.id.sale_type); returnMoneyTv = (TextView) findViewById(R.id.return_money); applyReasonTv = (TextView) findViewById(R.id.apply_reason); desQuestionTv = (TextView) findViewById(R.id.des_question); uploadGridView = (GridView) findViewById(R.id.upload_gridview); uploadLayout = findViewById(R.id.upload_img_layout); upadteBtn = (Button) findViewById(R.id.update_apply_btn); cancelBtn = (Button) findViewById(R.id.cancel_apply_btn); // 设置适配器 adapter = new ReturnDetailGoodsAdapter(mContext, null); lvproduct.setAdapter(adapter); int width = (DeviceUtils.getWidthMaxPx(mContext) * 4) / 5; imageAdapter = new ImageAdapter(mContext, width, 4); uploadGridView.setAdapter(imageAdapter); uploadGridView.setOnItemClickListener(this); // 监听描述问题文本变换 upadteBtn.setOnClickListener(this); cancelBtn.setOnClickListener(this); }
private void initView() { category_line = v.findViewById(R.id.category_line); jianbian_left_iv = (ImageView) v.findViewById(R.id.jianbian_left_iv); jianbian_right_iv = (ImageView) v.findViewById(R.id.jianbian_right_iv); categoryBean = (CategoryBean) getArguments().getSerializable(INTENT_CATEGORY_BEAN); sc = (PullToRefreshScrollView) v.findViewById(R.id.class_list_level3_sc); sc.setMode(Mode.BOTH); sc.setEnabled(true); sc.setLoadingDrawable(null, Mode.BOTH); sc.getLoadingLayoutProxy().setLastUpdatedLabel(""); sc.getLoadingLayoutProxy().setPullLabel(""); sc.getLoadingLayoutProxy().setRefreshingLabel(""); sc.getLoadingLayoutProxy().setReleaseLabel(""); class_list_level3_lv = (MyListView) v.findViewById(R.id.class_list_level3_lv); class_list_level3_lv.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { if (bean3.category != null && bean3.category.size() != 0) { String id4 = bean3.category.get(arg2).ID; String categoryName = bean3.category.get(arg2).CATEGORY_NAME; Intent intent = new Intent(getActivity(), CategorySearchActivity.class); if ("全部".equals(categoryName)) { String two_category_id = categoryBean.getCategoryID() + ""; intent.putExtra(CategorySearchActivity.BUNDLE_MARK, "2"); intent.putExtra(CategorySearchActivity.BUNDLE_KEY_CATEGORY_ID, two_category_id); } else { intent.putExtra(CategorySearchActivity.BUNDLE_MARK, "3"); intent.putExtra(CategorySearchActivity.BUNDLE_KEY_CATEGORY_ID, id4); } startActivity(intent); } else { return; } } }); ab_back = (TextView) v.findViewById(R.id.ab_back); ab_title = (TextView) v.findViewById(R.id.ab_title); ab_right_btn1 = (ImageView) v.findViewById(R.id.ab_right_btn1); ab_right_btn2 = (ImageView) v.findViewById(R.id.ab_right_btn2); View line = v.findViewById(R.id.ab_line); line.setVisibility(View.VISIBLE); class_list_level3_load = (LinearLayout) v.findViewById(R.id.class_list_level3_load); ab_back.setOnClickListener(this); ab_right_btn1.setOnClickListener(this); ab_right_btn2.setOnClickListener(this); ab_right_btn2.setImageResource(R.drawable.ab_ic_search2); ab_right_btn1.setImageResource(R.drawable.ab_home_barcode); ab_right_btn1.setVisibility(View.VISIBLE); ab_right_btn2.setVisibility(View.VISIBLE); ab_title.setText(categoryBean.getCategoryName()); // 初始化数据 initDate(); }