Commit 4411c5c5 by Kim Jinsung

Merge branch 'features/1.2.0_34869' into 'features/1.2.0'

プッシュメッセージ詳細画面タップ時、該当のプッシュメッセージ以外で全てが既読であれば、バッジ表示を非表示に変更するように修正

See merge request !36
parents 5c1bb4bc b0d72320
......@@ -66,6 +66,7 @@ import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
......@@ -76,6 +77,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
protected TextView mUpdatedDate; // add by jang
protected TextView mLoadingText; // add by jang;
protected ImageButton communicationButton; // コミュニケーションボタン
private Dialog mCommunicationMenuDialog;
private Dialog mOperationSelectDialog;
private ListView mOperationSelectListView;
......@@ -642,14 +644,14 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
mPushMessageListDialog.setContentView(R.layout.push_message_list_dialog);
mPushMessageListView = (ListView) mPushMessageListDialog.findViewById(R.id.lv_push_message);
List<PushMessageDto> pushMessageDtoList = pushMessageLogic.getAllPushMessageList();
final List<PushMessageDto> pushMessageDtoList = pushMessageLogic.getAllPushMessageList();
mPushMessageListAdapter = new PushMessageListAdapter(this, pushMessageDtoList);
mPushMessageListView.setAdapter(mPushMessageListAdapter);
mPushMessageListAdapter.setAdapterListener(new PushMessageListAdapter.PushMessageListAdapterListener() {
@Override
public void onDetailView(final PushMessageDto dto) {
showPushMessageDetailView(dto);
showPushMessageDetailView(dto, pushMessageDtoList);
}
});
mPushMessageListView.invalidate();
......@@ -676,7 +678,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
}
// プッシュメッセージの詳細表示
private void showPushMessageDetailView(final PushMessageDto dto) {
private void showPushMessageDetailView(final PushMessageDto dto, List<PushMessageDto> pushMessageDtoList) {
dto.readingFlg = true;
TextView messageTextView = (TextView)mPushMessageListDialog.findViewById(R.id.tv_message);
......@@ -689,7 +691,15 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
sendUserTextView.setText(dto.pushSendLoginId);
pushMessageLogic.updateReadingFlg(dto.pushMessageId);
// チェック用のプッシュメッセージリストをインスタント化して、該当のプッシュメッセージだけ削除する
List<PushMessageDto> checkPushMessageList = new ArrayList<>();
checkPushMessageList.addAll(pushMessageDtoList);
checkPushMessageList.remove(dto);
// 他のプッシュメッセージで未読がなければ、バッジを外す
if (!checkUnReadCommunication(checkPushMessageList)) {
communicationButton.setImageResource(R.drawable.ic_communication_menu);
}
showPushMessgeListView(false);
}
......@@ -913,9 +923,18 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
}
// コミュニケーションのアイコン設定(未既読があれば、バッチ付きアイコンでセット)
protected void setCommunicationImageButton(ImageButton communicationButton) {
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) {
......@@ -923,6 +942,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
break;
}
}
communicationButton.setImageResource(existUnreadFlg ? R.drawable.ic_communication_menu_with_badge : R.drawable.ic_communication_menu);
return existUnreadFlg;
}
}
......@@ -122,7 +122,6 @@ public class OperationListActivity extends ABVUIActivity {
private ImageButton mViewModeButton; // パンネル・リスト表示ボタン
private ImageButton mSearchButton; // 検索ボタン
private ImageButton mCommunicationButton; // コミュニケーションボタン
private ImageButton mCommonContentButton; // 共通資料ボタン
private ImageButton mOperationBatchSyncButton; // カテゴリの一括同期ボタン
private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン
......@@ -206,7 +205,7 @@ public class OperationListActivity extends ABVUIActivity {
mOperationTitle = (TextView) findViewById(R.id.operation_title);
mOperationBatchSyncButton = (ImageButton) findViewById(R.id.btn_batch_sync);
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
mCategoryLocationButton = (ImageButton) findViewById(R.id.btn_category_location);
......@@ -242,7 +241,7 @@ public class OperationListActivity extends ABVUIActivity {
});
// コミュニケーションボタン
mCommunicationButton.setOnClickListener(new View.OnClickListener() {
communicationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommunicationMenuDialog();
......@@ -354,7 +353,7 @@ public class OperationListActivity extends ABVUIActivity {
private void configurationToolbarIcon() {
// バッチを付けるか判定して、イメージを設定
setCommunicationImageButton(mCommunicationButton);
setCommunicationImageButton();
// 作業種別表示・非表示
if (mOperationGroupMasterServiceOperationFlg) {
......@@ -494,6 +493,7 @@ public class OperationListActivity extends ABVUIActivity {
Logger.d(TAG, "onResume Sync operationId : " + operationId);
if (operationDto != null && operationDto.needSyncFlg) {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
closeProgressPopup();
ABVToastUtil.showMakeText(OperationListActivity.this, R.string.msg_network_offline, Toast.LENGTH_SHORT);
return;
}
......
......@@ -8,8 +8,6 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
......@@ -18,8 +16,6 @@ import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
......@@ -33,7 +29,6 @@ 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.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
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.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
......@@ -53,7 +48,6 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private ImageButton mOperationHomeButton; // ホームボタン
private ImageButton mOperationRelatedContentButton; // 関連資料ボタン
private ImageButton mCommunicationButton; // コミュニケーションボタン
private TextView mTxtOperationRelatedContent;
private Button mAllSaveButton;
......@@ -73,7 +67,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
// 共通資料ボタン
mOperationRelatedContentButton = (ImageButton) findViewById(R.id.btn_common_content);
// コミュニケーションボタン
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
// 一括保存ボタン
mAllSaveButton = (Button) findViewById(R.id.btn_all_save);
......@@ -99,9 +93,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
// 共通資料ボタンの非活性化
mOperationRelatedContentButton.setEnabled(false);
// バッチを付けるか判定して、イメージを設定
setCommunicationImageButton(mCommunicationButton);
setCommunicationImageButton();
// コミュニケーションボタン
mCommunicationButton.setOnClickListener(new View.OnClickListener() {
communicationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommunicationMenuDialog();
......
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