Commit 2ed6b474 by yuichiro ogawa

Chat機能移植及びリファクタリング

parent 7218f80e
...@@ -625,19 +625,21 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -625,19 +625,21 @@ public class AcmsClient implements AcmsClientResponseListener {
/** /**
* パノラマで使用するシーンを登録 * パノラマで使用するシーンを登録
* @param sid * @param sid
* @param contentId
* @param FormFile シーンで使用する画像 * @param FormFile シーンで使用する画像
* @return * @return
* @throws IOException * @throws IOException
* @throws AcmsException * @throws AcmsException
*/ */
public SceneEntryJSON sceneEntry(String sid, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException { public SceneEntryJSON sceneEntry(String sid, Long contentId, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException(); throw new NetworkDisconnectedException();
} }
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSceneEntry); String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSceneEntry);
HttpMultipart part1 = new HttpMultipart(ABookKeys.SID, sid); HttpMultipart part1 = new HttpMultipart(ABookKeys.SID, sid);
HttpMultipart part2 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile); HttpMultipart part2 = new HttpMultipart(ABookKeys.CONTENT_ID, StringUtil.toString(contentId));
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2}); HttpMultipart part3 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile);
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2, part3});
SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody); SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody);
if (json.httpStatus != 200) { if (json.httpStatus != 200) {
if (json.errorMessage != null) { if (json.errorMessage != null) {
......
...@@ -1391,11 +1391,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -1391,11 +1391,12 @@ public class OperationLogic extends AbstractLogic {
/** /**
* シーンの登録 * シーンの登録
* @param file * @param file
* @param contentId
* @throws IOException * @throws IOException
* @throws AcmsException * @throws AcmsException
*/ */
public Integer sendScene(File file) throws IOException, AcmsException, NetworkDisconnectedException { public Integer sendScene(File file, Long contentId) throws IOException, AcmsException, NetworkDisconnectedException {
SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, file); SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, contentId, file);
return json.resourceId; return json.resourceId;
} }
......
...@@ -344,7 +344,6 @@ ...@@ -344,7 +344,6 @@
<string name="operation_related_content">関連資料</string> <string name="operation_related_content">関連資料</string>
<string name="new_content">新着</string> <string name="new_content">新着</string>
<string name="save_all">一括保存</string> <string name="save_all">一括保存</string>
<string name="content_update">更新</string>
<string name="remote_support">遠隔支援</string> <string name="remote_support">遠隔支援</string>
<string name="remote_support_list">遠隔支援一覧</string> <string name="remote_support_list">遠隔支援一覧</string>
<string name="new_make">新規作成</string> <string name="new_make">新規作成</string>
......
...@@ -168,6 +168,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -168,6 +168,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected PushMessageListAdapter mPushMessageListAdapter; protected PushMessageListAdapter mPushMessageListAdapter;
protected ListView mFixPushMessageListView; protected ListView mFixPushMessageListView;
protected Dialog mPushMessageSendDialog; protected Dialog mPushMessageSendDialog;
protected ImageButton communicationButton; // コミュニケーションボタン
protected int mSelectedFixPuchMessagePosition; protected int mSelectedFixPuchMessagePosition;
protected int mSendType; protected int mSendType;
protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class); protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
...@@ -978,6 +979,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -978,6 +979,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} else { } else {
showPushMessageDetailView(dto); showPushMessageDetailView(dto);
} }
// プッシュメッセージで未読がなければ、下辺ツールバーのコミュニケーションボタンのバッジを外す
List<PushMessageDto> checkPushMessageList = mPushMessageListAdapter.getItems();
if (!checkUnReadCommunication(checkPushMessageList)) {
communicationButton.setImageResource(R.drawable.ic_communication_menu);
}
} }
}); });
mPushMessageListView.invalidate(); mPushMessageListView.invalidate();
...@@ -1238,4 +1244,28 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1238,4 +1244,28 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ProgressDialogHelper.closeProgressPopup(); ProgressDialogHelper.closeProgressPopup();
} }
} }
// コミュニケーションのアイコン設定(未既読があれば、バッチ付きアイコンでセット)
protected void setCommunicationImageButton() {
List<PushMessageDto> pushMessageDtoList = pushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = checkUnReadCommunication(pushMessageDtoList);
communicationButton.setImageResource(existUnreadFlg ? R.drawable.ic_communication_menu_with_badge : R.drawable.ic_communication_menu);
}
/**
* 未読のプッシュメッセージが存在するかチェック
* @param pushMessageDtoList チェックするリスト
* @return
*/
private boolean checkUnReadCommunication(List<PushMessageDto> pushMessageDtoList) {
boolean existUnreadFlg = false;
for (PushMessageDto pushMessageDto : pushMessageDtoList) {
if (!pushMessageDto.readingFlg) {
existUnreadFlg = true;
break;
}
}
return existUnreadFlg;
}
} }
...@@ -90,6 +90,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -90,6 +90,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
private static final String TAG ="ABVContentViewActivity"; private static final String TAG ="ABVContentViewActivity";
public final static int ABOOK_CHECK_TASK_IMAGE = 103; public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104; public final static int ABOOK_CHECK_TASK_VIDEO = 104;
protected final static int ABOOK_CHECK_SELECT_SCENE = 105;
protected long contentId;// 表示中のコンテンツID protected long contentId;// 表示中のコンテンツID
protected long objectId; // オブジェクトID(オブジェクト用のActivityのときのみ使用) protected long objectId; // オブジェクトID(オブジェクト用のActivityのときのみ使用)
......
...@@ -37,6 +37,7 @@ import java.io.FileOutputStream; ...@@ -37,6 +37,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
...@@ -83,10 +84,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -83,10 +84,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private ImageButton mOperationHomeButton; // ホームボタン private ImageButton mOperationHomeButton; // ホームボタン
private ImageButton mOperationRelatedContentButton; // 関連資料ボタン private ImageButton mOperationRelatedContentButton; // 関連資料ボタン
private ImageButton mCommunicationButton; // コミュニケーションボタン
protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Dialog mCommunicationMenuDialog;
private BroadcastReceiver receiver; private BroadcastReceiver receiver;
...@@ -281,7 +278,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -281,7 +278,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
receiver = new BroadcastReceiver() { receiver = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) { if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
mChatWebView.loadUrl("javascript:dismissLoadingIndicator()"); mChatWebView.loadUrl("javascript:dismissLoadingIndicator()");
} }
} }
...@@ -303,7 +300,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -303,7 +300,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
Logger.d("url", "url : " + url); Logger.d("url", "url : " + url);
Uri uri = Uri.parse(url); Uri uri = Uri.parse(url);
String fileName = new File(uri.getPath()).getName(); String fileName = new File(Objects.requireNonNull(uri.getPath())).getName();
// イメージをダウンロードする(png, jpg, jpeg, mp4, mov) // イメージをダウンロードする(png, jpg, jpeg, mp4, mov)
if (url.toLowerCase().endsWith(".png") || url.toLowerCase().endsWith(".jpg") || url.toLowerCase().endsWith(".jpeg") if (url.toLowerCase().endsWith(".png") || url.toLowerCase().endsWith(".jpg") || url.toLowerCase().endsWith(".jpeg")
...@@ -315,6 +312,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -315,6 +312,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
File destinationFile = new File(Environment.getExternalStorageDirectory(), fileName); request.setDescription("Downloading ..."); File destinationFile = new File(Environment.getExternalStorageDirectory(), fileName); request.setDescription("Downloading ...");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationUri(Uri.fromFile(destinationFile)); request.setDestinationUri(Uri.fromFile(destinationFile));
assert mdDownloadManager != null;
mdDownloadManager.enqueue(request); mdDownloadManager.enqueue(request);
} else { // その他のファイルはurlのみ確認 } else { // その他のファイルはurlのみ確認
Logger.d("download ", "download URL :" + url); Logger.d("download ", "download URL :" + url);
...@@ -349,7 +347,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -349,7 +347,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
showCommonContent(); showCommonContent();
} }
}); });
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
// Toolbar // Toolbar
settingBottomToolbar(); settingBottomToolbar();
...@@ -385,7 +383,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -385,7 +383,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// コミュニケーションボタン // コミュニケーションボタン
mCommunicationButton.setOnClickListener(new View.OnClickListener() { communicationButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
// ABVUIActivity activity = ActivityHandlingHelper.getInstance().getPreviousOfSettingActivity(); // ABVUIActivity activity = ActivityHandlingHelper.getInstance().getPreviousOfSettingActivity();
...@@ -643,13 +641,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -643,13 +641,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
mUploadMessage = null; mUploadMessage = null;
} }
// コミュニケーションのアイコン設定(未既読があれば、バッチ付きアイコンでセット)
private void setCommunicationImageButton() {
List<PushMessageDto> pushMessageDtoList = pushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = checkUnReadCommunication(pushMessageDtoList);
mCommunicationButton.setImageResource(existUnreadFlg ? R.drawable.ic_communication_menu_with_badge : R.drawable.ic_communication_menu);
}
/** /**
* 未読のプッシュメッセージが存在するかチェック * 未読のプッシュメッセージが存在するかチェック
* @param pushMessageDtoList チェックするリスト * @param pushMessageDtoList チェックするリスト
...@@ -761,7 +752,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -761,7 +752,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// 指定したディレクトリに含まれるファイル、ディレクトリの一覧を String 型の配列で返す。 // 指定したディレクトリに含まれるファイル、ディレクトリの一覧を String 型の配列で返す。
fileName = directory.list(); fileName = directory.list();
if (fileName == null) break; if (fileName == null) {
break;
}
n = 0; n = 0;
while(fileName.length > n){ while(fileName.length > n){
...@@ -806,7 +799,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -806,7 +799,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// java.io.File クラスのメソッド list() // java.io.File クラスのメソッド list()
// 指定したディレクトリに含まれるファイル、ディレクトリの一覧を String 型の配列で返す。 // 指定したディレクトリに含まれるファイル、ディレクトリの一覧を String 型の配列で返す。
fileName = directory.list(); fileName = directory.list();
if (fileName == null) break; if (fileName == null) {
break;
}
n = 0; n = 0;
while(fileName.length > n){ while(fileName.length > n){
......
...@@ -398,8 +398,13 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -398,8 +398,13 @@ public class LoginActivity extends ABVLoginActivity {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
if (oldMemberInfoDto != null && oldMemberInfoDto.loginStatus == LoginStatus.LimitLogin.statusCode()) {
// アプリロックの場合サーバ認証せずにログイン
offlineLogin();
} else {
fcmRegister(); fcmRegister();
} }
}
}); });
} }
......
...@@ -364,7 +364,14 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -364,7 +364,14 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode != KeyEvent.KEYCODE_BACK) { if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mAddReport) {
ozdCancelProcess(); // Ozd作業画面を閉じる
} else {
// 作業追加区分がなしの場合
goToMain(); // 一覧画面に遷移
}
} else {
return super.onKeyUp(keyCode, event); return super.onKeyUp(keyCode, event);
} }
return false; return false;
......
...@@ -1535,6 +1535,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1535,6 +1535,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) { if (keyCode == KeyEvent.KEYCODE_BACK) {
Logger.d(TAG, "KeyEvent.KEYCODE_BACK"); Logger.d(TAG, "KeyEvent.KEYCODE_BACK");
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isVideoMax) { if (isVideoMax) {
videoMaxToDefault(); videoMaxToDefault();
} else if (isMarking) { } else if (isMarking) {
......
...@@ -709,6 +709,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -709,6 +709,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
return; return;
} }
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) {
confirmEntrySceneDialog(result[0]);
}
} }
mUploadMessage = null; mUploadMessage = null;
} }
......
...@@ -729,6 +729,10 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -729,6 +729,10 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
} }
// 動画 // 動画
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) {
confirmEntrySceneDialog(result);
}
} }
mUploadMessage = null; mUploadMessage = null;
} }
......
...@@ -58,7 +58,7 @@ public class SceneSendHelper { ...@@ -58,7 +58,7 @@ public class SceneSendHelper {
if (isBaseSceneUpload && !isBaseSceneUploadSuccess && firstFilePath.equals(filePath)) { if (isBaseSceneUpload && !isBaseSceneUploadSuccess && firstFilePath.equals(filePath)) {
AbstractLogic.getLogic(OperationLogic.class).sendPanoContent(operationId, OperationName, file); AbstractLogic.getLogic(OperationLogic.class).sendPanoContent(operationId, OperationName, file);
} else { } else {
AbstractLogic.getLogic(OperationLogic.class).sendScene(file); AbstractLogic.getLogic(OperationLogic.class).sendScene(file, null);
} }
needSendImages.remove(filePath); needSendImages.remove(filePath);
......
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