Skip to content

Commit

Permalink
登陆处初始化联系人列表
Browse files Browse the repository at this point in the history
  • Loading branch information
huangfangyi committed Jul 16, 2016
1 parent fe6f06a commit 50d4048
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 23 deletions.
Binary file modified .gradle/2.10/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.10/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.10/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.10/taskArtifacts/taskArtifacts.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions build/intermediates/blame/res/debug/single/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_main_botton_tab.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_main_botton_tab.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_context_menu_for_image.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_context_menu_for_image.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\player_layout_rotate_video_view.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\player_layout_rotate_video_view.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\fx_chat_neterror_item.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\fx_chat_neterror_item.xml"
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_context_menu_for_image.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_context_menu_for_image.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\rp_activity_change.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\exploded-aar\\FanXin0712\\redpacketlibrary\\unspecified\\res\\layout\\rp_activity_change.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_logout_actionsheet.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_logout_actionsheet.xml"
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\fx_chat_neterror_item.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\fx_chat_neterror_item.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\fx_group_avatar8.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\fx_group_avatar8.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_logout_actionsheet.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_logout_actionsheet.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\live_layout_live_room_record_finish.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\live_layout_live_room_record_finish.xml"
Expand Down Expand Up @@ -75,26 +75,26 @@
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\activity_video_demo1.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\activity_video_demo1.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\design_bottom_sheet_dialog.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\exploded-aar\\com.android.support\\design\\23.2.1\\res\\layout\\design_bottom_sheet_dialog.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\ease_row_sent_voice.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\exploded-aar\\FanXin0712\\easeuilibrary\\unspecified\\res\\layout\\ease_row_sent_voice.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_activity_public_groups_search.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_activity_public_groups_search.xml"
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\design_bottom_sheet_dialog.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\exploded-aar\\com.android.support\\design\\23.2.1\\res\\layout\\design_bottom_sheet_dialog.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_activity_chat.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_activity_chat.xml"
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_activity_public_groups_search.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_activity_public_groups_search.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\fx_activity_login.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\fx_activity_login.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_activity_chat.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_activity_chat.xml"
},
{
"merged": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\build\\intermediates\\res\\merged\\debug\\layout\\em_activity_group_search_message.xml",
"source": "C:\\Users\\ustc\\Desktop\\Android Studio\\FanXin0712\\res\\layout\\em_activity_group_search_message.xml"
Expand Down
4 changes: 2 additions & 2 deletions build/intermediates/manifests/full/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
android:theme="@style/PlayAppTheme" >
</activity>
<activity
android:name="com.fanxin.app.main.activity.WatchLiveActivity"
android:name="com.fanxin.app.main.activity.LiveWatchActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/horizontal_slide"
Expand All @@ -441,7 +441,7 @@
android:screenOrientation="portrait"
android:theme="@style/SettingTheme" />
<activity
android:name="com.fanxin.app.main.ulive.LiveActivity"
android:name="com.fanxin.app.main.activity.LiveActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/SettingTheme"
Expand Down
6 changes: 3 additions & 3 deletions build/outputs/logs/manifest-merger-debug-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:4
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:414:13-48
android:name
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:411:13-56
activity#com.fanxin.app.main.activity.WatchLiveActivity
activity#com.fanxin.app.main.activity.LiveWatchActivity
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:419:9-431:20
android:screenOrientation
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:422:13-49
Expand Down Expand Up @@ -882,7 +882,7 @@ ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:4
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:445:13-48
android:name
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:442:13-67
activity#com.fanxin.app.main.ulive.LiveActivity
activity#com.fanxin.app.main.activity.LiveActivity
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:447:9-453:20
android:screenOrientation
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:449:13-49
Expand All @@ -893,7 +893,7 @@ ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:4
android:theme
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:452:13-48
android:name
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:448:13-52
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:448:13-55
activity#com.fanxin.app.main.ulive.upload.PublishDemo4MediaCodec
ADDED from C:\Users\ustc\Desktop\Android Studio\FanXin0712\AndroidManifest.xml:455:9-461:20
android:screenOrientation
Expand Down
1 change: 0 additions & 1 deletion res/layout/fx_item_live_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:orientation="horizontal">

<ImageView
Expand Down
24 changes: 24 additions & 0 deletions src/com/fanxin/app/main/activity/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,30 @@
import android.widget.EditText;
import android.widget.Toast;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.easemob.redpacketsdk.RPCallback;
import com.easemob.redpacketsdk.RedPacket;
import com.fanxin.app.DemoApplication;
import com.fanxin.app.DemoHelper;
import com.fanxin.app.R;
import com.fanxin.app.db.DemoDBManager;
import com.fanxin.app.db.UserDao;
import com.fanxin.app.main.FXConstant;
import com.fanxin.app.main.fragment.MainActivity;
import com.fanxin.app.main.utils.JSONUtil;
import com.fanxin.app.main.utils.Param;
import com.fanxin.app.main.utils.OkHttpManager;

import com.fanxin.app.ui.BaseActivity;
import com.fanxin.easeui.domain.EaseUser;
import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Login screen
Expand Down Expand Up @@ -112,6 +118,24 @@ public void onResponse(JSONObject jsonObject) {
int code = jsonObject.getInteger("code");
if (code == 1) {
JSONObject json = jsonObject.getJSONObject("user");
JSONArray friends=jsonObject.getJSONArray("friends");
Map<String, EaseUser> userlist = new HashMap<String, EaseUser>();
if (friends != null) {
for (int i = 0; i < friends.size(); i++) {
JSONObject friend = friends.getJSONObject(i);
EaseUser easeUser = JSONUtil.Json2User(friend);
userlist.put(easeUser.getUsername(), easeUser);
}
// save the contact list to cache
DemoHelper.getInstance().getContactList().clear();
DemoHelper.getInstance().getContactList().putAll(userlist);
// save the contact list to database
UserDao dao = new UserDao(getApplicationContext());
List<EaseUser> users = new ArrayList<EaseUser>(userlist.values());
dao.saveContactList(users);

}

loginHuanXin(json, pd);
} else if (code == 2) {
pd.dismiss();
Expand Down

0 comments on commit 50d4048

Please sign in to comment.