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
d926d9a1
Commit
d926d9a1
authored
Sep 25, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement agrement to terms dialog
parent
6d13a6be
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
5 deletions
+119
-5
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/ServiceOption.java
+3
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
+4
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
+2
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
+89
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/dialog/ABookAlertDialog.java
+17
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
+2
-2
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginPasswordChangeActivity.java
+2
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/ServiceOption.java
View file @
d926d9a1
...
...
@@ -180,5 +180,7 @@ public interface ServiceOption {
* 利用しない:N(通常)、利用する:Y
*/
int
AlcoholCheckerHw
=
202
;
int
AgrementToTerms
=
203
;
}
}
\ No newline at end of file
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
View file @
d926d9a1
...
...
@@ -375,6 +375,10 @@ public class ABVDataCache {
}
return
false
;
}
public
boolean
isAgrementToTerms
()
{
return
isServiceOptionEnable
(
ServiceOptionId
.
AgrementToTerms
);
}
}
public
void
setDiffMinFromUTC
(
String
timeZone
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/AgreementToTermsLogic.java
View file @
d926d9a1
...
...
@@ -11,12 +11,13 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.RequireTermsParameters;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
public
class
AgreementToTermsLogic
extends
AbstractLogic
{
private
static
final
String
TAG
=
"AgreementToTermsLogic"
;
public
boolean
isTermsEnabled
()
{
return
false
;
return
ABVDataCache
.
getInstance
().
serviceOption
.
isAgrementToTerms
()
;
}
public
RequireTermsJSON
requireTerms
()
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
View file @
d926d9a1
...
...
@@ -30,6 +30,8 @@ import java.util.UUID;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreeTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RequireTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AppLastVersionParameters
;
import
jp.agentec.abook.abv.bl.acms.type.AcmsApis
;
import
jp.agentec.abook.abv.bl.acms.type.AuthLevel
;
...
...
@@ -45,6 +47,7 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.AgreementToTermsLogic
;
import
jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic
;
import
jp.agentec.abook.abv.cl.environment.NetworkAdapter
;
import
jp.agentec.abook.abv.cl.push.FcmManager
;
...
...
@@ -101,6 +104,92 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
Intent
intent
=
new
Intent
();
getApplicationContext
().
sendBroadcast
(
intent
);
}
protected
void
loginDidFinish
(
String
loginId
)
{
checkTerms
(
loginId
);
}
protected
void
checkTerms
(
final
String
loginId
)
{
AgreementToTermsLogic
termsLogic
=
AbstractLogic
.
getLogic
(
AgreementToTermsLogic
.
class
);
if
(!
termsLogic
.
isTermsEnabled
())
{
checkTermsDidFinish
(
loginId
);
}
requireTerms
(
loginId
);
}
private
void
requireTerms
(
final
String
loginId
)
{
showProgressPopup
();
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
AgreementToTermsLogic
termsLogic
=
AbstractLogic
.
getLogic
(
AgreementToTermsLogic
.
class
);
final
RequireTermsJSON
json
=
termsLogic
.
requireTerms
();
if
(
json
!=
null
&&
json
.
termsId
>
0
&&
json
.
termsVersion
!=
null
)
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
closeProgressPopup
();
showTerms
(
json
,
loginId
);
}
});
return
;
}
}
catch
(
Exception
e
)
{
ABVToastUtil
.
showMakeText
(
mContext
,
e
.
getMessage
(),
Toast
.
LENGTH_SHORT
);
}
closeProgressPopup
();
checkTermsDidFinish
(
loginId
);
}
});
}
private
void
showTerms
(
final
RequireTermsJSON
json
,
final
String
loginId
)
{
Logger
.
d
(
TAG
,
"showTerms:%@"
,
json
.
toString
());
ABookAlertDialog
messageDialog
=
AlertDialogUtil
.
createAlertDialog
(
mContext
,
R
.
string
.
app_name
);
messageDialog
.
setTitle
(
json
.
termsVersion
);
messageDialog
.
setMessage
(
json
.
agreement
);
messageDialog
.
setPositiveButton
(
R
.
string
.
confirm
,
new
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
agreeTerms
(
json
,
loginId
);
}
});
messageDialog
.
setCancelable
(
false
);
messageDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
new
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
}
});
messageDialog
.
show
();
messageDialog
.
setMessageViewScrollable
(
true
);
}
private
void
agreeTerms
(
final
RequireTermsJSON
termsJson
,
final
String
loginId
)
{
showProgressPopup
();
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
AgreementToTermsLogic
termsLogic
=
AbstractLogic
.
getLogic
(
AgreementToTermsLogic
.
class
);
try
{
AgreeTermsJSON
json
=
termsLogic
.
agreeTerms
(
termsJson
.
termsId
,
termsJson
.
termsVersion
);
if
(
json
!=
null
&&
json
.
httpStatus
==
200
)
{
closeProgressPopup
();
checkTermsDidFinish
(
loginId
);
return
;
}
}
catch
(
Exception
e
)
{
ABVToastUtil
.
showMakeText
(
mContext
,
e
.
getMessage
(),
Toast
.
LENGTH_SHORT
);
}
closeProgressPopup
();
}
});
}
private
void
checkTermsDidFinish
(
String
loginId
)
{
showMainActivity
(
loginId
);
}
// ログインなしの場合専用
protected
void
noAuthenticatedLogin
(
final
boolean
isGuestLogin
,
final
String
urlPath
)
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/dialog/ABookAlertDialog.java
View file @
d926d9a1
...
...
@@ -5,6 +5,7 @@ import android.app.AlertDialog;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.res.Resources
;
import
android.text.method.ScrollingMovementMethod
;
import
android.util.DisplayMetrics
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -77,4 +78,20 @@ public class ABookAlertDialog extends AlertDialog {
setView
(
listView
);
listView
.
setOnItemClickListener
(
l
);
}
public
void
setMessageViewScrollable
(
boolean
enabled
)
{
if
(
messageView
==
null
)
{
return
;
}
TextView
textView
=
(
TextView
)
messageView
.
findViewById
(
R
.
id
.
main_text
);
if
(
textView
==
null
)
{
return
;
}
if
(
enabled
)
{
textView
.
setVerticalScrollBarEnabled
(
true
);
textView
.
setMovementMethod
(
new
ScrollingMovementMethod
());
}
else
{
//default none scroll
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
View file @
d926d9a1
...
...
@@ -630,7 +630,7 @@ public class LoginActivity extends ABVLoginActivity {
if
(
changePasswordType
==
RequirePasswordChangeType
.
NONE
)
{
// パスワード変更が必要ない場合、メイン画面表示
showMainActivity
(
mLoginId
);
loginDidFinish
(
mLoginId
);
}
else
{
// パスワード変更が必要な場合、アラート表示
showChangePasswordDialog
(
changePasswordType
);
...
...
@@ -670,7 +670,7 @@ public class LoginActivity extends ABVLoginActivity {
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
if
(
rpccType
==
RequirePasswordChangeType
.
NEWLOGIN_REMINDER
||
rpccType
==
RequirePasswordChangeType
.
REMINDER
)
{
// 催促の場合、キャンセルが押されたらメイン画面表示
showMainActivity
(
mLoginId
);
loginDidFinish
(
mLoginId
);
}
}
});
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginPasswordChangeActivity.java
View file @
d926d9a1
...
...
@@ -85,7 +85,7 @@ public class LoginPasswordChangeActivity extends ABVNoAuthenticatedActivity {
public
void
onClick
(
View
v
)
{
if
(
mType
==
1
||
mType
==
2
)
{
// 催促
showMainActivity
(
mLoginId
);
loginDidFinish
(
mLoginId
);
finish
();
}
else
{
finishActivity
();
...
...
@@ -176,7 +176,7 @@ public class LoginPasswordChangeActivity extends ABVNoAuthenticatedActivity {
ABVToastUtil
.
showMakeText
(
LoginPasswordChangeActivity
.
this
,
getString
(
R
.
string
.
change_password_ok
),
Toast
.
LENGTH_LONG
);
showMainActivity
(
mLoginId
);
loginDidFinish
(
mLoginId
);
finish
();
}
catch
(
NetworkDisconnectedException
e
)
{
Logger
.
e
(
"NetworkDisconnectedException"
,
e
);
...
...
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