@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("通过认证后,更有说服力~"); } } }
void photocorp(final String Path) { ServiceLoader.getInstance() .submit( new Runnable() { @Override public void run() { // TODO Auto-generated method stub if (Path != null) { // 存放照片的文件夹 // 压缩上传的图片 // ImageUtils.saveImageToSD(DownloadUtil.FILEPATH + "/" // + imageup, extras, 100); DisplayMetrics metric = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metric); BitmapFactory.Options newOpts = new BitmapFactory.Options(); // 开始读入图片,此时把options.inJustDecodeBounds 设回true了 newOpts.inJustDecodeBounds = true; BitmapFactory.decodeFile(Path, newOpts); // 此时返回bm为空 int outheight = newOpts.outHeight; int outWidth = newOpts.outWidth; final LayoutParams params = relat_photo.getLayoutParams(); int width = params.width == LayoutParams.WRAP_CONTENT ? 0 : relat_photo.getWidth(); // Get actual image width if (width <= 0) { width = metric.widthPixels; // 屏幕宽度(像素) } if (outheight <= 0) { outheight = metric.heightPixels; // 屏幕宽度(像素) } int height = 0; if (width > outWidth) { width = outWidth; height = outheight; } else { height = width * outheight / outWidth; } Bitmap bitmap = ImageUtils.getimage(relat_photo, Path, height, width, 500); if (bitmap == null) { return; } isupload = false; Message msg = new Message(); msg.what = 1; msg.obj = bitmap; handler.sendMessage(msg); filepath = Path; } } }); }
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("只有通过身份认证,学生才可以搜索到你哟~"); } } }
/** 选择图片 以及上传 2015-3-6 @author lzx */ void setfile() { if (!filepath.equals("") && !isupload) { if (ALLUtil.isNetworkConnected(TeacherIdenSetAcitvity.this)) { Message msg = handler.obtainMessage(); msg.what = -1; msg.arg1 = 0; handler.sendMessage(msg); UpdateFile updateFile = new UpdateFile(); ServiceLoader.getInstance().submit(updateFile); } else { ShowToast.showTips(TeacherIdenSetAcitvity.this, "网络不可用"); } } else { getphoto(); } }
/** 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; }