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
ae5457df
Commit
ae5457df
authored
Mar 03, 2020
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#37367 HT付きスマートデバイスでのチェック項目遷移
parent
0c522b34
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
180 additions
and
55 deletions
+180
-55
ABVJE_UI_Android/res/layout/ac_html_webview.xml
+1
-6
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLWebViewActivity.java
+17
-22
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLXWalkWebViewActivity.java
+14
-27
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
+48
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/CheckFormWebview.java
+50
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/CheckFormXWalkWebview.java
+50
-0
No files found.
ABVJE_UI_Android/res/layout/ac_html_webview.xml
View file @
ae5457df
...
...
@@ -193,17 +193,12 @@
</RelativeLayout>
<FrameLayout
android:id=
"@+id/frameWebView"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<WebView
android:id=
"@+id/webView2"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"0dp"
/>
<ProgressBar
android:id=
"@+id/refresh_prog"
style=
"?android:attr/progressBarStyleLarge"
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLWebViewActivity.java
View file @
ae5457df
...
...
@@ -10,6 +10,7 @@ import android.view.View.OnClickListener;
import
android.view.View.OnTouchListener
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.inputmethod.EditorInfo
;
import
android.webkit.JavascriptInterface
;
import
android.webkit.ValueCallback
;
import
android.webkit.WebChromeClient
;
...
...
@@ -20,7 +21,9 @@ import android.webkit.WebView;
import
android.webkit.WebViewClient
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView.OnItemClickListener
;
import
android.widget.FrameLayout
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.Toast
;
...
...
@@ -58,6 +61,8 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import
jp.agentec.abook.abv.ui.common.util.ABVToastUtil
;
import
jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormXWalkWebview
;
//TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約
public
class
HTMLWebViewActivity
extends
ParentWebViewActivity
{
...
...
@@ -100,7 +105,18 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
// ***** WebViewセット
webView
=
(
WebView
)
findViewById
(
R
.
id
.
webView2
);
FrameLayout
frameLayout
=
findViewById
(
R
.
id
.
frameWebView
);
// WebView上のIMEキーボード入力をハンドリングするため、カスタムWebViewに変更
this
.
webView
=
new
CheckFormWebview
(
this
,
new
CheckFormWebview
.
KeyActionCallback
()
{
@Override
public
void
keyActionCallback
(
int
editorInfoAction
)
{
if
(
editorInfoAction
==
EditorInfo
.
IME_ACTION_GO
||
editorInfoAction
==
EditorInfo
.
IME_ACTION_NEXT
)
{
// キーボードの次ボタン検知
doEnterEvent
();
}
}
});
frameLayout
.
addView
(
webView
,
new
LinearLayout
.
LayoutParams
(
FP
,
FP
));
webView
.
setVisibility
(
View
.
VISIBLE
);
webView
.
setVerticalScrollbarOverlay
(
true
);
// スクロールバー部分の隙間を消す
if
(
Logger
.
isDebugEnabled
())
{
...
...
@@ -535,27 +551,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
finishWebView
();
}
@Override
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
if
(
mOperationId
!=
null
&&
mOperationId
>
-
1
)
{
putUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
mOperationId
);
}
if
(
isLinkedContent
)
{
goToBack
();
}
else
{
finishActivity
();
}
}
else
{
return
super
.
onKeyUp
(
keyCode
,
event
);
}
return
false
;
}
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
return
super
.
onKeyDown
(
keyCode
,
event
);
}
@Override
protected
void
finishActivity
()
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLXWalkWebViewActivity.java
View file @
ae5457df
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
activity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
...
...
@@ -9,6 +8,7 @@ import android.view.MotionEvent;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.inputmethod.EditorInfo
;
import
android.webkit.ValueCallback
;
import
android.webkit.WebView
;
import
android.widget.AdapterView
;
...
...
@@ -46,9 +46,7 @@ import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
import
jp.agentec.abook.abv.cl.util.ContentLogUtil
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.abook.abv.ui.common.constant.ErrorCode
;
...
...
@@ -57,6 +55,8 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import
jp.agentec.abook.abv.ui.common.util.PatternStringUtil
;
import
jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormXWalkWebview
;
/**
* Created by leej on 2018/04/17.
...
...
@@ -70,7 +70,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
private
ImageButton
reloadButton
;
private
ImageButton
downloadButton
;
private
int
objectLogId
;
private
XWalkV
iew
webView
;
private
CheckFormXWalkWebv
iew
webView
;
private
HTMLXWalkWebViewActivity
.
JsInf
jsInf
=
new
HTMLXWalkWebViewActivity
.
JsInf
();
...
...
@@ -101,9 +101,17 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
// ***** WebViewセット
webView
=
new
XWalkView
(
this
);
// WebView上のIMEキーボード入力をハンドリングするため、カスタムWebViewに変更
xWalkLayout
=
(
FrameLayout
)
findViewById
(
R
.
id
.
xWalkLayout
);
webView
=
new
CheckFormXWalkWebview
(
this
,
new
CheckFormXWalkWebview
.
KeyActionCallback
()
{
@Override
public
void
keyActionCallback
(
int
editorInfoAction
)
{
if
(
editorInfoAction
==
EditorInfo
.
IME_ACTION_GO
||
editorInfoAction
==
EditorInfo
.
IME_ACTION_NEXT
)
{
// キーボードの次ボタン検知
doEnterEvent
();
}
}
});
xWalkLayout
.
setVisibility
(
View
.
VISIBLE
);
xWalkLayout
.
addView
(
webView
,
new
ViewGroup
.
LayoutParams
(
WC
,
WC
));
webView
.
setVerticalFadingEdgeEnabled
(
false
);
...
...
@@ -573,27 +581,6 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
}
@Override
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
if
(
mOperationId
!=
null
&&
mOperationId
>
-
1
)
{
putUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
mOperationId
);
}
if
(
isLinkedContent
)
{
goToBack
();
}
else
{
finishActivity
();
}
}
else
{
return
super
.
onKeyUp
(
keyCode
,
event
);
}
return
false
;
}
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
return
super
.
onKeyDown
(
keyCode
,
event
);
}
@Override
protected
void
finishActivity
()
{
setResult
(
RESULT_OK
,
new
Intent
());
finish
();
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
View file @
ae5457df
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.net.Uri
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.ImageButton
;
...
...
@@ -217,6 +218,29 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
}
@Override
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
if
(
mOperationId
!=
null
&&
mOperationId
>
-
1
)
{
putUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
mOperationId
);
}
if
(
isLinkedContent
)
{
goToBack
();
}
else
{
finishActivity
();
}
}
else
{
return
super
.
onKeyUp
(
keyCode
,
event
);
}
return
false
;
}
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
return
super
.
onKeyDown
(
keyCode
,
event
);
}
@Override
protected
void
onDestroy
()
{
Logger
.
d
(
TAG
,
"onDestroy"
);
if
(
mXWalkOpenType
==
Constant
.
XWalkOpenType
.
TASK_REPORT
)
{
...
...
@@ -430,4 +454,28 @@ public class ParentWebViewActivity extends ABVCheckContentViewActivity {
webViewLoadUrl
(
url
);
}
// キーボードのエンターを検知してJavascriptを実行
protected
void
doEnterEvent
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
Logger
.
i
(
TAG
,
"javascript:CHK.notifyMoveForcus()"
);
webViewLoadUrl
(
"javascript:CHK.notifyMoveForcus()"
);
}
});
}
@Override
public
boolean
dispatchKeyEvent
(
KeyEvent
event
)
{
// Enterキー入力イベントのみ検知、他の検知はonKeyUpで行う
if
(
event
.
getAction
()==
KeyEvent
.
ACTION_DOWN
||
event
.
getAction
()==
KeyEvent
.
ACTION_UP
)
{
switch
(
event
.
getKeyCode
())
{
case
KeyEvent
.
KEYCODE_ENTER
:
// バーコード読み取り時のEnterキー入力イベントをハンドリング
doEnterEvent
();
break
;
}
}
return
super
.
dispatchKeyEvent
(
event
);
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/CheckFormWebview.java
0 → 100644
View file @
ae5457df
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
view
;
import
android.content.Context
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputConnection
;
import
android.view.inputmethod.InputConnectionWrapper
;
import
android.webkit.WebView
;
/**
* WebViewのキーボード検知するクラス
*/
public
class
CheckFormWebview
extends
WebView
{
private
Context
mContext
;
private
KeyActionCallback
mKeyActionCallback
;
public
interface
KeyActionCallback
{
void
keyActionCallback
(
int
editorInfoAction
);
}
public
CheckFormWebview
(
Context
context
,
KeyActionCallback
callback
)
{
super
(
context
);
mContext
=
context
;
mKeyActionCallback
=
callback
;
}
@Override
public
InputConnection
onCreateInputConnection
(
EditorInfo
ei
)
{
InputConnection
input
=
super
.
onCreateInputConnection
(
ei
);
if
(
input
==
null
)
{
return
null
;
}
return
new
MyConnection
(
input
);
}
private
class
MyConnection
extends
InputConnectionWrapper
{
public
MyConnection
(
InputConnection
wrapped
)
{
super
(
wrapped
,
false
);
}
// WebView上でIMEキーボードのアクションがあった場合のハンドリングを行う
@Override
public
boolean
performEditorAction
(
int
action
)
{
if
(
mKeyActionCallback
!=
null
)
{
mKeyActionCallback
.
keyActionCallback
(
action
);
}
return
true
;
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/CheckFormXWalkWebview.java
0 → 100644
View file @
ae5457df
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
view
;
import
android.content.Context
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputConnection
;
import
android.view.inputmethod.InputConnectionWrapper
;
import
org.xwalk.core.XWalkView
;
/**
* XWalkViewのキーボード検知するクラス
*/
public
class
CheckFormXWalkWebview
extends
XWalkView
{
private
Context
mContext
;
private
KeyActionCallback
mKeyActionCallback
;
public
interface
KeyActionCallback
{
void
keyActionCallback
(
int
editorInfoAction
);
}
public
CheckFormXWalkWebview
(
Context
context
,
KeyActionCallback
callback
)
{
super
(
context
);
mContext
=
context
;
mKeyActionCallback
=
callback
;
}
@Override
public
InputConnection
onCreateInputConnection
(
EditorInfo
ei
)
{
InputConnection
input
=
super
.
onCreateInputConnection
(
ei
);
if
(
input
==
null
){
return
null
;
}
return
new
MyConnection
(
input
);
}
private
class
MyConnection
extends
InputConnectionWrapper
{
public
MyConnection
(
InputConnection
wrapped
)
{
super
(
wrapped
,
false
);
}
// WebView上でIMEキーボードのアクションがあった場合のハンドリングを行う
@Override
public
boolean
performEditorAction
(
int
action
)
{
if
(
mKeyActionCallback
!=
null
)
{
mKeyActionCallback
.
keyActionCallback
(
action
);
}
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