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
}
public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
if (!validateFavoriteLimit()) {
return false;
}
try {
boolean result = chatData.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.refreshContactScreen();
return true;
return chatData.insertFavoriteUser(shopMemberId);
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
}
......@@ -1196,12 +1191,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
try {
boolean result = chatData.deleteFavoriteUser(shopMemberId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
return chatData.deleteFavoriteUser(shopMemberId);
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
}
......@@ -1209,19 +1199,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
}
public boolean addFavoriteGroup(String groupId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
if (!validateFavoriteLimit()) {
return false;
}
try {
boolean result = chatData.insertFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
return chatData.insertFavoriteGroup(groupId);
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
}
......@@ -1231,12 +1214,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public boolean removeFavoriteGroup(String groupId) throws AcmsException {
try {
boolean result = deleteFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.refreshContactScreen();
return true;
return deleteFavoriteGroup(groupId);
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
}
......@@ -1247,6 +1225,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
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() {
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
......@@ -1294,7 +1281,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
List<MeetingDto> meetingList = meetingManager.getMeetingList(mSkey);
meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false);
meetingManager.setCollaboration(true);
} catch (Exception e) {
......
......@@ -640,8 +640,4 @@ public class ChatWebView extends WebView {
public void startAudioCollaboration() {
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