Commit f0e958b9 by Kim Peace

Merge branch 'communication/bug/#43889_namecard_and_favorite' into 'communication/develop'

Fixed to not hide name card when favorite add or removed

See merge request !198
parents ad70fe02 ab39aee0
...@@ -1176,17 +1176,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1176,17 +1176,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
public boolean addFavoriteUser(String shopMemberId) throws AcmsException { public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); if (!validateFavoriteLimit()) {
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
return false; return false;
} }
try { try {
boolean result = chatData.insertFavoriteUser(shopMemberId); return chatData.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline)); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
...@@ -1196,12 +1191,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1196,12 +1191,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException { public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
try { try {
boolean result = chatData.deleteFavoriteUser(shopMemberId); return chatData.deleteFavoriteUser(shopMemberId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline)); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
...@@ -1209,19 +1199,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1209,19 +1199,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
public boolean addFavoriteGroup(String groupId) throws AcmsException { public boolean addFavoriteGroup(String groupId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); if (!validateFavoriteLimit()) {
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
return false; return false;
} }
try { try {
boolean result = chatData.insertFavoriteGroup(groupId); return chatData.insertFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline)); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
...@@ -1231,12 +1214,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1231,12 +1214,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public boolean removeFavoriteGroup(String groupId) throws AcmsException { public boolean removeFavoriteGroup(String groupId) throws AcmsException {
try { try {
boolean result = deleteFavoriteGroup(groupId); return deleteFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline)); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
...@@ -1247,6 +1225,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1247,6 +1225,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
chatData.updateFavoriteInfo(); chatData.updateFavoriteInfo();
} }
private boolean validateFavoriteLimit() {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
return false;
}
return true;
}
public int createContentView() { public int createContentView() {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
...@@ -1294,7 +1281,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1294,7 +1281,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
meetingManager.close(); meetingManager.close();
try { try {
connectMeetingServer(); connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey); List<MeetingDto> meetingList = meetingManager.getMeetingList(mSkey);
meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false); meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false);
meetingManager.setCollaboration(true); meetingManager.setCollaboration(true);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -640,8 +640,4 @@ public class ChatWebView extends WebView { ...@@ -640,8 +640,4 @@ public class ChatWebView extends WebView {
public void startAudioCollaboration() { public void startAudioCollaboration() {
loadChatViewUrl(String.format("javascript:Common.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO )); loadChatViewUrl(String.format("javascript:Common.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO ));
} }
public void refreshContactScreen() {
loadChatViewUrl("javascript:Common.refreshContactScreen();");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment