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
baef4813
Commit
baef4813
authored
Jun 05, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除不使用按钮,添加注册按钮
parent
ae0078cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
44 deletions
+21
-44
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
...arymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
+12
-31
mobile/src/main/res/layout/fragment_deck_square_my_deck.xml
mobile/src/main/res/layout/fragment_deck_square_my_deck.xml
+9
-13
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareMyDeckFragment.java
View file @
baef4813
package
cn.garymb.ygomobile.deck_square
;
package
cn.garymb.ygomobile.deck_square
;
import
android.content.Context
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -55,16 +54,17 @@ public class DeckSquareMyDeckFragment extends Fragment {
...
@@ -55,16 +54,17 @@ public class DeckSquareMyDeckFragment extends Fragment {
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
GONE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
GONE
);
}
}
binding
.
mcLoginBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
etUsername
=
binding
.
etUsername
;
@Override
etPassword
=
binding
.
etPassword
;
public
void
onClick
(
View
v
)
{
btnLogin
=
binding
.
btnLogin
;
btnLogin
.
setOnClickListener
(
v
->
attemptLogin
());
if
(!
DeckSquareApiUtil
.
needLogin
())
{
progressBar
=
binding
.
progressBar
;
return
;
deckListAdapter
=
new
MyDeckListAdapter
(
R
.
layout
.
item_my_deck
);
}
GridLayoutManager
linearLayoutManager
=
new
GridLayoutManager
(
getContext
(),
3
);
binding
.
listMyDeckInfo
.
setLayoutManager
(
linearLayoutManager
);
binding
.
listMyDeckInfo
.
setAdapter
(
deckListAdapter
);
deckListAdapter
.
loadData
();
}
});
//其实仅仅是清除掉本机的token
//其实仅仅是清除掉本机的token
binding
.
mcLogoutBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
binding
.
mcLogoutBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -72,21 +72,9 @@ public class DeckSquareMyDeckFragment extends Fragment {
...
@@ -72,21 +72,9 @@ public class DeckSquareMyDeckFragment extends Fragment {
SharedPreferenceUtil
.
deleteServerToken
();
SharedPreferenceUtil
.
deleteServerToken
();
binding
.
llMainUi
.
setVisibility
(
View
.
GONE
);
binding
.
llMainUi
.
setVisibility
(
View
.
GONE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
VISIBLE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
VISIBLE
);
refreshBtn
();
}
}
});
});
etUsername
=
binding
.
etUsername
;
etPassword
=
binding
.
etPassword
;
btnLogin
=
binding
.
btnLogin
;
btnLogin
.
setOnClickListener
(
v
->
attemptLogin
());
progressBar
=
binding
.
progressBar
;
refreshBtn
();
deckListAdapter
=
new
MyDeckListAdapter
(
R
.
layout
.
item_my_deck
);
GridLayoutManager
linearLayoutManager
=
new
GridLayoutManager
(
getContext
(),
3
);
binding
.
listMyDeckInfo
.
setLayoutManager
(
linearLayoutManager
);
binding
.
listMyDeckInfo
.
setAdapter
(
deckListAdapter
);
deckListAdapter
.
loadData
();
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -159,6 +147,8 @@ public class DeckSquareMyDeckFragment extends Fragment {
...
@@ -159,6 +147,8 @@ public class DeckSquareMyDeckFragment extends Fragment {
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
binding
.
llMainUi
.
setVisibility
(
View
.
VISIBLE
);
deckListAdapter
.
loadData
();
deckListAdapter
.
loadData
();
binding
.
llDialogLogin
.
setVisibility
(
View
.
GONE
);
binding
.
llDialogLogin
.
setVisibility
(
View
.
GONE
);
progressBar
.
setVisibility
(
View
.
GONE
);
btnLogin
.
setEnabled
(
true
);
YGOUtil
.
showTextToast
(
"Login success!"
);
YGOUtil
.
showTextToast
(
"Login success!"
);
}
else
{
}
else
{
LogUtil
.
i
(
TAG
,
"login fail2"
);
LogUtil
.
i
(
TAG
,
"login fail2"
);
...
@@ -167,13 +157,4 @@ public class DeckSquareMyDeckFragment extends Fragment {
...
@@ -167,13 +157,4 @@ public class DeckSquareMyDeckFragment extends Fragment {
});
});
}
}
public
void
refreshBtn
()
{
if
(
DeckSquareApiUtil
.
getLoginData
()
!=
null
)
{
binding
.
mcLoginBtn
.
setText
(
"已登录"
);
}
else
{
binding
.
mcLoginBtn
.
setText
(
"登录"
);
}
}
}
}
mobile/src/main/res/layout/fragment_deck_square_my_deck.xml
View file @
baef4813
...
@@ -44,12 +44,13 @@
...
@@ -44,12 +44,13 @@
android:weightSum=
"2"
>
android:weightSum=
"2"
>
<Button
<Button
android:id=
"@+id/btn_
cancel
"
android:id=
"@+id/btn_
register
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"4dp"
android:layout_marginEnd=
"4dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"Cancel"
/>
android:background=
"@drawable/ic_radius_bg"
android:text=
"Register"
/>
<Button
<Button
android:id=
"@+id/btn_login"
android:id=
"@+id/btn_login"
...
@@ -57,7 +58,7 @@
...
@@ -57,7 +58,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"4dp"
android:layout_marginStart=
"4dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background
Tint=
"@color/colorPrimary
"
android:background
=
"@drawable/ic_radius_bg
"
android:text=
"Login"
/>
android:text=
"Login"
/>
</LinearLayout>
</LinearLayout>
...
@@ -112,25 +113,20 @@
...
@@ -112,25 +113,20 @@
<Button
<Button
android:id=
"@+id/mc_logout_btn"
android:id=
"@+id/mc_logout_btn"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:background=
"@drawable/ic_radius_bg"
android:layout_marginEnd=
"4dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:text=
"注销"
/>
android:text=
"注销"
/>
<Button
android:id=
"@+id/mc_login_btn"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"登录"
/>
<ImageButton
<ImageButton
android:id=
"@+id/refresh_data"
android:id=
"@+id/refresh_data"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_cont
ent"
android:layout_height=
"
match_par
ent"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:layout_margin=
"5dp"
android:background=
"@drawable/ic_radius_bg"
android:background=
"@drawable/ic_radius_bg"
android:layout_marginEnd=
"4dp"
android:src=
"@drawable/ic_refresh"
/>
android:src=
"@drawable/ic_refresh"
/>
</LinearLayout>
</LinearLayout>
...
...
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