Commit 61429a1fa9131068c341283eb92ed4b1e606a6b7

Authored by 陈硕
1 parent 93daa41a

更新demo

.idea/modules.xml
... ... @@ -4,6 +4,7 @@
4 4 <modules>
5 5 <module fileurl="file://$PROJECT_DIR$/CNChatNDemo.iml" filepath="$PROJECT_DIR$/CNChatNDemo.iml" />
6 6 <module fileurl="file://$PROJECT_DIR$/CNIMDemo.iml" filepath="$PROJECT_DIR$/CNIMDemo.iml" />
  7 + <module fileurl="file://$PROJECT_DIR$/CNIMDemo23.iml" filepath="$PROJECT_DIR$/CNIMDemo23.iml" />
7 8 <module fileurl="file://$PROJECT_DIR$/CNIMDemo5.iml" filepath="$PROJECT_DIR$/CNIMDemo5.iml" />
8 9 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
9 10 </modules>
... ...
app/libs/libcnliveutil.jar
No preview for this file type
app/src/main/AndroidManifest.xml
... ... @@ -34,8 +34,6 @@
34 34  
35 35 <activity
36 36 android:name="com.cnlive.im.ui.ChatRoomActivity"
37   - android:launchMode="singleTop"
38   - android:screenOrientation="portrait"
39 37 android:windowSoftInputMode="adjustResize"
40 38 android:theme="@style/Theme.AppCompat.Light.NoActionBar"
41 39 >
... ... @@ -43,102 +41,35 @@
43 41  
44 42 <activity
45 43 android:name="com.cnlive.im.ui.LoGinActivity"
46   - android:launchMode="singleTop"
47   - android:screenOrientation="portrait"
48   - android:windowSoftInputMode="adjustResize"
49   - android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
  44 + />
50 45  
51 46 <activity
52 47 android:name=".ui.UserLoginActivity"
53   - android:launchMode="singleTop"
54   - android:screenOrientation="portrait"
55   - android:windowSoftInputMode="adjustResize"
56   - android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
  48 + />
57 49 <activity
58 50 android:name="com.cnlive.im.ui.PrivateChatActivity"
59   - android:launchMode="singleTop"
60   - android:screenOrientation="portrait"
61   - android:windowSoftInputMode="adjustResize"
62   - android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
  51 + />
63 52  
64 53 <activity
65 54 android:name="com.cnlive.im.ui.CommentActivity"
66   - android:launchMode="singleTop"
67   - android:screenOrientation="portrait"
68   - android:windowSoftInputMode="adjustResize"
69   - android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
  55 + />
70 56  
71 57  
72   - <activity
73   - android:name=".ui.ChatItemActivity"
74   - android:launchMode="singleTop"
75   - android:screenOrientation="portrait"
76   - android:windowSoftInputMode="adjustResize"
77   - android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
78 58  
79 59 <service
80 60 android:name="io.rong.imlib.ipc.RongService"
81 61 android:exported="true"
82 62 android:process=":ipc" />
83 63  
84   - <service
85   - android:name="io.rong.imlib.ReConnectService"
86   - android:exported="true" />
  64 + <service android:name="io.rong.imlib.ReConnectService"
  65 + android:exported="true"/>
87 66  
88   - <receiver
89   - android:name="io.rong.imlib.ConnectChangeReceiver"
90   - android:exported="true" />
  67 + <receiver android:name="io.rong.imlib.ConnectChangeReceiver"
  68 + android:exported="true"/>
91 69  
92 70 <receiver
93 71 android:name="io.rong.imlib.HeartbeatReceiver"
94 72 android:process=":ipc" />
95   - <!-- com.cnlive.libs.chat config end -->
96   -
97   -
98   - <!--必选: SDK 核心功能-->
99   - <!--第三方相关,向第三方推送服务请求 token 的服务 -->
100   - <service
101   - android:name="io.rong.push.core.PushRegistrationService"
102   - android:exported="false"></service>
103   -
104   - <!-- 处理 push 消息相关的服务 -->
105   - <service
106   - android:name="io.rong.push.core.MessageHandleService"
107   - android:exported="true"></service>
108   -
109   - <!-- push服务 -->
110   - <service
111   - android:name="io.rong.push.PushService"
112   - android:exported="true"
113   - android:process="io.rong.push"> <!-- push进程,可以改名 -->
114   - </service>
115   -
116   - <!-- push 相关事件接收器 -->
117   - <receiver
118   - android:name="io.rong.push.PushReceiver"
119   - android:process="io.rong.push"> <!-- 此处进程可以改名,名称需要和PushService所在进程统一 -->
120   - <!-- 心跳事件 -->
121   - <intent-filter>
122   - <action android:name="io.rong.push.intent.action.HEART_BEAT" />
123   - </intent-filter>
124   - <!-- 网络变动事件 -->
125   - <intent-filter>
126   - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
127   - </intent-filter>
128   - <!-- 部分用户事件 -->
129   - <intent-filter>
130   - <action android:name="android.intent.action.BOOT_COMPLETED" />
131   - </intent-filter>
132   - <intent-filter>
133   - <action android:name="android.intent.action.USER_PRESENT" />
134   - <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
135   - <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
136   - </intent-filter>
137   - </receiver>
138   -
139   - <!--必选: SDK 核心功能-->
140   -
141   - <!-- end -->
142 73 </application>
143 74  
144 75 </manifest>
145 76 \ No newline at end of file
... ...
app/src/main/java/com/cnlive/im/ui/ChatRoomActivity.java
... ... @@ -68,12 +68,13 @@ public class ChatRoomActivity extends AppCompatActivity implements View.OnClickL
68 68 ChatUtil.setOnReceiveMessageListener(receiveMessageListener);
69 69  
70 70 ChatUtil.setKickedOfflineListener(onKickedOfflineListener);
  71 +
71 72 Intent intent = getIntent();
72 73 user_name_string = intent.getStringExtra("user_name_string");
73 74 String user_id_string = intent.getStringExtra("user_id_string");
74 75 if (user_name_string != null)
75   - ChatUtil.login(new CNUserInfo(user_id_string, user_name_string, ""), connectListener);
76   - else ChatUtil.logOut(connectListener);
  76 + ChatUtil.login(new CNUserInfo(user_id_string, user_name_string, ""));
  77 + else ChatUtil.logOut();
77 78  
78 79 }
79 80  
... ... @@ -317,22 +318,20 @@ public class ChatRoomActivity extends AppCompatActivity implements View.OnClickL
317 318 @Override
318 319 public void onTokenIncorrect(String s) {
319 320 Log.e(TAG, "ConnectListener TokenIncorrect");
320   - Toast.makeText(ChatRoomActivity.this, "TokenIncorrect", Toast.LENGTH_SHORT).show();
321   - finish();
  321 +
322 322 }
323 323  
324 324 @Override
325   - public void onSuccess(String s) {
  325 + public void onSuccess(final String s) {
326 326 Log.e(TAG, "ConnectListener 连接监听" + s);
327 327  
328   - Toast.makeText(ChatRoomActivity.this, s, Toast.LENGTH_SHORT).show();
329 328 }
330 329  
331 330 @Override
332   - public void onError(int i, String s) {
  331 + public void onError(int i, final String s) {
333 332 Log.e(TAG, "ConnectListener errorCode : " + i + " : errorMessage : " + s);
334   - Toast.makeText(ChatRoomActivity.this, s, Toast.LENGTH_SHORT).show();
335   - finish();
  333 +
  334 +
336 335  
337 336 }
338 337 };
... ...
app/src/main/java/com/cnlive/im/ui/LoGinActivity.java
... ... @@ -42,6 +42,7 @@ public class LoGinActivity extends AppCompatActivity implements View.OnClickList
42 42 case R.id.vis_login:
43 43 Intent intent = new Intent(LoGinActivity.this, ChatRoomActivity.class);
44 44 startActivity(intent);
  45 +
45 46 break;
46 47 case R.id.user_logOut:
47 48 ChatUtil.disconnect(false);
... ...
app/src/main/java/com/cnlive/im/ui/MainActivity.java
... ... @@ -50,6 +50,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
50 50 public void onSuccess(String s) {
51 51 Intent intent = new Intent(MainActivity.this,LoGinActivity.class);
52 52 startActivity(intent);
  53 +
53 54 }
54 55  
55 56 @Override
... ...
app/src/main/java/com/cnlive/im/ui/PrivateChatActivity.java
... ... @@ -139,7 +139,7 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
139 139 edit_layout.setVisibility(View.VISIBLE);
140 140 chatListView.setVisibility(View.VISIBLE);
141 141 CNUserInfo cnName = new CNUserInfo(user_id_string, user_name_string, "");
142   - ChatUtil.login(cnName, connectListener);
  142 + ChatUtil.login(cnName);
143 143  
144 144 }
145 145  
... ...
app/src/main/jniLibs/arm64-v8a/libRongIMLib.so
No preview for this file type
app/src/main/jniLibs/armeabi-v7a/libRongIMLib.so
No preview for this file type
app/src/main/jniLibs/armeabi/libRongIMLib.so
No preview for this file type
app/src/main/jniLibs/x86/libRongIMLib.so
No preview for this file type