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