Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
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
sikang
lib_base
Commits
a3d0588c
Commit
a3d0588c
authored
Apr 17, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
ef715f8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
src/main/java/com/common/activity/AgreementPolicyActivity.java
+23
-4
No files found.
src/main/java/com/common/activity/AgreementPolicyActivity.java
View file @
a3d0588c
...
...
@@ -49,6 +49,11 @@ public class AgreementPolicyActivity extends BaseActivity {
new
EasyActivityResult
(
activity
).
startForResult
(
intent
,
requestCode
,
listener
);
}
public
static
void
startForResult
(
FragmentActivity
activity
,
int
requestCode
,
EasyActivityResult
.
OnResultListener
listener
)
{
Intent
intent
=
new
Intent
(
activity
,
AgreementPolicyActivity
.
class
);
new
EasyActivityResult
(
activity
).
startForResult
(
intent
,
requestCode
,
listener
);
}
CheckBox
mCheckBox
;
WebView
webView
;
...
...
@@ -65,21 +70,28 @@ public class AgreementPolicyActivity extends BaseActivity {
@Override
public
void
initView
()
{
agreementType
=
(
Type
)
getIntent
().
getSerializableExtra
(
"agreementType"
);
if
(
getIntent
().
getSerializableExtra
(
"agreementType"
)
!=
null
)
{
agreementType
=
(
Type
)
getIntent
().
getSerializableExtra
(
"agreementType"
);
}
EventBus
.
getDefault
().
register
(
this
);
mCheckBox
=
findViewById
(
R
.
id
.
activity_policy_checkbox
);
webView
=
findViewById
(
R
.
id
.
activity_policy_webview
);
UIHelper
.
bindClickListener
(
getContentView
(),
new
OnEventClickListener
()
{
@Override
public
void
onEventClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
activity_policy_ok_btn
)
{
if
(
mCheckBox
.
isChecked
())
{
if
(
agreementType
==
null
)
{
PreferencesManager
.
get
().
setPolicyStatus
(
true
);
setResult
(
RESULT_OK
);
finish
();
return
;
}
switch
(
agreementType
)
{
case
AGREEMENT_POLICY:
PreferencesManager
.
get
().
setPolicyStatus
(
true
);
AgreementPolicyActivity
.
startForResult
(
AgreementPolicyActivity
.
this
,
Type
.
AGREEMENT_KSP
,
0
,
(
requestCode
,
resultCode
,
data
)
->
{
if
(
resultCode
==
RESULT_OK
)
{
if
(
resultCode
==
RESULT_OK
)
{
setResult
(
Activity
.
RESULT_OK
);
}
finish
();
...
...
@@ -98,7 +110,14 @@ public class AgreementPolicyActivity extends BaseActivity {
}
}
},
R
.
id
.
activity_policy_ok_btn
);
String
policyUrl
=
agreementType
==
Type
.
AGREEMENT_POLICY
?
Gateway
.
getAgreementPolicyUrl
()
:
Gateway
.
getKSPUrl
();
String
policyUrl
;
if
(
agreementType
!=
Type
.
AGREEMENT_KSP
)
{
policyUrl
=
Gateway
.
getAgreementPolicyUrl
();
}
else
{
policyUrl
=
Gateway
.
getKSPUrl
();
}
if
(!
TextUtils
.
isEmpty
(
policyUrl
))
{
webView
.
loadUrl
(
policyUrl
);
}
...
...
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