Commit 3efe1193 by Kim Jinsung

Bug #59911【@Form 2024年度上期開発 android 1.3.8】「ダッシュボード」(または「関連資料」)を表示した状態で、「プッシュメッセージ一覧」を表示できない

parent fd12a476
......@@ -5,24 +5,33 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class OperationActivity extends ABVUIActivity {
@SuppressWarnings("unused")
......@@ -35,8 +44,9 @@ public class OperationActivity extends ABVUIActivity {
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Dialog mCommunicationMenuDialog;
private Dialog mSubMenuDialog;
private Dialog mPushMessageListDialog;
private ListView mPushMessageListView;
private PushMessageListAdapter mPushMessageListAdapter;
protected void createCommonToolber() {
// ホームボタン
mOperationHomeButton = findViewById(R.id.btn_operation_home);
......@@ -208,5 +218,129 @@ public class OperationActivity extends ABVUIActivity {
startActivity(intent, NaviConsts.Right);
}
protected void showPushMessageListDialog(){}
/**
* プッシュメッセージ一覧画面表示
*/
protected void showPushMessageListDialog(){
mPushMessageListDialog = new Dialog(OperationActivity.this);
mPushMessageListDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mPushMessageListDialog.setCanceledOnTouchOutside(false);
mPushMessageListDialog.setContentView(R.layout.push_message_list_dialog);
mPushMessageListView = (ListView) mPushMessageListDialog.findViewById(R.id.lv_push_message);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
mPushMessageListAdapter = new PushMessageListAdapter(OperationActivity.this, pushMessageDtoList);
mPushMessageListView.setAdapter(mPushMessageListAdapter);
mPushMessageListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
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
public void onClick(View v) {
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
mPushMessageListAdapter.setItem(pushMessageDtoList);
showPushMessgeListView(true);
}
});
mPushMessageListDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPushMessageListDialog.dismiss();
reloadOperationPushMessageListView();
}
});
showPushMessgeListView(true);
mPushMessageListDialog.show();
}
/**
* プッシュメッセージ詳細画面表示
* @param dto プッシュメッセージ情報
*/
private void showPushMessageDetailView(final PushMessageDto dto) {
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);
messageTextView.setText(dto.pushMessage);
sendDateTextView.setText(DateTimeUtil.toString(dto.pushSendDate, DateTimeFormat.yyyyMMddHHmm_slash));
sendOperationNameTextView.setText(dto.operationName);
showPushMessgeListView(false);
}
/**
* プッシュメッセージ一覧・詳細画面の切り替え処理
* @param pushMessageListViewFlg true:一覧, false:詳細
*/
private void showPushMessgeListView(boolean pushMessageListViewFlg) {
TextView titleTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_toolbar_title);
if (pushMessageListViewFlg) {
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);
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
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);
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_message_detail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
}
/**
* 子クラスから実装(未読プッシュメッセージ表示領域をリロード)
*/
protected void reloadOperationPushMessageListView(){}
}
......@@ -183,10 +183,7 @@ public class OperationListActivity extends OperationActivity {
private Dialog mOperationSelectDialog;
private ListView mOperationSelectListView;
private Dialog mPushMessageListDialog;
private ListView mPushMessageListView;
private OperationSelectAdapter mOperationSelectAdapter;
private PushMessageListAdapter mPushMessageListAdapter;
private UnreadPushMessageListAdapter mUnreadPushMessageListAdapter;
private File mLocalFile;
......@@ -1521,116 +1518,7 @@ public class OperationListActivity extends OperationActivity {
mOperationSelectDialog.show();
}
@Override
protected void showPushMessageListDialog() {
mPushMessageListDialog = new Dialog(OperationListActivity.this);
mPushMessageListDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mPushMessageListDialog.setCanceledOnTouchOutside(false);
mPushMessageListDialog.setContentView(R.layout.push_message_list_dialog);
mPushMessageListView = (ListView) mPushMessageListDialog.findViewById(R.id.lv_push_message);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
mPushMessageListAdapter = new PushMessageListAdapter(OperationListActivity.this, pushMessageDtoList);
mPushMessageListView.setAdapter(mPushMessageListAdapter);
mPushMessageListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
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
public void onClick(View v) {
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
mPushMessageListAdapter.setItem(pushMessageDtoList);
showPushMessgeListView(true);
}
});
mPushMessageListDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPushMessageListDialog.dismiss();
reloadOperationPushMessageListView();
}
});
showPushMessgeListView(true);
mPushMessageListDialog.show();
}
private void showPushMessageDetailView(final PushMessageDto dto) {
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);
messageTextView.setText(dto.pushMessage);
sendDateTextView.setText(DateTimeUtil.toString(dto.pushSendDate, DateTimeFormat.yyyyMMddHHmm_slash));
sendOperationNameTextView.setText(dto.operationName);
showPushMessgeListView(false);
}
private void showPushMessgeListView(boolean pushMessageListViewFlg) {
TextView titleTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_toolbar_title);
if (pushMessageListViewFlg) {
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);
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} else {
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);
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_message_detail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
}
/**
* プッシュメッセージ送信ダイヤログ表示
......@@ -2544,7 +2432,8 @@ public class OperationListActivity extends OperationActivity {
/**
* 作業一覧画面上部に未読のプッシュメッセージ最大3つ表示
*/
private void reloadOperationPushMessageListView() {
@Override
protected void reloadOperationPushMessageListView() {
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getUnreadPushMessageList();
if (pushMessageDtoList.size() == 0) {
mOperationPushMessageListView.setVisibility(View.GONE);
......
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