Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
df49fae1
Commit
df49fae1
authored
Jan 17, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSとのデータの受け渡しはしていないが、ダミーの値でダッシュボードが表示されるところまでできた。
parent
76af564a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
9 deletions
+74
-9
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+1
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
+73
-9
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
df49fae1
...
...
@@ -36,6 +36,7 @@ public class ABookKeys {
public
static
final
String
CMD_PAGE_NUM
=
"pageNum"
;
public
static
final
String
CMD_LOCK_REPORT
=
"lockReport"
;
public
static
final
String
CMD_UNLOCK_REPORT
=
"unlockReport"
;
public
static
final
String
CMD_GET_REPORT_LIST
=
"getReportList"
;
public
static
final
String
GPS_TYPE
=
"gpsType"
;
public
static
final
String
STATUS_CODE
=
"statusCode"
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
View file @
df49fae1
...
...
@@ -5,7 +5,6 @@ import android.net.Uri;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.inputmethod.EditorInfo
;
import
android.webkit.ValueCallback
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
...
...
@@ -15,11 +14,18 @@ import android.widget.ImageButton;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
java.util.HashMap
;
import
java.util.Map
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
common
.
constant
.
ABookCommConstants
.
DASHBOARD_URL
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
common
.
constant
.
ABookKeys
.
CMD_GET_REPORT_LIST
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
common
.
constant
.
ABookKeys
.
CMD_LOCK_REPORT
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
common
.
constant
.
ABookKeys
.
CMD_UNLOCK_REPORT
;
public
class
DashboardActivity
extends
OperationActivity
{
private
static
final
String
TAG
=
"DashboardActivity"
;
...
...
@@ -88,7 +94,7 @@ public class DashboardActivity extends OperationActivity {
}
initSettings
(
webView
.
getSettings
());
webView
.
setWebChromeClient
(
new
ChromeClient
());
webView
.
setWebViewClient
(
new
Web
ViewClient
());
webView
.
setWebViewClient
(
new
ViewClient
());
// webView.addJavascriptInterface(jsInf, "android");
Logger
.
d
(
TAG
,
"loadUrl: "
+
DASHBOARD_URL
);
...
...
@@ -125,13 +131,6 @@ public class DashboardActivity extends OperationActivity {
}
}
}
@Override
public
boolean
onShowFileChooser
(
WebView
webView
,
ValueCallback
<
Uri
[]>
filePathCallback
,
FileChooserParams
fileChooserParams
)
{
Logger
.
i
(
TAG
,
"oepnFile acceptType : %s"
,
fileChooserParams
.
getAcceptTypes
()[
0
]);
return
false
;
}
}
// private class JsInf {
...
...
@@ -175,4 +174,69 @@ public class DashboardActivity extends OperationActivity {
// commonAttachedDataUrl(taskKey, data);
// }
// }
private
class
ViewClient
extends
WebViewClient
{
@SuppressWarnings
(
"deprecation"
)
@Override
public
void
onReceivedError
(
WebView
view
,
int
errorCode
,
String
description
,
String
failingUrl
)
{
Logger
.
e
(
TAG
,
"onReceivedError errorCode=%s, description=%s, failingUrl=%s"
,
errorCode
,
description
,
failingUrl
);
}
@Override
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
Logger
.
v
(
TAG
,
"shouldOverrideUrlLoading: %s"
,
url
);
if
(
url
.
startsWith
(
"abook"
))
{
final
Uri
uri
=
Uri
.
parse
(
url
);
// AndroidOSが5以下のPANO_SERVER処理のため、置き換える必要がある。
url
=
"/"
+
url
;
if
(
url
.
contains
(
ABookKeys
.
ABOOK_CHECK_API
))
{
return
checkApiLoding
(
uri
);
}
return
true
;
}
return
false
;
}
}
private
boolean
checkApiLoding
(
Uri
uri
)
{
Map
<
String
,
String
>
abookCheckParam
=
new
HashMap
<>();
for
(
String
key
:
uri
.
getQueryParameterNames
())
{
abookCheckParam
.
put
(
key
,
uri
.
getQueryParameter
(
key
));
}
String
cmd
=
abookCheckParam
.
get
(
ABookKeys
.
CMD
);
if
(
cmd
==
null
)
{
return
false
;
}
switch
(
cmd
)
{
case
CMD_GET_REPORT_LIST:
{
return
getReportList
();
}
case
CMD_LOCK_REPORT:
{
return
lockReport
();
}
case
CMD_UNLOCK_REPORT:
{
return
unlockReport
();
}
}
return
false
;
}
private
boolean
getReportList
()
{
//todo
return
true
;
}
private
boolean
lockReport
()
{
//todo
return
true
;
}
private
boolean
unlockReport
()
{
//todo
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment