Commit 9e912ddc by Kim Jinsung

WBS #58709 2.アプリアラート通知

parent e7b9963d
......@@ -28,6 +28,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON;
import jp.agentec.abook.abv.bl.acms.client.json.MasterDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationGroupMasterJSON;
import jp.agentec.abook.abv.bl.acms.client.json.PushMessageListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
......@@ -56,6 +57,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.LockReportParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ReadPushMessageParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.UnlockReportParameters;
......@@ -756,6 +758,17 @@ public class AcmsClient implements AcmsClientResponseListener {
String json = response.httpResponseBody;
return new DashboardStatusJSON(json);
}
/**
* プッシュメッセージ既読情報送信
* @param param 送信パラメータ情報
* @return 通信結果JSON
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public AcmsMessageJSON sendReadPushMessageRequest(ReadPushMessageParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiReadPushMessage, param);
return new AcmsMessageJSON(response.httpResponseBody);
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
......@@ -1050,4 +1063,16 @@ public class AcmsClient implements AcmsClientResponseListener {
MasterDataJSON json = new MasterDataJSON(response.httpResponseBody);
return json;
}
/**
* プッシュメッセージ情報の取得
* @param param 送信パラメータ情報
* @return 通信結果JSON
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public PushMessageListJSON getPushMessageList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetPushMessagesList, param);
return new PushMessageListJSON(response.httpResponseBody);
}
}
......@@ -131,23 +131,6 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.operationContentDtoList.add(operationContentDto);
}
}
JSONArray pushMessagetJsonArray = operationJson.getJSONArray(PushMessageList);
if (pushMessagetJsonArray != null ) {
dto.pushMessageList = new ArrayList<PushMessageDto>();
for (int k = 0; k < pushMessagetJsonArray.length(); k++) {
if (pushMessagetJsonArray.getJSONObject(k).length() == 0) {
break;
}
PushMessageDto pushMessageDto = new PushMessageDto();
pushMessageDto.pushMessageId = pushMessagetJsonArray.getJSONObject(k).getLong(PushMessageId);
pushMessageDto.operationId = dto.operationId;
pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId);
pushMessageDto.pushSendDate = DateTimeUtil.toDate(pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
pushMessageDto.pushMessage = pushMessagetJsonArray.getJSONObject(k).getString(PushMessage);
pushMessageDto.readingFlg = false;
dto.pushMessageList.add(pushMessageDto);
}
}
if (operationJson.has(WorkingGroupList)) {
JSONArray workingGroupJsonArray = operationJson.getJSONArray(WorkingGroupList);
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class PushMessageListJSON extends AcmsCommonJSON {
private static final String PushMessageList = "pushMessageList";
public List<PushMessageDto> pushMessageList;
public static final String OperationId = "operationId";
private static final String PushMessageId = "pushMessageId";
private static final String PushSendDate = "pushSendDate";
private static final String PushMessage = "pushMessage";
private static final String ReadFlg = "readFlg";
public PushMessageListJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
pushMessageList = new ArrayList();
if (json.has(PushMessageList)) {
JSONArray pushMessageArray = json.getJSONArray(PushMessageList);
for (int i = 0; i < pushMessageArray.length(); i++) {
JSONObject pushMessageJson = pushMessageArray.getJSONObject(i);
PushMessageDto pushMessageDto = new PushMessageDto();
pushMessageDto.pushMessageId = pushMessageJson.getLong(PushMessageId);
if (pushMessageJson.has(OperationId)) {
pushMessageDto.operationId = pushMessageJson.getLong(OperationId);
} else {
pushMessageDto.operationId = Long.valueOf(0);
}
pushMessageDto.pushSendDate = DateTimeUtil.toDate(pushMessageJson.getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
pushMessageDto.pushMessage = pushMessageJson.getString(PushMessage);
pushMessageDto.readingFlg = (pushMessageJson.getInt(ReadFlg) != 0);
pushMessageList.add(pushMessageDto);
}
}
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
/**
* プッシュメッセージ既読送信のパラメータ情報
* Created by kim jinsung on 2018/09/15.
*/
public class ReadPushMessageParameters extends AcmsParameters {
private Long pushMessageId;
public ReadPushMessageParameters(String sid, Long pushMessageId) {
super(sid);
this.pushMessageId = pushMessageId;
}
public Long getPushMessageId() {
return pushMessageId;
}
}
......@@ -166,6 +166,10 @@ public class AcmsApis {
public static final String ApiUnlockReport = "unlockReport";
// ダッシュボード
public static final String ApiGetDashboardStatus = "getDashboardStatus";
// プッシュメッセージ一覧取得
public static final String ApiGetPushMessagesList = "getPushMessageList";
// プッシュメッセージ既読送信
public static final String ApiReadPushMessage = "readPushMessage";
// download
/**
......@@ -215,7 +219,8 @@ public class AcmsApis {
// カテゴリ選択機能、IO帳票で3つ追加
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision) ||
// ダッシュボード、ロック追加
methodName.equals(ApiGetDashboardStatus) || methodName.equals(ApiLockReport) || methodName.equals(ApiUnlockReport)) {
methodName.equals(ApiGetDashboardStatus) || methodName.equals(ApiLockReport) || methodName.equals(ApiUnlockReport) ||
methodName.equals(ApiGetPushMessagesList) || methodName.equals(ApiReadPushMessage)) {
apiValue = Constant.ApiValue.checkapi;
}
......
......@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_4;
public static final int DatabaseVersion = DatabaseVersions.Ver1_0_5;
protected SQLiteDatabase db = null;
......
......@@ -6,4 +6,5 @@ public class DatabaseVersions {
public static final int Ver1_0_2 = 11; // SATO HACCP 1.0.2
public static final int Ver1_0_3 = 21; // @From カテゴリ選択機能追加
public static final int Ver1_0_4 = 31; // @From ロック、ダッシュボード対応
public static final int Ver1_0_5 = 32; // Ver.1.0.600 プッシュメッセージ仕様変更対応
}
......@@ -248,6 +248,7 @@ public class OperationDao extends AbstractDao {
delete("t_push_message", null, null);
delete("r_operation_content", null, null);
delete("r_task_worker_group", null, null);
delete("r_operation_group_master_relation", null, null);
delete("t_operation", null, null);
delete("t_task", null, null);
delete("t_task_report", null, null);
......
......@@ -29,11 +29,6 @@ public class PushMessageDao extends AbstractDao {
dto.operationId = cursor.getLong(column);
}
column = cursor.getColumnIndex("push_send_login_id");
if (column != -1) {
dto.pushSendLoginId = cursor.getString(column);
}
column = cursor.getColumnIndex("push_send_date");
if (column != -1) {
dto.pushSendDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmm_hyphen);
......@@ -55,8 +50,8 @@ public class PushMessageDao extends AbstractDao {
public void insert(PushMessageDto dto) {
StringBuffer sql = new StringBuffer();
sql.append(" INSERT OR IGNORE INTO t_push_message ");
sql.append(" (push_message_id, operation_id, push_send_login_id, push_send_date, push_message, reading_flg) ");
sql.append(" VALUES (?,?,?,?,?,?) ");
sql.append(" (push_message_id, operation_id, push_send_date, push_message, reading_flg) ");
sql.append(" VALUES (?,?,?,?,?) ");
try {
beginTransaction();
insert(sql.toString(), dto.getInsertValues());
......@@ -87,18 +82,34 @@ public class PushMessageDao extends AbstractDao {
Logger.v(TAG, "sql=%s", sql);
}
public void delete(long operationId) {
String[] args = new String[] { "" + operationId };
delete("t_push_message", "operation_id=?", args);
public void delete(long pushMessageId) {
String[] args = new String[] { "" + pushMessageId };
delete("t_push_message", "push_message_id=?", args);
}
public List<PushMessageDto> selectAll() {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm ");
sql.append(" LEFT OUTER JOIN t_operation AS top ");
sql.append(" on tpm.operation_id = top.operation_id ");
sql.append(" ORDER BY tpm.push_send_date DESC ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class);
}
/**
* 未読プッシュメッセージ最大3つを返す。
* @return プッシュメッセージ情報配列
*/
public List<PushMessageDto> selectUnreadPushMessage() {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" LEFT OUTER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" ORDER BY tpm.push_message_id DESC ");
sql.append(" ORDER BY tpm.push_send_date DESC ");
sql.append(" LIMIT 3 ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class);
}
......@@ -106,9 +117,9 @@ public class PushMessageDao extends AbstractDao {
public PushMessageDto select(long pushMessageId) {
String[] args = new String[] { "" + pushMessageId };
StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" LEFT OUTER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" WHERE tpm.push_message_id = ? ");
Logger.v(TAG, "sql=%s", sql);
......
......@@ -22,21 +22,45 @@ public class TPushMessage extends SQLiteTableScript {
sql.append(" CREATE TABLE t_push_message ( ");
sql.append(" push_message_id BIGINT NOT NULL ");
sql.append(" , operation_id BIGINT NOT NULL ");
sql.append(" , push_send_login_id VARCHAR(128) ");
sql.append(" , push_send_date DATE NOT NULL ");
sql.append(" , push_message TEXT ");
sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (push_message_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
/**
* Ver.1.0.600でプッシュメッセージ仕様変更によって
* 制約削除が必要ですが、できないため、テーブル再作成
* @return テーブル作成SQL
*/
private String getCreatePushMessageTable() {
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_push_message_temp ( ");
sql.append(" push_message_id BIGINT NOT NULL ");
sql.append(" , operation_id BIGINT NOT NULL ");
sql.append(" , push_send_date DATE NOT NULL ");
sql.append(" , push_message TEXT ");
sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (push_message_id) ");
sql.append(" ) ");
return sql.toString();
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
List<String> ddl = new ArrayList<String>();
if (oldVersion < DatabaseVersions.Ver1_0_5) {
ddl.add(getCreatePushMessageTable());
ddl.add(" INSERT INTO t_push_message_temp (push_message_id, operation_id, push_send_date, push_message, reading_flg) SELECT push_message_id, operation_id, push_send_date, push_message, reading_flg FROM t_push_message ");
ddl.add(" DROP TABLE t_push_message ");
ddl.add(" ALTER TABLE t_push_message_temp RENAME TO t_push_message ");
}
return ddl;
}
@Override
......
......@@ -33,6 +33,7 @@ import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.MasterDataLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -52,6 +53,8 @@ import jp.agentec.adf.util.DateTimeUtil;
private EnqueteLogic enqueteLogic = AbstractLogic.getLogic(EnqueteLogic.class);
private ContentLogic contentLogic = AbstractLogic.getLogic(ContentLogic.class);
private OperationLogic operationLogic = AbstractLogic.getLogic(OperationLogic.class);
private PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private SppDeviceDao sppDeviceDao = AbstractDao.getDao(SppDeviceDao.class);
private OperationGroupMasterLogic operationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
......@@ -394,6 +397,8 @@ import jp.agentec.adf.util.DateTimeUtil;
try {
// サーバー通信でプロジェクト取得
operationLogic.initializeOperations();
//プッシュメッセージ情報を取得
pushMessageLogic.initializePushMessage();
} catch (Exception e1) {
Logger.e(TAG, e1);
e = e1;
......
......@@ -9,7 +9,6 @@ import java.util.Date;
public class PushMessageDto extends AbstractDto {
public Long pushMessageId;
public Long operationId;
public String pushSendLoginId;
public Date pushSendDate;
public String pushMessage;
public String operationName;
......@@ -22,6 +21,6 @@ public class PushMessageDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { pushMessageId, operationId, pushSendLoginId, pushSendDate, pushMessage, readingFlg };
return new Object[] { pushMessageId, operationId, pushSendDate, pushMessage, readingFlg };
}
}
......@@ -88,8 +88,6 @@ public class OperationLogic extends AbstractLogic {
private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class);
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
private static final int FINISHED_STATUS = 999;
public void initializeOperations() throws AcmsException, NetworkDisconnectedException {
......@@ -97,6 +95,7 @@ public class OperationLogic extends AbstractLogic {
setWorkingGroupList();
// プロジェクト一覧取得し、登録・更新・削除する
retrieveServerOperation();
}
/**
......@@ -214,10 +213,6 @@ public class OperationLogic extends AbstractLogic {
mTaskWorkerGroupDao.insert(taskWorkerGroupDto);
}
}
for (PushMessageDto dto : serverOperationDto.pushMessageList) {
mPushMessageDao.insert(dto);
}
}
List<OperationDto> deleteListDtoArray = new ArrayList<OperationDto>();
......@@ -241,7 +236,6 @@ public class OperationLogic extends AbstractLogic {
for(TaskDto taskDto : taskDtoList) {
mTaskDao.delete(taskDto);
}
mPushMessageDao.delete(deleteOperationDto.operationId);
mOperationDao.delete(deleteOperationDto);
// 作業削除時、紐づいた資料を削除
......
package jp.agentec.abook.abv.bl.logic;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.json.PushMessageListJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ReadPushMessageParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
......@@ -23,6 +27,66 @@ import jp.agentec.abook.abv.bl.dto.PushMessageDto;
public class PushMessageLogic extends AbstractLogic {
private static final String TAG = "OperationRelatedContentActivity";
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
/**
* サーバ側からプッシュメッセージを取得し、DB更新する。
* @throws AcmsException ACMS関連例外
* @throws NetworkDisconnectedException ネットワーク接続例外
*/
public void initializePushMessage() throws AcmsException, NetworkDisconnectedException {
AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid);
PushMessageListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getPushMessageList(param);
List<PushMessageDto> serverPushMessageList = json.pushMessageList;
List<PushMessageDto> localPushMessageList = mPushMessageDao.selectAll();
//追加
for (PushMessageDto serverPushMessageDto : serverPushMessageList) {
boolean insertFlg = true;
for (PushMessageDto localPushMessageDto : localPushMessageList) {
if (serverPushMessageDto.pushMessageId.equals(localPushMessageDto.pushMessageId)) {
if (serverPushMessageDto.readingFlg && !localPushMessageDto.readingFlg) {
updateReadingFlg(localPushMessageDto.pushMessageId);
}
insertFlg = false;
break;
}
}
if (insertFlg) {
mPushMessageDao.insert(serverPushMessageDto);
}
}
//削除
List<PushMessageDto> deleteListDtoArray = new ArrayList();
for (PushMessageDto localPushMessageDto : localPushMessageList) {
boolean deleteFlg = true;
for (PushMessageDto serverPushMessageDto : serverPushMessageList) {
if (serverPushMessageDto.pushMessageId.equals(localPushMessageDto.pushMessageId)) {
deleteFlg = false;
break;
}
}
if (deleteFlg) {
mPushMessageDao.delete(localPushMessageDto.pushMessageId);
}
}
}
/**
* 作業一覧上部に表示する未読プッシュメッセージ3つを返す
* @return プッシュメッセージ情報配列
*/
public List<PushMessageDto> getUnreadPushMessageList() {
List<PushMessageDto> savedPushMessageList = mPushMessageDao.selectUnreadPushMessage();
List<PushMessageDto> pushMessageList = new ArrayList();
if (savedPushMessageList != null && savedPushMessageList.size() > 0) {
for (PushMessageDto pushMessageDto : savedPushMessageList) {
if (!pushMessageDto.readingFlg) {
pushMessageList.add(pushMessageDto);
}
}
}
return pushMessageList;
}
/**
* プッシュメッセージの定型文取得
* @return 定型文リスト
......@@ -62,4 +126,21 @@ public class PushMessageLogic extends AbstractLogic {
public void updateReadingFlg(long pushMessageId) {
mPushMessageDao.updateReadingFlg(pushMessageId);
}
/**
* プッシュメッセージ既読情報を送信
* @return
* @throws IOException
* @throws AcmsException
*/
public boolean sendReadPushMessage(Long pushMessageId) throws IOException, AcmsException, NetworkDisconnectedException {
ReadPushMessageParameters param = new ReadPushMessageParameters(cache.getMemberInfo().sid, pushMessageId);
AcmsMessageJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendReadPushMessageRequest(param);
Logger.d(TAG, " status=" + json.httpStatus);
if (json.httpStatus == ABookKeys.HTTP_STATUS_SUCCESS) {
Logger.v(TAG, "sendPushMessageRequest httpStatus=" + json.httpStatus);
return true;
}
return false;
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 背景色 -->
<solid android:color="#ef6352" />
<!-- 角の丸み -->
<corners android:radius="6dp" />
</shape>
\ No newline at end of file
......@@ -460,7 +460,7 @@
<string name="communication">コミュニケーション</string>
<string name="operation_select">作業選択</string>
<string name="detail">詳細</string>
<string name="title_message_detail">メッセージ詳細</string>
<string name="title_message_detail">プッシュメッセージ詳細</string>
<string name="push_message_sender">送信者:</string>
<string name="title_operation_report_form">作業報告フォーム </string>
<string name="title_preview">プレビュー</string>
......@@ -1474,4 +1474,12 @@
<string name="auto_sync_setting_subtitle">作業一覧で作業の自動同期を可能にします。</string>
<string name="msg_new_content_update_error">サーバ通信エラーの為、新着更新に失敗しました。</string>
<string name="msg_push_message_list_notes">最新100件以外は、管理画面(CMS)で確認してください。</string>
<string name="title_date">日時</string>
<string name="title_content">内容</string>
<string name="msg_push_message_detail_api_disconnect">オフラインのため既読情報はサーバへ送信されませんでした。</string>
<string name="msg_push_message_detail_api_error">サーバ通信が失敗したため既読情報はサーバへ送信されませんでした。</string>
<string name="title_other">その他</string>
<string name="msg_push_message_content_not_downloaded">作業が同期されていないので作業報告画面へ遷移できません。</string>
</resources>
......@@ -67,6 +67,7 @@
<color name="basic_blue3">#995781a9</color>
<color name="basic_orange1">#99eca14f</color>
<color name="basic_orange2">#66eca14f</color>
<color name="basic_white">#ffffffff</color>
<color name="basic_white1">#eeffffff</color>
<color name="basic_white2">#99ffffff</color>
<color name="light_blue">#d1edfc</color>
......@@ -94,4 +95,11 @@
<color name="task_count_not_started">#e84c17</color>
<color name="task_count_working">#0080c6</color>
<color name="task_count_completed">#00b18a</color>
<color name="unread_push_list_bg">#ffe9e9</color>
<color name="push_message_list_notes_bg">#d2edd4</color>
<color name="push_message_list_notes_text">#00b050</color>
<color name="push_message_list_send_date_text">#7f7f7f</color>
<color name="push_message_list_unread_bg">#c4eafe</color>
</resources>
\ No newline at end of file
......@@ -462,7 +462,7 @@
<string name="communication">communication</string>
<string name="operation_select">Wokring choice</string>
<string name="detail">detail</string>
<string name="title_message_detail">message detail</string>
<string name="title_message_detail">Push message detail</string>
<string name="push_message_sender">Sender :</string>
<string name="title_operation_report_form">Task report </string>
<string name="title_preview">preivew</string>
......@@ -1486,5 +1486,11 @@
<string name="auto_sync_setting_title">Automatically sync</string>
<string name="auto_sync_setting_subtitle">Enables automatic synchronization of operations in the operation list.</string>
<string name="msg_new_content_update_error">Failed to update because of communication error.</string>
<string name="msg_push_message_list_notes">Check the CMS Admin screen for items beyond the latest 100.</string>
<string name="title_date">Date</string>
<string name="title_content">Content</string>
<string name="msg_push_message_detail_api_disconnect">Offline: read info wasn\'t sent to the server.</string>
<string name="msg_push_message_detail_api_error">Read info wasn\'t sent due to server error.</string>
<string name="title_other">Other</string>
<string name="msg_push_message_content_not_downloaded">Unable to move to the task screen due to sync error.</string>
</resources>
\ No newline at end of file
......@@ -87,6 +87,16 @@
android:background="@drawable/ic_operation_help"
android:onClick="onClickShowHelpView" />
</RelativeLayout>
<ListView
android:id="@+id/lv_message_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="@color/unread_push_list_bg"/>
<FrameLayout
android:id="@+id/operation_list_layout"
style="@style/content_list_bg"
......@@ -97,5 +107,4 @@
android:layout_weight="1"></FrameLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
\ No newline at end of file
......@@ -3,53 +3,44 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
android:layout_weight="10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:orientation="vertical">
android:orientation="vertical"
android:background="@color/operation_bg">
<LinearLayout
android:id="@+id/ll_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
android:orientation="vertical"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_message"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/dummy_str"
android:textSize="@dimen/app_normal_text_size"
android:textColor="@color/operation_default_text_color" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:orientation="horizontal">
<TextView
......@@ -58,7 +49,8 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/dummy_date_time"
android:textColor="@color/operation_default_text_color" />
android:padding="5dp"
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_operation_name"
......@@ -72,21 +64,8 @@
android:paddingLeft="3dp"
android:text="@string/dummy_str"
android:textColor="@color/operation_default_text_color" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btn_detail"
android:layout_width="120dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@drawable/btn_detail"
android:text="@string/detail"
android:textColor="@color/text_color" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/unread_push_list_bg">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_margin="5dp"
android:orientation="horizontal"
android:layout_weight="8">
<TextView
android:id="@+id/tv_send_date"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="0000/00/00 00:00"
android:background="@drawable/corners"
android:textColor="@color/basic_white" />
<TextView
android:id="@+id/tv_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="3dp"
android:singleLine="true"
android:text="message"
android:textColor="@color/text_error" />
</LinearLayout>
<ImageButton
android:id="@+id/ib_move_operation"
android:layout_width="80dp"
android:layout_height="35dp"
android:gravity="center_vertical"
android:scaleType="fitCenter"
android:padding="5dp"
android:src="@drawable/btn_arrow_right_red"
android:background="@android:color/transparent"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -32,7 +32,7 @@
android:singleLine="true"
android:text="@string/push_message_list"
android:textColor="@color/edt_text"
android:textSize="@dimen/opeartion_title_text_size" />
android:textStyle="bold"/>
<Button
android:id="@+id/close_btn"
......@@ -48,83 +48,117 @@
android:id="@+id/ll_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:layout_margin="7dp"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/tv_message"
android:id="@+id/tv_detail_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="10dp"
android:padding="5dp"
android:textAlignment="center"
android:text="@string/dummy_str"
android:ellipsize="end"
android:maxLines="5"
android:textColor="@android:color/black" />
android:textColor="@color/text_error"
android:background="@color/unread_push_list_bg"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<TextView
android:id="@+id/tv_operation_name_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="@string/operation_name"
android:textColor="@color/push_message_list_send_date_text"/>
<TextView
android:id="@+id/tv_operation_name"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/dummy_str"
android:textColor="@android:color/black"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/black_translucent" />
<TextView
android:id="@+id/tv_send_date"
android:background="@color/push_message_list_send_date_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="@string/dummy_date_time"
android:textColor="@android:color/black" />
<TextView
android:id="@+id/tv_operation_name_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/operation_name"
android:textColor="@android:color/black"/>
<TextView
android:id="@+id/tv_operation_name"
android:layout_marginBottom="10dp">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="@string/title_date"
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_send_user"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/dummy_str"
android:textColor="@android:color/black" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="3dp"
android:text="@string/dummy_str"
android:textColor="@color/operation_default_text_color"
android:textSize="18sp"
android:textStyle="bold" />
android:layout_height="1dp"
android:background="@color/push_message_list_send_date_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
>
<TextView
android:id="@+id/tv_title_send_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="@string/push_message_sender"
android:textColor="@android:color/black" />
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_marginLeft="25dp"
android:text="@string/title_content"
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_send_user"
android:layout_width="match_parent"
android:id="@+id/tv_message"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="10dp"
android:layout_weight="2"
android:text="@string/dummy_str"
android:ellipsize="end"
android:maxLines="5"
android:textColor="@android:color/black" />
</LinearLayout>
</LinearLayout>
<ListView
android:id="@+id/lv_push_message"
<LinearLayout
android:id="@+id/ll_push_message_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:layout_margin="7dp"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/tv_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/dummy_str"
android:textAlignment="center"
android:textColor="@color/push_message_list_notes_text"
android:background="@color/push_message_list_notes_bg"/>
<ListView
android:id="@+id/lv_push_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/push_message_list_send_date_text"
android:dividerHeight="1px" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -96,7 +96,15 @@
android:onClick="onClickShowHelpView"/>
</RelativeLayout>
<ListView
android:id="@+id/lv_message_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:focusable="false"
android:background="@color/unread_push_list_bg"/>
<FrameLayout
android:id="@+id/operation_list_layout"
style="@style/content_list_bg"
......
......@@ -3,36 +3,29 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal">
android:layout_weight="10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
android:orientation="vertical"
android:background="@color/operation_bg">
<LinearLayout
android:id="@+id/ll_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal">
<TextView
......@@ -40,16 +33,18 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:singleLine="true"
android:text="@string/dummy_str"
android:textSize="@dimen/app_normal_text_size"
android:textColor="@color/operation_default_text_color" />
android:textColor="@color/operation_default_text_color"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:orientation="horizontal">
<TextView
......@@ -57,39 +52,25 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/dummy_date_time"
android:textColor="@color/operation_default_text_color" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:orientation="horizontal">
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_operation_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:ellipsize="end"
android:singleLine="true"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="3dp"
android:singleLine="true"
android:text="@string/dummy_str"
android:textColor="@color/operation_default_text_color" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btn_detail"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:background="@drawable/operation_radius_frame"
android:text="@string/detail"
android:textColor="@color/text_color" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/unread_push_list_bg">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_margin="5dp"
android:orientation="horizontal"
android:layout_weight="8">
<TextView
android:id="@+id/tv_send_date"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textSize="12sp"
android:text="0000/00/00 00:00"
android:background="@drawable/corners"
android:textColor="@color/basic_white" />
<TextView
android:id="@+id/tv_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:textSize="12sp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="3dp"
android:singleLine="true"
android:text="message"
android:textColor="@color/text_error" />
</LinearLayout>
<ImageButton
android:id="@+id/ib_move_operation"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:background="@drawable/btn_arrow_right_red" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:minWidth="500dp"
android:minHeight="300dp"
android:background="@drawable/list_selector"
android:background="@color/basic_white"
android:orientation="vertical">
<RelativeLayout
......@@ -34,7 +34,7 @@
android:maxLines="1"
android:text="@string/push_message_list"
android:textColor="@color/edt_text"
android:textSize="@dimen/opeartion_title_text_size" />
android:textStyle="bold"/>
<Button
android:id="@+id/close_btn"
......@@ -50,82 +50,119 @@
android:id="@+id/ll_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:layout_margin="7dp"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/tv_message"
android:id="@+id/tv_detail_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:padding="5dp"
android:textSize="13dp"
android:textAlignment="center"
android:text="@string/dummy_str"
android:ellipsize="end"
android:maxLines="5"
android:textColor="@android:color/black" />
android:textColor="@color/text_error"
android:background="@color/unread_push_list_bg"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<TextView
android:id="@+id/tv_operation_name_title"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/operation_name"
android:textColor="@color/push_message_list_send_date_text"/>
<TextView
android:id="@+id/tv_operation_name"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/dummy_str"
android:textColor="@android:color/black"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/black_translucent" />
<TextView
android:id="@+id/tv_send_date"
android:background="@color/push_message_list_send_date_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="@string/dummy_date_time"
android:textColor="@android:color/black" />
<TextView
android:id="@+id/tv_operation_name_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/operation_name"
android:textColor="@android:color/black"/>
<TextView
android:id="@+id/tv_operation_name"
android:layout_marginBottom="10dp">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/title_date"
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_send_user"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/dummy_str"
android:textColor="@android:color/black" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingLeft="3dp"
android:text="@string/dummy_str"
android:textColor="@color/operation_default_text_color"
android:textSize="18sp"
android:textStyle="bold" />
android:layout_height="1dp"
android:background="@color/push_message_list_send_date_text" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
>
<TextView
android:id="@+id/tv_title_send_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="@string/push_message_sender"
android:textColor="@android:color/black" />
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:text="@string/title_content"
android:textColor="@color/push_message_list_send_date_text" />
<TextView
android:id="@+id/tv_send_user"
android:layout_width="match_parent"
android:id="@+id/tv_message"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="10dp"
android:layout_weight="2"
android:text="@string/dummy_str"
android:ellipsize="end"
android:maxLines="5"
android:textColor="@android:color/black" />
</LinearLayout>
</LinearLayout>
<ListView
android:id="@+id/lv_push_message"
<LinearLayout
android:id="@+id/ll_push_message_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:layout_margin="7dp"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/tv_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/dummy_str"
android:textSize="13dp"
android:textAlignment="center"
android:textColor="@color/push_message_list_notes_text"
android:background="@color/push_message_list_notes_bg"/>
<ListView
android:id="@+id/lv_push_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/push_message_list_send_date_text"
android:dividerHeight="2px"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="300dp"
android:minHeight="200dp"
android:background="@color/operation_bg"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/toolbar_layout"
style="@style/OperationSearchToolBar"
android:layout_height="50dp"
android:layout_width="match_parent">
<Button
android:id="@+id/back_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_history_back_on"
android:visibility="gone" />
<TextView
android:id="@+id/tv_toolbar_title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/title_other"
android:textColor="@color/edt_text"
android:textSize="@dimen/opeartion_title_text_size" />
<Button
android:id="@+id/close_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_operation_close"
android:contentDescription="@string/cont_desc" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:clickable="false"
android:focusable="false"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="3"
android:background="@drawable/list_selector_holo_light"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible">
<ImageView
android:id="@+id/btn_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_weight="0"
android:src="@drawable/ic_operation_list_submenu_setting"
android:visibility="visible" />
<TextView
android:id="@+id/item3_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:paddingLeft="6dip"
android:text="@string/setting"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/text_select" />
<ImageView
android:id="@+id/item3_nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="0"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/ll_push_message_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="3"
android:background="@drawable/list_selector_holo_light"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_weight="0"
android:src="@drawable/ic_communication_push_message_list"
android:visibility="visible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:paddingLeft="6dip"
android:text="@string/push_message_list"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/text_select" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="0"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -34,6 +34,7 @@ public class OperationActivity extends ABVUIActivity {
protected ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Dialog mCommunicationMenuDialog;
private Dialog mSubMenuDialog;
protected void createCommonToolber() {
......@@ -68,19 +69,7 @@ public class OperationActivity extends ABVUIActivity {
// コミュニケーション
mCommunicationButton = findViewById(R.id.btn_communication_menu);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = false;
for (PushMessageDto pushMessageDto : pushMessageDtoList) {
if (!pushMessageDto.readingFlg) {
existUnreadFlg = true;
break;
}
}
if (existUnreadFlg) {
mCommunicationButton.setImageDrawable(getRDrawable(R.drawable.ic_communication_menu_with_badge));
} else {
mCommunicationButton.setImageDrawable(getRDrawable(R.drawable.ic_communication_menu));
}
mCommunicationButton.setImageDrawable(getRDrawable(R.drawable.ic_communication_menu));
mCommunicationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -154,7 +143,32 @@ public class OperationActivity extends ABVUIActivity {
// 設定画面へ遷移
public void onClickSetting(View v) {
showSetting();
mSubMenuDialog = new Dialog(OperationActivity.this);
mSubMenuDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mSubMenuDialog.setCanceledOnTouchOutside(false);
mSubMenuDialog.setContentView(R.layout.operation_list_submenu_dialog);
mSubMenuDialog.findViewById(R.id.ll_setting).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mSubMenuDialog.dismiss();
showSetting();
}
});
mSubMenuDialog.findViewById(R.id.ll_push_message_list).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mSubMenuDialog.dismiss();
showPushMessageListDialog();
}
});
mSubMenuDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mSubMenuDialog.dismiss();
}
});
mSubMenuDialog.show();
}
/**
......@@ -193,4 +207,6 @@ public class OperationActivity extends ABVUIActivity {
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportSearch));
startActivity(intent, NaviConsts.Right);
}
protected void showPushMessageListDialog(){}
}
......@@ -115,6 +115,7 @@ import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.adapter.HierarchyOperationGroupListAdapter;
import jp.agentec.abook.abv.ui.home.adapter.UnreadPushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
......@@ -186,6 +187,8 @@ public class OperationListActivity extends OperationActivity {
private ListView mPushMessageListView;
private OperationSelectAdapter mOperationSelectAdapter;
private PushMessageListAdapter mPushMessageListAdapter;
private UnreadPushMessageListAdapter mUnreadPushMessageListAdapter;
private File mLocalFile;
private boolean activityResultFlg;
private ListView mFixPushMessageListView;
......@@ -210,6 +213,7 @@ public class OperationListActivity extends OperationActivity {
public Long mAutoSyncOpenOperationId = null;
public Long mQrCodeOperationId = null;
private ListView mOperationPushMessageListView;
// ビューの作成
private class ReloadHandler implements Runnable {
@Override
......@@ -242,7 +246,6 @@ public class OperationListActivity extends OperationActivity {
mViewModeButton = (ImageButton) findViewById(R.id.btn_view_mode);
mSearchButton = (ImageButton) findViewById(R.id.btn_search);
mQrCodeButton = findViewById(R.id.btn_qrcode);
mTitleView = (TextView) findViewById(R.id.title);
// カテゴリボタン
mCategoryLocationButton = (ImageButton) findViewById(R.id.btn_category_location);
......@@ -364,6 +367,9 @@ public class OperationListActivity extends OperationActivity {
mOperationHomeButton.setEnabled(false);
// 作業リスト更新、ツールバー更新
setOperationListView();
mOperationPushMessageListView = (ListView) findViewById(R.id.lv_message_list);
reloadOperationPushMessageListView();
}
/**
......@@ -484,6 +490,9 @@ public class OperationListActivity extends OperationActivity {
// ビューを作り直す
setOperationListView();
}
//上部の未読プッシュメッセージ一覧リロード
reloadOperationPushMessageListView();
if (isAutoSync()) {
if (mAutoSyncingFlg) {
if (result) {
......@@ -1512,7 +1521,8 @@ public class OperationListActivity extends OperationActivity {
mOperationSelectDialog.show();
}
private void showPushMessageListDialog() {
@Override
protected void showPushMessageListDialog() {
mPushMessageListDialog = new Dialog(OperationListActivity.this);
mPushMessageListDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mPushMessageListDialog.setCanceledOnTouchOutside(false);
......@@ -1523,14 +1533,18 @@ public class OperationListActivity extends OperationActivity {
mPushMessageListAdapter = new PushMessageListAdapter(OperationListActivity.this, pushMessageDtoList);
mPushMessageListView.setAdapter(mPushMessageListAdapter);
mPushMessageListAdapter.setAdapterListener(new PushMessageListAdapter.PushMessageListAdapterListener() {
mPushMessageListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onDetailView(final PushMessageDto dto) {
showPushMessageDetailView(dto);
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
PushMessageDto pushMessageDto = (PushMessageDto)adapterView.getItemAtPosition(i);
showPushMessageDetailView(pushMessageDto);
}
});
mPushMessageListView.invalidate();
mPushMessageListView.setClickable(false);
TextView notesTextView = mPushMessageListDialog.findViewById(R.id.tv_notes);
notesTextView.setText(R.string.msg_push_message_list_notes);
mPushMessageListDialog.findViewById(R.id.back_btn).setOnClickListener(new View.OnClickListener() {
@Override
......@@ -1545,6 +1559,7 @@ public class OperationListActivity extends OperationActivity {
@Override
public void onClick(View v) {
mPushMessageListDialog.dismiss();
reloadOperationPushMessageListView();
}
});
......@@ -1553,8 +1568,38 @@ public class OperationListActivity extends OperationActivity {
}
private void showPushMessageDetailView(final PushMessageDto dto) {
dto.readingFlg = true;
TextView detailNotesTextVie = (TextView)mPushMessageListDialog.findViewById(R.id.tv_detail_notes);
int errorMessageResourceId = 0;
if (!dto.readingFlg) {
if (ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
//サーバ通信
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_common_processing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
try {
if (mPushMessageLogic.sendReadPushMessage(dto.pushMessageId)) {
mPushMessageLogic.updateReadingFlg(dto.pushMessageId);
} else {
Logger.e(TAG,"sendReadPushMessage result false");
errorMessageResourceId = R.string.msg_push_message_detail_api_error;
}
} catch (Exception e) {
Logger.e(TAG,"e.getLocalizedMessage = " + e.getLocalizedMessage());
errorMessageResourceId = R.string.msg_push_message_detail_api_error;
} finally {
closeProgressPopup();
}
} else {
errorMessageResourceId = R.string.msg_push_message_detail_api_disconnect;
}
}
if (errorMessageResourceId == 0) {
detailNotesTextVie.setVisibility(View.GONE);
detailNotesTextVie.setText(null);
} else {
detailNotesTextVie.setVisibility(View.VISIBLE);
detailNotesTextVie.setText(errorMessageResourceId);
}
TextView messageTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_message);
TextView sendDateTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_send_date);
TextView sendOperationNameTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_operation_name);
......@@ -1562,17 +1607,13 @@ public class OperationListActivity extends OperationActivity {
messageTextView.setText(dto.pushMessage);
sendDateTextView.setText(DateTimeUtil.toString(dto.pushSendDate, DateTimeFormat.yyyyMMddHHmm_slash));
sendOperationNameTextView.setText(dto.operationName);
sendUserTextView.setText(dto.pushSendLoginId);
mPushMessageLogic.updateReadingFlg(dto.pushMessageId);
showPushMessgeListView(false);
}
private void showPushMessgeListView(boolean pushMessageListViewFlg) {
TextView titleTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_toolbar_title);
if (pushMessageListViewFlg) {
mPushMessageListView.setVisibility(View.VISIBLE);
mPushMessageListDialog.findViewById(R.id.ll_push_message_list).setVisibility(View.VISIBLE);
mPushMessageListDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE);
mPushMessageListDialog.findViewById(R.id.back_btn).setVisibility(View.GONE);
mPushMessageListDialog.findViewById(R.id.ll_detail).setVisibility(View.GONE);
......@@ -1581,7 +1622,7 @@ public class OperationListActivity extends OperationActivity {
R.string.push_message_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
mPushMessageListView.setVisibility(View.GONE);
mPushMessageListDialog.findViewById(R.id.ll_push_message_list).setVisibility(View.GONE);
mPushMessageListDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE);
mPushMessageListDialog.findViewById(R.id.back_btn).setVisibility(View.VISIBLE);
mPushMessageListDialog.findViewById(R.id.ll_detail).setVisibility(View.VISIBLE);
......@@ -2500,4 +2541,45 @@ public class OperationListActivity extends OperationActivity {
}
mAutoSyncOpenOperationId = null;
}
/**
* 作業一覧画面上部に未読のプッシュメッセージ最大3つ表示
*/
private void reloadOperationPushMessageListView() {
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getUnreadPushMessageList();
if (pushMessageDtoList.size() == 0) {
mOperationPushMessageListView.setVisibility(View.GONE);
return;
}
mOperationPushMessageListView.setVisibility(View.VISIBLE);
mUnreadPushMessageListAdapter = new UnreadPushMessageListAdapter(OperationListActivity.this, pushMessageDtoList);
mOperationPushMessageListView.setAdapter(mUnreadPushMessageListAdapter);
mUnreadPushMessageListAdapter.setAdapterListener(new UnreadPushMessageListAdapter.UnreadPushMessageListAdapterListener() {
@Override
public void onMoveOperation(Long operationId) {
Logger.d(TAG, "onMoveOperation operationId = " + operationId);
if (needAutoSync()) {
autoSyncOperationId(operationId);
} else {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
ContentDto contentDto = contentDao.getContent(operationDto.contentId);
if (contentDto == null || !contentDto.downloadedFlg || contentDto.updatedFlg) {
showErrorDialog(R.string.msg_push_message_content_not_downloaded);
} else {
if (operationDto != null && operationDto.contentId != null && operationDto.contentId != 0) {
openReportView(operationDto);
}
}
}
}
});
mOperationPushMessageListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
showPushMessageListDialog();
}
});
}
}
package jp.agentec.abook.abv.ui.home.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/**
* Created by kim jinsung on 2018/09/18.
*/
......@@ -27,7 +24,6 @@ public class PushMessageListAdapter extends BaseAdapter {
private static final String TAG = "PushMessageListAdapter";
private Context mContext;
private LayoutInflater mInflater;
private PushMessageListAdapter.PushMessageListAdapterListener listener;
List<PushMessageDto> mListItem;
......@@ -66,8 +62,7 @@ public class PushMessageListAdapter extends BaseAdapter {
holder.operationNameTextView = (TextView) convertView.findViewById(R.id.tv_operation_name);
holder.sendDateTextView = (TextView) convertView.findViewById(R.id.tv_send_date);
holder.messageTextView = (TextView) convertView.findViewById(R.id.tv_message);
holder.detailButton = (Button) convertView.findViewById(R.id.btn_detail);
holder.rowLinearLayout = (LinearLayout) convertView.findViewById(R.id.ll_row);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
......@@ -81,28 +76,15 @@ public class PushMessageListAdapter extends BaseAdapter {
}
private void settingDisplay(ViewHolder holder, final PushMessageDto pushMessageDto) {
if (pushMessageDto != null) {
holder.operationNameTextView.setText(pushMessageDto.operationName);
holder.sendDateTextView.setText(DateTimeUtil.toString(pushMessageDto.pushSendDate, DateTimeFormat.yyyyMMddHHmm_slash));
holder.messageTextView.setText(pushMessageDto.pushMessage);
// リソースパターンの適用
holder.detailButton.setText(PatternStringUtil.patternToString(mContext,
R.string.detail,
getUserPref(mContext, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) );
if (pushMessageDto.readingFlg) {
holder.detailButton.setBackgroundResource(R.drawable.btn_detail);
holder.rowLinearLayout.setBackgroundColor(Color.WHITE);
} else {
holder.detailButton.setBackgroundResource(R.drawable.btn_detail_with_badge);
holder.rowLinearLayout.setBackgroundColor(mContext.getColor(R.color.push_message_list_unread_bg));
}
holder.detailButton.findViewById(R.id.btn_detail).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onDetailView(pushMessageDto);
}
});
}
}
......@@ -110,14 +92,6 @@ public class PushMessageListAdapter extends BaseAdapter {
TextView operationNameTextView;
TextView sendDateTextView;
TextView messageTextView;
Button detailButton;
}
public void setAdapterListener(PushMessageListAdapterListener listener) {
this.listener = listener;
}
public interface PushMessageListAdapterListener {
void onDetailView(PushMessageDto pushMessageDto);
LinearLayout rowLinearLayout;
}
}
package jp.agentec.abook.abv.ui.home.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.TextView;
import java.util.List;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/**
* 作業一覧画面上部に表示する未読プッシュメッセージ表示用アダプター
* Created by kim jinsung on 2024/05/28.
*/
public class UnreadPushMessageListAdapter extends BaseAdapter {
private static final String TAG = "PushMessageListAdapter";
private Context mContext;
private LayoutInflater mInflater;
private UnreadPushMessageListAdapter.UnreadPushMessageListAdapterListener listener;
List<PushMessageDto> mListItem;
public UnreadPushMessageListAdapter(Context context, List<PushMessageDto> objects) {
mContext = context;
mListItem = objects;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return mListItem.size();
}
@Override
public PushMessageDto getItem(int position) {
return mListItem.get(position);
}
public void setItem(List<PushMessageDto> objects) {
mListItem = objects;
notifyDataSetChanged();
}
@Override
public long getItemId(int position) {
return mListItem.get(position).pushMessageId;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_unread_push_message_list, parent, false);
holder = new UnreadPushMessageListAdapter.ViewHolder();
holder.sendDateTextView = (TextView) convertView.findViewById(R.id.tv_send_date);
holder.messageTextView = (TextView) convertView.findViewById(R.id.tv_message);
holder.moveOperationButton = (ImageButton) convertView.findViewById(R.id.ib_move_operation);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final PushMessageDto pushMessageDto = getItem(position);
settingDisplay(holder, pushMessageDto);
return convertView;
}
private void settingDisplay(ViewHolder holder, final PushMessageDto pushMessageDto) {
if (pushMessageDto != null) {
holder.sendDateTextView.setText(DateTimeUtil.toString(pushMessageDto.pushSendDate, DateTimeFormat.yyyyMMddHHmm_slash));
holder.messageTextView.setText(pushMessageDto.pushMessage);
holder.moveOperationButton.setFocusable(false);
if (pushMessageDto.operationName == null) {
holder.moveOperationButton.setVisibility(View.INVISIBLE);
} else {
holder.moveOperationButton.setVisibility(View.VISIBLE);
holder.moveOperationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onMoveOperation(pushMessageDto.operationId);
}
});
}
}
}
private class ViewHolder {
TextView operationNameTextView;
TextView sendDateTextView;
TextView messageTextView;
ImageButton moveOperationButton;
}
public void setAdapterListener(UnreadPushMessageListAdapterListener listener) {
this.listener = listener;
}
public interface UnreadPushMessageListAdapterListener {
void onMoveOperation(Long operationId);
}
}
\ No newline at end of file
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