Commit 897426a5 by Kazuyuki Hida

画面遷移の不具合を解消

parent 59253259
package jp.agentec.abook.abv.ui.home.activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.LinearLayout;
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.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.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.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
public class DashboardActivity extends ABVUIActivity {
public class DashboardActivity extends OperationActivity {
@SuppressWarnings("unused")
private static final String TAG = "DashboardActivity";
protected ImageButton mOperationHomeButton; // ホームボタン
protected ImageButton mDashboardButton; // ダッシュボード
protected ImageButton mCommonContentButton; // 関連資料
protected ImageButton mCommunicationButton; // コミュニケーション
protected ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private Dialog mCommunicationMenuDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_operation_dashboard);
createCommonToolber();
}
@Override
protected void createCommonToolber() {
super.createCommonToolber();
// ダッシュボード
mDashboardButton = findViewById(R.id.btn_operation_dashboard);
mDashboardButton.setEnabled(false);
// ホームボタン
mOperationHomeButton = findViewById(R.id.btn_operation_home);
mOperationHomeButton.setEnabled(true);
mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
// 共通資料
mCommonContentButton = findViewById(R.id.btn_common_content);
mCommonContentButton.setEnabled(true);
mCommonContentButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommonContent();
}
});
// コミュニケーション
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.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommunicationMenuDialog();
}
});
// 簡易帳票印刷ボタン
mQuickReportPrintButton = findViewById(R.id.btn_operation_print);
if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPrintTargetSelect();
}
});
mQuickReportPrintButton.setVisibility(View.VISIBLE);
} else {
findViewById(R.id.print_layout).setVisibility(View.GONE);
mQuickReportPrintButton.setVisibility(View.GONE);
}
}
// 共通資料画面表示
private void showCommonContent() {
Intent intent = new Intent();
intent.setClass(this, OperationRelatedContentActivity.class);
startActivity(intent);
}
/**
* コミュニケーションダイアログの表示
*/
private void showCommunicationMenuDialog() {
mCommunicationMenuDialog = new Dialog(this);
mCommunicationMenuDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mCommunicationMenuDialog.setCanceledOnTouchOutside(false);
mCommunicationMenuDialog.setContentView(R.layout.communication_menu_dialog);
LinearLayout ll_menuItem_meeting = mCommunicationMenuDialog.findViewById(R.id.ll_item_meeting);
ll_menuItem_meeting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityHandlingHelper.getInstance().startMeetingActivity();
mCommunicationMenuDialog.dismiss();
}
});
mCommunicationMenuDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCommunicationMenuDialog.dismiss();
}
});
mCommunicationMenuDialog.show();
}
// 設定画面へ遷移
public void onClickSetting(View v) {
showSetting();
}
/**
* インターネットが繋がってない場合のダイアログ表示
*/
protected void showDisConnectNetworkDialog() {
handler.post(new Runnable() {
@Override
public void run() {
// ヘッダーの新着更新処理を完了にさせる
stopUpdateAnimation();
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(DashboardActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
});
}
/**
* 簡易帳票印刷対象選択画面表示
*/
protected void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportSearch));
startActivity(intent, NaviConsts.Right);
}
}
......@@ -39,7 +39,13 @@ public class OperationActivity extends ABVUIActivity {
protected void createCommonToolber() {
// ホームボタン
mOperationHomeButton = findViewById(R.id.btn_operation_home);
mOperationHomeButton.setEnabled(false);
mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
backHome();
}
});
// ダッシュボード
mDashboardButton = findViewById(R.id.btn_operation_dashboard);
mDashboardButton.setEnabled(true);
......@@ -97,16 +103,24 @@ public class OperationActivity extends ABVUIActivity {
mQuickReportPrintButton.setVisibility(View.GONE);
}
}
private void backHome() {
Intent intent = new Intent();
intent.setClass(this, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
}
// ダッシュボード表示
private void showDashboard() {
Intent intent = new Intent();
intent.setClass(OperationActivity.this, DashboardActivity.class);
intent.setClass(this, DashboardActivity.class);
startActivity(intent);
}
// 共通資料画面表示
private void showCommonContent() {
Intent intent = new Intent();
intent.setClass(OperationActivity.this, OperationRelatedContentActivity.class);
intent.setClass(this, OperationRelatedContentActivity.class);
startActivity(intent);
}
/**
......
......@@ -291,12 +291,12 @@ public class OperationRelatedContentActivity extends OperationActivity {
*/
private void setOnButtonEvent() {
// プロジェクトホーム画面へ
mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
// mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// finish();
// }
// });
// 一括保存
mAllSaveButton.setOnClickListener(new View.OnClickListener() {
......
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