@SuppressWarnings("static-access") private void setview() { // TODO Auto-generated method stub if (identify != null) { if (identify.getStatus() == 0) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核不通过。因为:"); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 1) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核中,我们将在三个工作日内审核完成"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 2) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("恭喜你已经认证通过,快点完善其它资料吧"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else { tv_show.setVisibility(View.VISIBLE); tv_show.setText("通过认证后,更有说服力~"); } } }
private void setview() { // TODO Auto-generated method stub if (identify != null) { if (identify.getStatus() == 0) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核不通过。因为:"); bt_upload.setText("重新上传"); // if(!identify.getPic().equals(null)){ // LinearLayout.LayoutParams linearParams = (LinearLayout.LayoutParams) // relat_photo.getLayoutParams(); // linearParams.height=LayoutParams.WRAP_CONTENT; // 当控件的高强制设成365象素 // linearParams.width=LayoutParams.WRAP_CONTENT; // relat_photo.setLayoutParams(linearParams); // 使设置好的布局参数应用到控件aaa ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 1) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核中,我们将在三个工作日内审核完成"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 2) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("恭喜你已经认证通过,快点完善其它资料吧"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else { tv_show.setVisibility(View.VISIBLE); tv_show.setText("只有通过身份认证,学生才可以搜索到你哟~"); } } }
@Override public void run() { // TODO Auto-generated method stub Message msg = handler.obtainMessage(); msg.what = 2; msg.obj = "未能连接服务器"; File file = new File(filepath); final long lenght = file.length(); HttpPostUtil httpPostUtil = new HttpPostUtil( XswApplication.V2_URL_HOST + "/identify/UploadPic", XswApplication.getInstance().getSessionId()); httpPostUtil.addFileParameter("file", file); String result = httpPostUtil.uploadImage( new UpLoadValue() { @Override public void upload(int value) { // TODO Auto-generated method stub if (value < 100) { Message msg = handler.obtainMessage(); msg.what = -1; msg.arg1 = value; handler.sendMessage(msg); } } }, lenght); if (result != null) { isupload = true; int ret = -1; try { JSONObject jsonObject = new JSONObject(result); if (jsonObject.has("ret")) { ret = jsonObject.getInt("ret"); } if (ret == 0) { if (jsonObject.has("msg")) { String pic = jsonObject.getString("msg"); StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("type="); stringBuffer.append(3); stringBuffer.append("&pic="); stringBuffer.append(pic); String post = HTTPUtil.loginPostString( XswApplication.V2_URL_HOST + "/identify/ApplyIdentify", stringBuffer.toString()); if (post != null) { JSONObject jsonObject2 = new JSONObject(post); if (jsonObject2.has("ret")) { int re = jsonObject2.getInt("ret"); if (re == 0) { msg.what = 3; msg.obj = "保存成功,已经提交人工审核"; } else if (re == 1) { msg.what = 3; msg.obj = "您上次提交的申请正在审核,暂时无法提交新的申请"; } } } } } } catch (JSONException e) { // TODO Auto-generated // catch block e.printStackTrace(); } } else { msg.what = 2; } handler.sendMessage(msg); }
/** ListView Item设置 */ @Override public View getView(int position, View convertView, ViewGroup parent) { // Log.d("method", "getView"); // 自定义视图 ListItemView listItemView = null; final Curriculum curriculum = listItems.get(position); if (convertView == null) { // 获取list_item布局文件的视图 convertView = listContainer.inflate(R.layout.writelog_item, null); listItemView = new ListItemView(); // 获取控件对象 listItemView.tv_name = (TextView) convertView.findViewById(R.id.tv_name); listItemView.CourseName = (TextView) convertView.findViewById(R.id.CourseName); listItemView.data = (TextView) convertView.findViewById(R.id.data); listItemView.month = (TextView) convertView.findViewById(R.id.month); listItemView.bt_img = (Button) convertView.findViewById(R.id.bt_img); listItemView.week = (TextView) convertView.findViewById(R.id.week); listItemView.ly_item = (LinearLayout) convertView.findViewById(R.id.ly_item); // listItemView.CourseLongTime = (TextView) convertView // .findViewById(R.id.CourseLongTime); // listItemView.ItemReview = (TextView) convertView // .findViewById(R.id.ItemReview); listItemView.header = (RoundImageView) convertView.findViewById(R.id.header); // 设置控件集到convertView convertView.setTag(listItemView); // convertView.setLongClickable(true); // listItemView.btnCollect.setTag(R.id.btnCollect, 0); } else { listItemView = (ListItemView) convertView.getTag(); } listItemView.bt_img.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { writelog(curriculum); } }); listItemView.CourseName.setText((curriculum.getGrade()) + (curriculum.getCourse())); listItemView.tv_name.setText(curriculum.getRealname()); try { TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); Date date = new Date(curriculum.getTimestamp()); listItemView.data.setText(ALLUtil.getDateD(date)); listItemView.month.setText(ALLUtil.getDateM(date)); String hour = "上午"; if (date.getHours() > 12) { if (date.getHours() > 18) { hour = "晚上"; } else { hour = "下午"; } } else { hour = "上午"; } long end = 60 * 60 * 1000 * curriculum.getClass_hours() + curriculum.getTimestamp(); String sdfs = new SimpleDateFormat("HH:mm").format(new Date(end)); // 毫秒 listItemView.week.setText( ALLUtil.getWeekOfDate(date) + " " + hour + " " + ALLUtil.getDateDay(date) + "-" + sdfs); } catch (Exception e) { // TODO: handle exception } // listItemView.Note.setText(BookingStatusENUM.getName(curriculum // .getStatus())); switch (curriculum.getStatus()) { case 2: // 上课之前就是 上课过程 // if (curriculum.getBooking_time() < System.currentTimeMillis()) { // listItemView.bt_img.setText("进行中"); // } else { // listItemView.bt_img.setText("老师已确认,待上课"); // // } // break; default: break; } ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), curriculum.getStudent_Face(), listItemView.header); return convertView; }