Commit c82278cd by Kazuyuki Hida

ボトムメニューによる画面遷移を実装した。

parent 059911bc
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jp.agentec.abook.abv.launcher.android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="jp.agentec.abook.abv.launcher.android"
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-sdk tools:overrideLibrary="org.xwalk.core"/> <uses-sdk tools:overrideLibrary="org.xwalk.core" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest> <application>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.DashboardActivity"></activity>
</application>
</manifest>
\ No newline at end of file
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
} }
} }
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
...@@ -29,23 +29,23 @@ android { ...@@ -29,23 +29,23 @@ android {
compileSdkVersion 31 compileSdkVersion 31
buildToolsVersion '30.0.2' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 31 targetSdkVersion 31
multiDexEnabled true multiDexEnabled true
} }
sourceSets { sourceSets {
main { main {
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src'] java.srcDirs = ['src']
resources.srcDirs = ['res'] resources.srcDirs = ['res']
aidl.srcDirs = ['src'] aidl.srcDirs = ['src']
res.srcDirs = ['res'] res.srcDirs = ['res']
jniLibs.srcDirs = ['libs', 'xwalk_core_library/src/main/jniLibs'] jniLibs.srcDirs = ['libs', 'xwalk_core_library/src/main/jniLibs']
}
} }
}
lintOptions { lintOptions {
quiet true quiet true
checkReleaseBuilds false checkReleaseBuilds false
......
<?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="match_parent"
android:orientation="vertical"
tools:context="jp.agentec.abook.abv.ui.home.activity.DashboardActivity">
<RelativeLayout
android:id="@+id/frameTopbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color"
android:minHeight="50dp" >
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/text_dialog"
android:gravity="center"
android:visibility="gone"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/menuLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="5dp" >
<ImageButton
android:id="@+id/btn_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_operation_help"
android:layout_marginTop="6dp"
android:layout_marginEnd="10dp"
/>
</LinearLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/frameWebView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
</FrameLayout>
<include layout="@layout/operation_common_toolbar" android:id="@+id/toolbar2"/>
</LinearLayout>
...@@ -10,6 +10,20 @@ ...@@ -10,6 +10,20 @@
android:minHeight="50dp" android:minHeight="50dp"
android:visibility="visible"> android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_operation_dashboard"
style="@style/ToolBarIcon"
android:src="@drawable/btn_operation_dashboard" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
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 {
@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();
}
protected void 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);
}
}
...@@ -25,8 +25,10 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; ...@@ -25,8 +25,10 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
public class OperationActivity extends ABVUIActivity { public class OperationActivity extends ABVUIActivity {
@SuppressWarnings("unused")
private static final String TAG = "OperationActivity"; private static final String TAG = "OperationActivity";
protected ImageButton mOperationHomeButton; // ホームボタン protected ImageButton mOperationHomeButton; // ホームボタン
protected ImageButton mDashboardButton; // ダッシュボード
protected ImageButton mCommonContentButton; // 関連資料 protected ImageButton mCommonContentButton; // 関連資料
protected ImageButton mCommunicationButton; // コミュニケーション protected ImageButton mCommunicationButton; // コミュニケーション
protected ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン protected ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
...@@ -36,10 +38,20 @@ public class OperationActivity extends ABVUIActivity { ...@@ -36,10 +38,20 @@ public class OperationActivity extends ABVUIActivity {
protected void createCommonToolber() { protected void createCommonToolber() {
// ホームボタン // ホームボタン
mOperationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home); mOperationHomeButton = findViewById(R.id.btn_operation_home);
mOperationHomeButton.setEnabled(false);
// ダッシュボード
mDashboardButton = findViewById(R.id.btn_operation_dashboard);
mDashboardButton.setEnabled(true);
mDashboardButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDashboard();
}
});
// 共通資料 // 共通資料
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content); mCommonContentButton = findViewById(R.id.btn_common_content);
mCommonContentButton.setEnabled(true); mCommonContentButton.setEnabled(true);
mCommonContentButton.setOnClickListener(new View.OnClickListener() { mCommonContentButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -49,7 +61,7 @@ public class OperationActivity extends ABVUIActivity { ...@@ -49,7 +61,7 @@ public class OperationActivity extends ABVUIActivity {
}); });
// コミュニケーション // コミュニケーション
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); mCommunicationButton = findViewById(R.id.btn_communication_menu);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList(); List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
boolean existUnreadFlg = false; boolean existUnreadFlg = false;
for (PushMessageDto pushMessageDto : pushMessageDtoList) { for (PushMessageDto pushMessageDto : pushMessageDtoList) {
...@@ -71,7 +83,7 @@ public class OperationActivity extends ABVUIActivity { ...@@ -71,7 +83,7 @@ public class OperationActivity extends ABVUIActivity {
}); });
// 簡易帳票印刷ボタン // 簡易帳票印刷ボタン
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print); mQuickReportPrintButton = findViewById(R.id.btn_operation_print);
if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) { if (ABVDataCache.getInstance().serviceOption.isUnableIOReport()) {
mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() { mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -85,7 +97,12 @@ public class OperationActivity extends ABVUIActivity { ...@@ -85,7 +97,12 @@ public class OperationActivity extends ABVUIActivity {
mQuickReportPrintButton.setVisibility(View.GONE); mQuickReportPrintButton.setVisibility(View.GONE);
} }
} }
// ダッシュボード表示
private void showDashboard() {
Intent intent = new Intent();
intent.setClass(OperationActivity.this, DashboardActivity.class);
startActivity(intent);
}
// 共通資料画面表示 // 共通資料画面表示
private void showCommonContent() { private void showCommonContent() {
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -102,7 +119,7 @@ public class OperationActivity extends ABVUIActivity { ...@@ -102,7 +119,7 @@ public class OperationActivity extends ABVUIActivity {
mCommunicationMenuDialog.setContentView(R.layout.communication_menu_dialog); mCommunicationMenuDialog.setContentView(R.layout.communication_menu_dialog);
List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList(); List<PushMessageDto> pushMessageDtoList = mPushMessageLogic.getAllPushMessageList();
LinearLayout ll_menuItem_meeting = (LinearLayout)mCommunicationMenuDialog.findViewById(R.id.ll_item_meeting); LinearLayout ll_menuItem_meeting = mCommunicationMenuDialog.findViewById(R.id.ll_item_meeting);
ll_menuItem_meeting.setOnClickListener(new View.OnClickListener() { ll_menuItem_meeting.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
......
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