zoukankan      html  css  js  c++  java
  • wechat客户端修改

    1. src/ui/adapter/FriendCardAdapter.java

        @Override
        public View getView(int position, View convertView, ViewGroup arg2) {
            CellHolder cell = null;
            if (convertView == null) {
                cell = new CellHolder();
                convertView = inflater.inflate(R.layout.friend_card_cell, null);
                cell.alpha = (TextView) convertView.findViewById(R.id.alpha);
                cell.avatarImageView = (ImageView) convertView.findViewById(R.id.avatarImageView);
                cell.titleView = (TextView) convertView.findViewById(R.id.title);
                cell.desView = (TextView) convertView.findViewById(R.id.des);
                convertView.setTag(cell);
            } else {
                cell = (CellHolder) convertView.getTag();
            }

            final UserInfo model = cards.get(position);
            ImageLoader.getInstance().displayImage(CommonValue.BASE_URL+model.userHead, cell.avatarImageView, CommonValue.DisplayOptions.default_options);
            cell.titleView.setText(model.nickName);
            cell.desView.setText( model.description);
            cell.alpha.setVisibility(View.GONE);
            convertView.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View arg0) {
                    //((Friend)context).createChat(model.userId+XmppConnectionManager.BASE_XMPP_SERVER_NAME);
                    ((Friend)context).createChat(model.userId+"@"+XmppConnectionManager.BASE_XMPP_SERVER_NAME+"/android/");
                }
            });

            convertView.setOnLongClickListener(new OnLongClickListener() {

            @Override
            public boolean onLongClick(View arg0) {
                ((Friend)context).show2OptionsDialog(new String[]{"删除好友"}, model);
                return true;
            }
        });


        return convertView;
    }

    2. /src/config/XmppConnectionManager.java

      /**
        * XMPP服务器连接工具类.
        */
        public class XmppConnectionManager {
            //final String XmppHost = "182.92.101.207";
            final String XmppHost = "192.168.1.103";
            final int XmppPort = 5222;
            //public static String BASE_XMPP_SERVER_NAME = "@aliyun-05808812";
            public static String BASE_XMPP_SERVER_NAME = "chat.com";

    3. /src/config/CommonValue.java

        public class CommonValue {
            public static String PackageName = "com.donal.wechat";

            //public static String BASE_API = "http://182.92.101.207:8080/wechat/api/";
            //public static String BASE_URL = "http://182.92.101.207:8080/";
            public static String BASE_API = "http://192.168.1.103:8080/wechat/api/";
            public static String BASE_URL = "http://192.168.1.103:8080/";

  • 相关阅读:
    Asp Net Core Fro MongoDB Part1
    Word 离线发布bolg测试
    Word 2016问题导致无法创建其他博客账号
    字符集工具
    人工智能笔摘
    js数组去重
    ##react-native学习笔记(windows android)##第4天,分析下目录结构
    ##react-native学习笔记(windows android)##第3天,解决白屏闪退问题
    ##react-native学习笔记(windows android)##第2天, Hello world !
    ##react-native学习笔记(windows android)##第1天,搭建开发环境
  • 原文地址:https://www.cnblogs.com/eustoma/p/4188609.html
Copyright © 2011-2022 走看看