Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
ae0078cf
Commit
ae0078cf
authored
Jun 05, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注销后重新显示登录界面
parent
5e5eafad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
48 deletions
+3
-48
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
...arymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
+3
-48
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
View file @
ae0078cf
...
...
@@ -29,7 +29,7 @@ import cn.garymb.ygomobile.utils.YGOUtil;
//打开页面后,先扫描本地的卡组,读取其是否包含deckId,是的话代表平台上可能有
//之后读取平台上的卡组,与本地卡组列表做比较。
public
class
DeckSquareMyDeckFragment
extends
Fragment
implements
PrivacyDialogFragment
.
PrivacyAgreementListener
{
public
class
DeckSquareMyDeckFragment
extends
Fragment
{
private
static
final
String
TAG
=
DeckSquareListAdapter
.
class
.
getSimpleName
();
private
FragmentDeckSquareMyDeckBinding
binding
;
private
MyDeckListAdapter
deckListAdapter
;
...
...
@@ -39,8 +39,6 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
private
ProgressBar
progressBar
;
private
EditText
etUsername
,
etPassword
;
private
Button
btnLogin
;
boolean
privacAgree
=
false
;
LoginDialog
loginDialog
=
null
;
public
DeckSquareMyDeckFragment
(
YGODeckDialogUtil
.
OnDeckMenuListener
onDeckMenuListener
,
YGODeckDialogUtil
.
OnDeckDialogListener
mDialogListener
)
{
this
.
onDeckMenuListener
=
onDeckMenuListener
;
...
...
@@ -65,30 +63,6 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
return
;
}
if
(
privacAgree
)
{
//如果不同意隐私协议,log提示用户,
loginDialog
=
new
LoginDialog
(
getContext
(),
new
LoginDialog
.
LoginListener
()
{
@Override
public
void
notifyResult
(
boolean
success
,
LoginResponse
response
)
{
// Handle login logic
if
(
success
)
{
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
LogUtil
.
i
(
TAG
,
"login success"
+
SharedPreferenceUtil
.
getServerToken
());
refreshBtn
();
//response.token;
}
else
{
YGOUtil
.
showTextToast
(
"登录失败:"
);
}
}
});
loginDialog
.
show
();
}
else
{
YGOUtil
.
showTextToast
(
"登录内容需要用户同意协议"
);
showPrivacyDialog
();
}
}
});
//其实仅仅是清除掉本机的token
...
...
@@ -97,6 +71,7 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
public
void
onClick
(
View
v
)
{
SharedPreferenceUtil
.
deleteServerToken
();
binding
.
llMainUi
.
setVisibility
(
View
.
GONE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
VISIBLE
);
refreshBtn
();
}
...
...
@@ -113,7 +88,6 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
binding
.
listMyDeckInfo
.
setAdapter
(
deckListAdapter
);
deckListAdapter
.
loadData
();
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
...
...
@@ -133,12 +107,10 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
//点击“我的卡组”中的某个卡组后,弹出dialog,dialog根据卡组的同步情况自动显示对应的下载/上传按钮
deckListAdapter
.
setOnItemClickListener
(
(
adapter
,
view
,
position
)
->
{
MyDeckItem
item
=
(
MyDeckItem
)
adapter
.
getItem
(
position
);
mDialogListener
.
onDismiss
();
DeckFile
deckFile
=
new
DeckFile
(
item
.
getDeckId
(),
DeckType
.
ServerType
.
MY_SQUARE
);
onDeckMenuListener
.
onDeckSelect
(
deckFile
);
}
);
...
...
@@ -171,8 +143,6 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
VUiKit
.
defer
().
when
(()
->
{
LogUtil
.
d
(
TAG
,
"start fetch"
);
LoginResponse
result
=
DeckSquareApiUtil
.
login
(
username
,
password
);
SharedPreferenceUtil
.
setServerToken
(
result
.
token
);
SharedPreferenceUtil
.
setServerUserId
(
result
.
user
.
id
);
...
...
@@ -187,9 +157,9 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
if
(
result
!=
null
)
{
LogUtil
.
i
(
TAG
,
"login done"
);
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
deckListAdapter
.
loadData
();
binding
.
llDialogLogin
.
setVisibility
(
View
.
GONE
);
YGOUtil
.
showTextToast
(
"Login success!"
);
}
else
{
LogUtil
.
i
(
TAG
,
"login fail2"
);
}
...
...
@@ -206,19 +176,4 @@ public class DeckSquareMyDeckFragment extends Fragment implements PrivacyDialogF
}
}
private
void
showPrivacyDialog
()
{
PrivacyDialogFragment
dialog
=
new
PrivacyDialogFragment
();
dialog
.
setPrivacyAgreementListener
(
this
);
dialog
.
show
(
getChildFragmentManager
(),
"PrivacyDialog"
);
}
@Override
public
void
onAgree
()
{
privacAgree
=
true
;
}
@Override
public
void
onDisagree
()
{
privacAgree
=
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