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
409f5a6e
Commit
409f5a6e
authored
May 22, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
レビューの指摘により、下記を修正。
* コメントを追加した。 * LoginActivityの動作を元に戻した。
parent
80247a91
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
22 deletions
+114
-22
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+16
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/AgreementToTermsJSON.java
+9
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AgreementToTermsParameters.java
+13
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
+3
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
+18
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
+0
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/helper/LogoutHelper.java
+9
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/util/AlertDialogUtil.java
+4
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivity.java
+34
-15
gradle.properties
+8
-4
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
409f5a6e
...
...
@@ -1114,12 +1114,28 @@ public class AcmsClient implements AcmsClientResponseListener {
return
new
TermsOfUseJson
(
response
.
httpResponseBody
);
}
/**
* 規約情報の取得
*
* @param sid セッションID
* @return
* @throws AcmsException CMSがエラーを返した時の例外
* @throws NetworkDisconnectedException ネットワークエラー
*/
public
AgreementToTermsJSON
getTerms
(
String
sid
)
throws
AcmsException
,
NetworkDisconnectedException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiGetTerms
,
new
AcmsParameters
(
sid
));
AgreementToTermsJSON
json
=
new
AgreementToTermsJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
* 規約に同意したことをCMSに通達
*
* @param params パラメータ
* @return 標準的なレスポンス
* @throws AcmsException CMSがエラーを返した時の例外
* @throws NetworkDisconnectedException ネットワークエラー
*/
public
AcmsCommonJSON
agreeTerms
(
AgreementToTermsParameters
params
)
throws
AcmsException
,
NetworkDisconnectedException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiAgreeTerms
,
params
);
AcmsCommonJSON
json
=
new
AcmsCommonJSON
(
response
.
httpResponseBody
);
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/AgreementToTermsJSON.java
View file @
409f5a6e
...
...
@@ -6,6 +6,9 @@ import org.json.adf.JSONObject;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
/**
* 規約同意のAPIで使うレスポンス
*/
public
class
AgreementToTermsJSON
extends
AcmsCommonJSON
{
private
static
final
String
TERMS_VERSION
=
"termsVersion"
;
...
...
@@ -25,10 +28,16 @@ public class AgreementToTermsJSON extends AcmsCommonJSON {
terms
=
json
.
has
(
TERMS
)
?
json
.
getString
(
TERMS
)
:
""
;
}
/**
* @return 規約のバージョン
*/
public
String
getTermsVersion
()
{
return
termsVersion
;
}
/**
* @return 規約の内容
*/
public
String
getTerms
()
{
return
terms
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/AgreementToTermsParameters.java
View file @
409f5a6e
...
...
@@ -2,20 +2,33 @@ package jp.agentec.abook.abv.bl.acms.client.parameters;
import
jp.agentec.adf.net.http.HttpParameterObject
;
/**
* 規約同意時に使用するパラメータ
*/
public
class
AgreementToTermsParameters
extends
HttpParameterObject
{
private
final
String
sid
;
private
final
String
termsVersion
;
/**
* @param sid セッションID
* @param termsVersion 同意した規約のバージョン
*/
public
AgreementToTermsParameters
(
String
sid
,
String
termsVersion
)
{
super
();
this
.
sid
=
sid
;
this
.
termsVersion
=
termsVersion
;
}
/**
* @return セッションID
*/
public
String
getSid
()
{
return
sid
;
}
/**
* @return 同意した規約のバージョン
*/
public
String
getTermsVersion
()
{
return
termsVersion
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
View file @
409f5a6e
...
...
@@ -351,6 +351,9 @@ public class ABVDataCache {
return
isServiceOptionEnable
(
ServiceOptionId
.
AlcoholCheckerHw
);
}
/**
* @return 規約同意オプションがYならtrue
*/
public
boolean
isUsableAgreementToTerms
()
{
return
isServiceOptionEnable
(
ServiceOptionId
.
agrementToTerms
);
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
View file @
409f5a6e
...
...
@@ -7,14 +7,32 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AgreementToTermsParameters
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
/**
* 規約同意の入出力
*/
public
class
AgreementToTermsLogic
extends
AbstractLogic
{
private
static
final
String
TAG
=
"AgreementToTermsLogic"
;
/**
* 規約情報の取得
*
* @return 規約情報
* @throws AcmsException CMSがエラーを返したという例外
* @throws NetworkDisconnectedException ネットワークエラー
*/
public
AgreementToTermsJSON
getTerms
()
throws
AcmsException
,
NetworkDisconnectedException
{
String
sid
=
cache
.
getMemberInfo
().
sid
;
return
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
getTerms
(
sid
);
}
/**
* 同意したことをCMSに通達
*
* @param termsVersion バージョン
* @return 標準的なレスポンス情報
* @throws AcmsException CMSがエラーを返したという例外
* @throws NetworkDisconnectedException ネットワークエラー
*/
public
AcmsCommonJSON
agreeTerms
(
String
termsVersion
)
throws
AcmsException
,
NetworkDisconnectedException
{
String
sid
=
cache
.
getMemberInfo
().
sid
;
return
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
agreeTerms
(
new
AgreementToTermsParameters
(
sid
,
termsVersion
));
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
View file @
409f5a6e
...
...
@@ -126,7 +126,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
if
(!(
this
instanceof
LoginActivity
))
{
finish
();
}
LoginActivity
.
finishPendingActivity
();
Intent
intent
=
new
Intent
();
getApplicationContext
().
sendBroadcast
(
intent
);
}
...
...
@@ -416,7 +415,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
return
;
}
// 必要に応じて、規約同意画面を表示
AgreementToTermsActivity
.
clearVersion
(
this
);
// for debug!
AgreementToTermsActivity
.
PreAgreementListener
listener
=
new
AgreementToTermsActivity
.
PreAgreementListener
()
{
@Override
public
void
onDisabled
()
{
...
...
@@ -508,7 +506,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
if
(!
(
this
instanceof
LoginActivity
))
{
finish
();
}
LoginActivity
.
finishPendingActivity
();
}
/**
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/helper/LogoutHelper.java
View file @
409f5a6e
...
...
@@ -15,8 +15,17 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import
jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity
;
import
jp.agentec.abook.abv.ui.home.activity.LoginActivity
;
/**
* ログアウトする時に使用するヘルパークラス
* 複数個所で、ログアウトする契機があるので、まとめた。
*/
public
class
LogoutHelper
{
/**
* ログアウトして、ログイン画面に遷移する
*
* @param activity 呼び出し元アクティビティ
*/
public
static
void
logout
(
Activity
activity
)
{
try
{
// modify by Jang 2013.06.20
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/util/AlertDialogUtil.java
View file @
409f5a6e
...
...
@@ -96,6 +96,10 @@ public class AlertDialogUtil {
alertDialog
.
show
();
}
public
static
void
showAlertDialog
(
Context
context
,
int
title
,
int
message
)
{
showAlertDialog
(
context
,
title
,
message
,
true
,
null
);
}
public
static
ABookAlertDialog
deleteContentAlertDialog
(
Context
context
,
int
deleteMessage
)
{
ABookAlertDialog
alertDialog
=
createAlertDialog
(
context
,
R
.
string
.
delete
);
alertDialog
.
setMessage
(
deleteMessage
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivity.java
View file @
409f5a6e
...
...
@@ -22,14 +22,28 @@ import jp.agentec.abook.abv.ui.common.activity.ABVActivity;
import
jp.agentec.abook.abv.ui.common.activity.ABVUIActivity
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
/**
* 規約同意画面
* AgreementToTermsActivity.confirmAgreement()メソッドを実行すると、
* 規約同意画面を表示する必要があるかを判別して、必要な場合のみ表示する。
* 規約に同意したか同意しなかったかは、onActivityResult()でresultCodeがRESULT_OKなら同意、
* RESULT_CANCELEDだったら同意しないと判別する
*/
public
class
AgreementToTermsActivity
extends
ABVUIActivity
{
private
static
final
String
TAG
=
"AgreementToTermsActivity"
;
private
String
currentVersion
=
""
;
/**
* 規約同意画面を表示しなかった(あるいはできなかった)場合の処理を指定するリスナー
*/
public
interface
PreAgreementListener
{
// 規約同意オプションがNoだった
void
onDisabled
();
// 規約内容やバージョンが空だった
void
onEmpty
();
// すでに同意済みだった
void
onAgreed
();
// 規約情報の取得に失敗した
void
onFailed
(
Exception
e
);
}
...
...
@@ -79,7 +93,9 @@ public class AgreementToTermsActivity extends ABVUIActivity {
}
}
// 同意する
/**
* 同意するをタップしたときの処理
*/
private
void
agree
()
{
showProgressPopup
();
CommonExecutor
.
execute
(
new
Runnable
()
{
...
...
@@ -110,7 +126,7 @@ public class AgreementToTermsActivity extends ABVUIActivity {
}
else
{
messageId
=
R
.
string
.
failed_to_send_agreement
;
}
AlertDialogUtil
.
showAlertDialog
(
AgreementToTermsActivity
.
this
,
R
.
string
.
app_name
,
messageId
,
true
,
null
);
AlertDialogUtil
.
showAlertDialog
(
AgreementToTermsActivity
.
this
,
R
.
string
.
app_name
,
messageId
);
}
});
}
finally
{
...
...
@@ -120,7 +136,9 @@ public class AgreementToTermsActivity extends ABVUIActivity {
});
}
// 同意しない
/**
* 同意しないをタップしたときの処理
*/
private
void
disagree
()
{
// 確認ダイアログ
AlertDialogUtil
.
showAlertDialog
(
this
,
R
.
string
.
app_name
,
R
.
string
.
logout_by_disagree
,
false
,
...
...
@@ -175,11 +193,21 @@ public class AgreementToTermsActivity extends ABVUIActivity {
intent
.
putExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
,
json
.
getTermsVersion
());
intent
.
putExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS
,
json
.
getTerms
());
context
.
startActivityForResult
(
intent
,
requestCode
);
}
catch
(
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
listener
.
onFailed
(
e
);
context
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
listener
.
onFailed
(
e
);
}
});
}
finally
{
context
.
closeProgressPopup
();
context
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
context
.
closeProgressPopup
();
}
});
}
}
});
...
...
@@ -204,13 +232,4 @@ public class AgreementToTermsActivity extends ABVUIActivity {
private
static
void
setLatestVersion
(
Context
context
,
String
version
)
{
PreferenceUtil
.
putUserPref
(
context
,
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
,
version
);
}
/**
* 規約同意バージョンをクリア(動作確認時に使用するために残しておく)
*
* @param context
*/
public
static
void
clearVersion
(
Context
context
)
{
PreferenceUtil
.
removeUserPref
(
context
,
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
);
}
}
gradle.properties
View file @
409f5a6e
...
...
@@ -38,12 +38,16 @@ app_versioncode=1
# abvEnvironments.xml
#cms server
acms_address
=
https://chatdev2.agentec.jp/acms
download_server_address
=
https://chatdev2.agentec.jp/acms
#acms_address=https://chatdev2.agentec.jp/acms
#download_server_address=https://chatdev2.agentec.jp/acms
acms_address
=
https://check130.abook.bz/acms
download_server_address
=
https://check130.abook.bz/acms
#syncview server
websocket_server_http_url
=
https://check130.agentec.jp/v1
websocket_server_ws_url
=
wss://check130.agentec.jp/v1
#websocket_server_http_url=https://check130.agentec.jp/v1
#websocket_server_ws_url=wss://check130.agentec.jp/v1
websocket_server_http_url
=
https://check130.abook.bz:10443/v1
websocket_server_ws_url
=
wss://check130.abook.bz:10443/v1
#WebSocket debug出力
websocket_debug
=
false
...
...
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