Commit 799e21deea48cfd5bb4aba1d008811c035870a72

Authored by 朱显松
2 parents 6691d9ea b38b31c0

合并

.idea/markdown-exported-files.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="MarkdownExportedFiles">
  4 + <htmlFiles />
  5 + <imageFiles />
  6 + <otherFiles />
  7 + </component>
  8 +</project>
0 9 \ No newline at end of file
... ...
.idea/markdown-navigator.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="MarkdownProjectSettings">
  4 + <PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true">
  5 + <PanelProvider>
  6 + <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
  7 + </PanelProvider>
  8 + </PreviewSettings>
  9 + <ParserSettings>
  10 + <PegdownExtensions>
  11 + <option name="ABBREVIATIONS" value="false" />
  12 + <option name="ANCHORLINKS" value="true" />
  13 + <option name="ATXHEADERSPACE" value="true" />
  14 + <option name="AUTOLINKS" value="true" />
  15 + <option name="DEFINITIONS" value="false" />
  16 + <option name="FENCED_CODE_BLOCKS" value="true" />
  17 + <option name="FOOTNOTES" value="false" />
  18 + <option name="HARDWRAPS" value="false" />
  19 + <option name="INSERTED" value="false" />
  20 + <option name="QUOTES" value="false" />
  21 + <option name="RELAXEDHRULES" value="true" />
  22 + <option name="SMARTS" value="false" />
  23 + <option name="STRIKETHROUGH" value="true" />
  24 + <option name="SUBSCRIPT" value="false" />
  25 + <option name="SUPERSCRIPT" value="false" />
  26 + <option name="SUPPRESS_HTML_BLOCKS" value="false" />
  27 + <option name="SUPPRESS_INLINE_HTML" value="false" />
  28 + <option name="TABLES" value="true" />
  29 + <option name="TASKLISTITEMS" value="true" />
  30 + <option name="TOC" value="false" />
  31 + <option name="WIKILINKS" value="true" />
  32 + </PegdownExtensions>
  33 + <ParserOptions>
  34 + <option name="COMMONMARK_LISTS" value="false" />
  35 + <option name="DUMMY" value="false" />
  36 + <option name="EMOJI_SHORTCUTS" value="true" />
  37 + <option name="FLEXMARK_FRONT_MATTER" value="false" />
  38 + <option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="true" />
  39 + <option name="GFM_TABLE_RENDERING" value="true" />
  40 + <option name="GITBOOK_URL_ENCODING" value="false" />
  41 + <option name="GITHUB_EMOJI_URL" value="false" />
  42 + <option name="GITHUB_LISTS" value="true" />
  43 + <option name="GITHUB_WIKI_LINKS" value="true" />
  44 + <option name="JEKYLL_FRONT_MATTER" value="false" />
  45 + <option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
  46 + </ParserOptions>
  47 + </ParserSettings>
  48 + <HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
  49 + <GeneratorProvider>
  50 + <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
  51 + </GeneratorProvider>
  52 + <headerTop />
  53 + <headerBottom />
  54 + <bodyTop />
  55 + <bodyBottom />
  56 + </HtmlSettings>
  57 + <CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
  58 + <StylesheetProvider>
  59 + <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
  60 + </StylesheetProvider>
  61 + <ScriptProviders />
  62 + <cssText />
  63 + </CssSettings>
  64 + <HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
  65 + <LinkMapSettings>
  66 + <textMaps />
  67 + </LinkMapSettings>
  68 + </component>
  69 +</project>
0 70 \ No newline at end of file
... ...
.idea/markdown-navigator/profiles_settings.xml 0 → 100644
  1 +<component name="MarkdownNavigator.ProfileManager">
  2 + <settings default="" pdf-export="" />
  3 +</component>
0 4 \ No newline at end of file
... ...
app/src/main/java/com/cnlive/im/ui/ChatRoomActivity.java
... ... @@ -66,6 +66,7 @@ public class ChatRoomActivity extends AppCompatActivity implements View.OnClickL
66 66 ChatUtil.setConnectStatusListener(connectStatusListener);
67 67 ChatUtil.setOnChatRoomActionListener(chatRoomActionListener);
68 68 ChatUtil.setOnReceiveMessageListener(receiveMessageListener);
  69 +
69 70 ChatUtil.setKickedOfflineListener(onKickedOfflineListener);
70 71 Intent intent = getIntent();
71 72 user_name_string = intent.getStringExtra("user_name_string");
... ... @@ -155,9 +156,11 @@ public class ChatRoomActivity extends AppCompatActivity implements View.OnClickL
155 156 @Override
156 157 public void processMessage(final CNMessage cnMessage) {
157 158 Log.v(TAG, "receiveMessageListener" + " " + cnMessage.getTargetId() + " " + cnMessage.getContent());
  159 +
158 160 mHandler.post(new Runnable() {
159 161 @Override
160 162 public void run() {
  163 +
161 164 try {
162 165 JSONObject jsonObject = new JSONObject(cnMessage.getContent().toString());
163 166 String type = (String) jsonObject.get("type");
... ... @@ -179,6 +182,14 @@ public class ChatRoomActivity extends AppCompatActivity implements View.OnClickL
179 182 };
180 183  
181 184  
  185 +
  186 +
  187 +
  188 +
  189 +
  190 +
  191 +
  192 +
182 193 //聊天室操作
183 194 private IChat.OnChatRoomActionListener chatRoomActionListener = new IChat.OnChatRoomActionListener() {
184 195 @Override
... ...
app/src/main/java/com/cnlive/im/ui/PrivateChatActivity.java
... ... @@ -53,7 +53,7 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
53 53 private EditText opposite_name_edit;
54 54 private String user_name_string;
55 55 private String user_id_string;
56   - private int sendInfo = 1;
  56 + private int sendInfo = 3;
57 57 private Button agree_btn;
58 58 private Button reject_btn;
59 59 private LinearLayout agree_reject_lin;
... ... @@ -109,8 +109,12 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
109 109 } else if (sendInfo == 4) {
110 110 Toast.makeText(this, "对方已经拒绝不能发送", Toast.LENGTH_SHORT).show();
111 111  
112   - } else {
113   -
  112 + } else if (sendInfo == 3) {
  113 + Toast.makeText(this, "还没有邀请对方呦~", Toast.LENGTH_SHORT).show();
  114 + }
  115 + else if (sendInfo == 5) {
  116 + Toast.makeText(this, "你已经拒绝对方不能发送消息", Toast.LENGTH_SHORT).show();
  117 + }else {
114 118 if (messageContent.getText().toString().isEmpty()) {
115 119 Toast.makeText(this, "不能发送空消息呦~", Toast.LENGTH_SHORT).show();
116 120 } else {
... ... @@ -118,11 +122,10 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
118 122 ChatUtil.sendMessage(IChat.PRIVATE, oppositeID, objToJsonString, sendMessageListener);
119 123 messageContent.setText("");
120 124 }
121   -
122   -
123 125 }
124 126  
125 127 break;
  128 +
126 129 case R.id.userId_btn_top:
127 130 //发送私聊消息,需要传入目标ID与发送的消息内容
128 131 if (user_id_edit.getText().toString().isEmpty()) {
... ... @@ -217,13 +220,14 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
217 220 sendInfo = 2;
218 221 Toast.makeText(PrivateChatActivity.this, "申请已发送等待对方验证", Toast.LENGTH_SHORT).show();
219 222 } else if ("3".equals(type) && message.equals("拒绝")) {
  223 + sendInfo=5;
220 224 } else if ("3".equals(type) && message.equals("同意")) {
  225 + sendInfo=1;
221 226 } else if ("4".equals(type)) {
222 227 messageList.add(new ChatRoomActivity.CNMessageInfo(cnMessage, true));
223 228 chatListAdapter.updateItems(messageList);
224 229 chatListAdapter.notifyDataSetChanged();
225 230 }
226   -
227 231 } catch (JSONException e) {
228 232  
229 233  
... ... @@ -265,10 +269,12 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli
265 269 private IChat.OnReceiveMessageListener receiveMessageListener = new IChat.OnReceiveMessageListener() {
266 270 @Override
267 271 public void processMessage(final CNMessage cnMessage) {
  272 +
  273 +
268 274 mHandler.post(new Runnable() {
269 275 @Override
270 276 public void run() {
271   -
  277 + Log.v("cnMessage", cnMessage.getTargetId() + "," + cnMessage.getUserInfo().getUserId());
272 278 JSONObject jsonObject = null;
273 279 try {
274 280 jsonObject = new JSONObject(cnMessage.getContent().toString());
... ...