@Override public View getView(final int pos, View convertView, ViewGroup viewgroup) { try { final Me_LeaderBean leaderBean = getItem(pos); if (convertView == null) { convertView = (View) inflater.inflate(R.layout.me_item_leadergrid, null); } View me_relativelayout_head = ViewHolderUtils.get(convertView, R.id.me_relativelayout_head); ImageView img_userhead = ViewHolderUtils.get(convertView, R.id.img_userhead); TextView me_textview_groupname = ViewHolderUtils.get(convertView, R.id.me_textview_groupname); TextView me_textview_detail = ViewHolderUtils.get(convertView, R.id.me_textview_detail); TextView text_dynamic_fill = ViewHolderUtils.get(convertView, R.id.text_dynamic_fill); String[] parseStr = Me_DynamicBean.fommatStr(leaderBean.UserName); if (DynamicUtil.isDynamicVersion3) { me_textview_detail.setVisibility(View.GONE); } else { if (parseStr.length > 1) { me_textview_detail.setVisibility(View.VISIBLE); me_textview_detail.setText(parseStr[1]); } else { me_textview_detail.setVisibility(View.INVISIBLE); me_textview_detail.setText(""); } } me_textview_groupname.setText(parseStr[0]); ImageLoader.loadHeadImage( (BaseActivity) mContext, img_userhead, ProjectUtil.getBigPic(leaderBean.UserImage)); if (mViewType == DynamicUtil.VIEW_DYNAMIC_BY_MANAGER_TYPE && leaderBean.ExistsDymic.equals("true")) { text_dynamic_fill.setVisibility(View.VISIBLE); } else { text_dynamic_fill.setVisibility(View.GONE); } me_relativelayout_head.setTag(leaderBean); me_relativelayout_head.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Object object = v.getTag(); if (object instanceof Me_LeaderBean) { if (onLeaderItemClickListener != null) { onLeaderItemClickListener.onClick((Me_LeaderBean) object); } } } }); } catch (Exception e) { e.printStackTrace(); } return convertView; }
@SuppressLint("SetJavaScriptEnabled") private void initUI() { webView = (WebView) findViewById(R.id.web); webView.getSettings().setJavaScriptEnabled(true); progress_loading = (ProgressBar) findViewById(R.id.progress_loading); progress_loading.setVisibility(View.VISIBLE); txtViewBack = (TextView) findViewById(R.id.txtViewBack); tv_GoBACK = (TextView) findViewById(R.id.tv_GoBACK); txt_title = (TextView) findViewById(R.id.txt_title); txtViewBack.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { if (webView.canGoBack()) { webView.goBack(); } else { finish(); } } }); tv_GoBACK.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { finish(); } }); String aesString = AESHelper.encrypt( ConstantPool.getInstance().USER_ACCOUNT + "_!@#$%^_" + ProjectUtil.getCurrentTime(), "Hna&^%User!@#10001000000003"); String s = aesString.replace("+", "%2b"); String url = "http://jjrs.hnagroup.net:8410/wap/login" + "?sid=" + s; try { webView.loadUrl(URLDecoder.decode(url, "UTF-8").replace("+", "%2b")); } catch (Exception e) { e.printStackTrace(); } webView.setWebViewClient(new HelloWebViewClient()); webView.setWebChromeClient( new WebChromeClient() { @Override public void onReceivedTitle(WebView view, String title) { super.onReceivedTitle(view, title); txt_title.setText(title); } }); }
@Override public void onClick(View v) { // Intent intent = IntentUtil.getSmsIntent(phoneNo, sms_body); // mContext.startActivity(intent); ArrayList<String> accountList = new ArrayList<String>(); accountList.add(account); ArrayList<String> mobileList = new ArrayList<String>(); mobileList.add(phoneNo); ProjectUtil.invite( mContext, "您发送邀请,会产生一定的短信费用,请确认!", accountList, mobileList, new InviteListener() { @Override public void onInviteSus() {} }); }
/** 分享 */ private void doShare( String image, String title, String id, String fileClass, String content, String strRespondTitle, String cnname) { ProjectUtil.gotoAddShareActivity( this, "PUBLICS_SHARE", image, title, id, fileClass, content, strRespondTitle, ConstantPool.getInstance().USER_ACCOUNT, cnname); }
@Override public View getView(final int pos, View convertView, ViewGroup viewgroup) { ViewHolder vh = null; if (convertView == null) { vh = new ViewHolder(); convertView = mInflater.inflate(R.layout.me_item_newfriend, null); vh.addMsg_textview = (TextView) convertView.findViewById(R.id.me_textview_addfriend); vh.icon_imageView = (ImageView) convertView.findViewById(R.id.me_imageview_headicon); vh.icon_imageView_add = (ImageView) convertView.findViewById(R.id.me_imageview_headgo); vh.level_textview = (TextView) convertView.findViewById(R.id.me_textview_mycompany); vh.name_textview = (TextView) convertView.findViewById(R.id.me_textview_myname); vh.me_linearlayout_addfriend = (LinearLayout) convertView.findViewById(R.id.me_linearlayout_addfriend); vh.text_msg_phone = (TextView) convertView.findViewById(R.id.text_msg_phone); vh.text_msg_chat = (TextView) convertView.findViewById(R.id.text_msg_chat); vh.selected_check = (CheckBox) convertView.findViewById(R.id.selected_check); if (isSelected) { vh.selected_check.setVisibility(View.VISIBLE); vh.me_linearlayout_addfriend.setVisibility(View.GONE); } else { vh.selected_check.setVisibility(View.GONE); vh.me_linearlayout_addfriend.setVisibility(View.VISIBLE); } convertView.setTag(vh); } else { vh = (ViewHolder) convertView.getTag(); } ConteactMode mode = friendList.get(pos); vh.icon_imageView.setTag(mode); vh.addMsg_textview.setTag(mode); vh.text_msg_phone.setTag(mode); vh.text_msg_chat.setTag(mode); vh.selected_check.setChecked(mode.selectedState); // vh.name_textview.setText(mode.getName()); vh.addMsg_textview.setVisibility(View.GONE); vh.text_msg_phone.setVisibility(View.GONE); vh.text_msg_chat.setVisibility(View.GONE); vh.icon_imageView_add.setVisibility(View.GONE); String name = mode.getName(); if (mode.getInstall().equalsIgnoreCase("1")) { // name = name + "(已安装)"; // 已安装的用户 // vh.me_linearlayout_addfriend // .setOnClickListener(new MySendMsgClickListener(mode)); if (!mode.Account.equals(ConstantPool.getInstance().USER_ACCOUNT)) { vh.text_msg_chat.setVisibility(View.VISIBLE); vh.text_msg_chat.setOnClickListener(new MySendMsgClickListener(mode)); // vh.addMsg_textview.setText("发消息"); // // vh.addMsg_textview.setTextColor(mContext.getResources().getColor( // R.color.me_addfriend)); // 是自己,隐藏发消息的按钮 // vh.addMsg_textview.setVisibility(View.GONE); } } else { name = name + "(未安装)"; vh.addMsg_textview.setVisibility(View.VISIBLE); vh.addMsg_textview.setText("邀请"); vh.addMsg_textview.setTextColor(mContext.getResources().getColor(R.color.me_addfriend)); // String sms_body = "您好," // + mode.name // + // ",我在使用“海航通”交流工作,和同事发文字、语音、图片,方便极了。你也一起来吧,下载地址:http://mobilehnasis.hnair.com/apps/jjrs.html#mp.weixin.qq.com,记得安装后加我:" // + ConstantPool.getInstance().USER_ACCOUNT_NAME; // String sms_body = mContext.getResources().getString(R.string.me_invite_content) // + ConstantPool.getInstance().USER_ACCOUNT_NAME; String sms_body = String.format( mContext.getResources().getString(R.string.me_invite_content), ConstantPool.getInstance().USER_ACCOUNT_NAME); vh.addMsg_textview.setOnClickListener( new MyInviteClickListener(mode.Account, mode.phoneNumber, sms_body)); } if (!TextUtils.isEmpty(mode.getPhoneNumber()) && !mode.Account.equals(ConstantPool.getInstance().USER_ACCOUNT)) { vh.text_msg_phone.setVisibility(View.VISIBLE); vh.text_msg_phone.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Object object = v.getTag(); if (object != null && object instanceof ConteactMode) { ConteactMode conteactMode = (ConteactMode) object; // Intent intent = // IntentUtil.getPhoneDialIntent(conteactMode.getPhoneNumber()); // mContext.startActivity(intent); ProjectUtil.selectCall(mContext, conteactMode.getPhoneNumber(), false); } } }); } if (!StringUtil.isEmpty(name)) { vh.name_textview.setText(name); } vh.level_textview.setText(mode.getDepartment() + " " + mode.getLevel()); // 现在的版本搜索界面只判断是否安装 /* * String state = mode.getState(); if (!StringUtil.isEmpty(state)) { // * 我发起的请求信息 if (state.equals("添加")) { // 点击添加好友 * vh.icon_imageView_add.setVisibility(View.VISIBLE); * vh.addMsg_textview.setText(mContext.getResources().getString( * R.string.me_add_text)); * vh.addMsg_textview.setTextColor(mContext.getResources() * .getColor(R.color.me_addfriend)); vh.me_linearlayout_addfriend * .setOnClickListener(new MyClickListener( vh.addMsg_textview, * vh.icon_imageView_add, mode)); } else if (state.equals("验证")) { // * 别人发的添加信息 vh.addMsg_textview.setText("通过验证"); * vh.icon_imageView_add.setVisibility(View.GONE); * vh.addMsg_textview.setTextColor(mContext.getResources() * .getColor(R.color.me_addfriend)); // 通过 vh.me_linearlayout_addfriend * .setOnClickListener(new MyPassClickListener(friendList, mode, "通过", * pos)); // // //拒绝 // * vh.me_textview_addfriend_pass.setOnClickListener(new // * OnClickListener() { // // @Override // public void onClick(View v) { * // ConteactMode mode = (ConteactMode) v.getTag(); // * AddValidation(mode.Userid,"拒绝"); // } // }); } else if * (state.equals("等待验证")) { vh.addMsg_textview.setText("验证中"); * vh.addMsg_textview.setTextColor(mContext.getResources() * .getColor(R.color.color_lightgrey)); * vh.icon_imageView_add.setVisibility(View.GONE); } else if * (state.equals("已添加")) { vh.addMsg_textview.setText("已添加"); * vh.addMsg_textview.setTextColor(mContext.getResources() * .getColor(R.color.color_lightgrey)); * vh.icon_imageView_add.setVisibility(View.GONE); } } */ // 下载图片 String midUrl = ProjectUtil.getBigPic(mode.image); ImageLoader.loadHeadImage((BaseActivity) mContext, vh.icon_imageView, midUrl); return convertView; }