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
892fec01
Commit
892fec01
authored
May 19, 2025
by
wangfugui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复删除我的在线卡组功能、修复卡组广场刷新功能
parent
7afcada0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
37 deletions
+45
-37
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
...a/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
+6
-1
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareListAdapter.java
...n/garymb/ygomobile/deck_square/DeckSquareListAdapter.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckDetailDialog.java
...a/cn/garymb/ygomobile/deck_square/MyDeckDetailDialog.java
+9
-5
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
...va/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
+20
-27
mobile/src/main/res/layout/dialog_square_my_deck_detail.xml
mobile/src/main/res/layout/dialog_square_my_deck_detail.xml
+3
-3
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+3
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+3
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
View file @
892fec01
...
...
@@ -42,7 +42,12 @@ public class DeckSquareFragment extends Fragment {
binding
.
listDeckInfo
.
setAdapter
(
deckSquareListAdapter
);
deckSquareListAdapter
.
loadData
();
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
deckSquareListAdapter
.
loadData
();
}
});
deckSquareListAdapter
.
setOnItemLongClickListener
((
adapter
,
view
,
position
)
->
{
OnlineDeckDetail
item
=
(
OnlineDeckDetail
)
adapter
.
getItem
(
position
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareListAdapter.java
View file @
892fec01
...
...
@@ -29,7 +29,7 @@ public class DeckSquareListAdapter extends BaseQuickAdapter<OnlineDeckDetail, Ba
}
public
void
loadData
()
{
final
DialogPlus
dialog_read_ex
=
DialogPlus
.
show
(
getContext
(),
null
,
getContext
().
getString
(
R
.
string
.
fetch_
ex_card
));
final
DialogPlus
dialog_read_ex
=
DialogPlus
.
show
(
getContext
(),
null
,
getContext
().
getString
(
R
.
string
.
fetch_
online_deck
));
VUiKit
.
defer
().
when
(()
->
{
SquareDeckResponse
result
=
DeckSquareApiUtil
.
getSquareDecks
();
if
(
result
==
null
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckDetailDialog.java
View file @
892fec01
...
...
@@ -50,19 +50,19 @@ public class MyDeckDetailDialog extends Dialog {
Button
deleteMyOnlineDeckBtn
=
findViewById
(
R
.
id
.
delete_my_online_deck_btn
);
Button
btnPush
=
findViewById
(
R
.
id
.
dialog_my_deck_btn_push
);
LinearLayout
d
ownloadLayout
=
findViewById
(
R
.
id
.
server_download_layout
);
LinearLayout
d
eleteMyDeck
=
findViewById
(
R
.
id
.
delete_my_deck
);
LinearLayout
uploadLayout
=
findViewById
(
R
.
id
.
server_upload_layout
);
if
(
mItem
.
getDeckSouce
()
==
0
)
{
//来自本地
d
ownloadLayout
.
setVisibility
(
View
.
GONE
);
d
eleteMyDeck
.
setVisibility
(
View
.
GONE
);
uploadLayout
.
setVisibility
(
View
.
VISIBLE
);
//btnDownload.setBackground(R.id.ic);
}
else
if
(
mItem
.
getDeckSouce
()
==
1
)
{
//来自服务器
d
ownloadLayout
.
setVisibility
(
View
.
VISIBLE
);
d
eleteMyDeck
.
setVisibility
(
View
.
VISIBLE
);
uploadLayout
.
setVisibility
(
View
.
GONE
);
previewDeckCard
();
}
else
if
(
mItem
.
getDeckSouce
()
==
2
)
{
//本地、服务器均存在
d
ownloadLayout
.
setVisibility
(
View
.
VISIBLE
);
d
eleteMyDeck
.
setVisibility
(
View
.
VISIBLE
);
uploadLayout
.
setVisibility
(
View
.
VISIBLE
);
previewDeckCard
();
}
...
...
@@ -118,7 +118,11 @@ public class MyDeckDetailDialog extends Dialog {
LogUtil
.
i
(
TAG
,
"square deck detail fail"
+
e
.
getMessage
());
}).
done
(
data
->
{
if
(
data
.
isData
())
{
YGOUtil
.
showTextToast
(
"delete success!"
);
//服务器的api有问题:获取指定用户的卡组列表(无已删卡组)
//删除成功后,通过http://rarnu.xyz:38383/api/mdpro3/sync/795610/nodel接口查询用户卡组时
//要等待2~3秒api响应内容才会对应更新
YGOUtil
.
showTextToast
(
"删除成功,3秒后服务器将完成同步"
);
dismiss
();
}
else
{
YGOUtil
.
showTextToast
(
"delete fail "
+
data
.
getMessage
());
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
View file @
892fec01
...
...
@@ -15,9 +15,9 @@ import cn.garymb.ygomobile.deck_square.api_response.MyDeckResponse;
import
cn.garymb.ygomobile.deck_square.api_response.MyOnlineDeckDetail
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.utils.LogUtil
;
import
cn.garymb.ygomobile.utils.SharedPreferenceUtil
;
//提供“我的”卡组数据,打开后先从sharePreference查询,没有则从服务器查询,然后缓存到sharePreference
public
class
MyDeckListAdapter
extends
BaseQuickAdapter
<
MyDeckItem
,
BaseViewHolder
>
{
...
...
@@ -31,13 +31,13 @@ public class MyDeckListAdapter extends BaseQuickAdapter<MyDeckItem, BaseViewHold
}
public
void
loadData
()
{
List
<
MyDeckItem
>
local
Decks
=
new
ArrayList
<>();
List
<
MyDeckItem
>
myOnlie
Decks
=
new
ArrayList
<>();
// final DialogPlus dialog_read_ex = DialogPlus.show(getContext(), null, getContext().getString(R.string.fetch_ex_card));
final
DialogPlus
dialog_read_ex
=
DialogPlus
.
show
(
getContext
(),
null
,
getContext
().
getString
(
R
.
string
.
fetch_online_deck
));
LoginToken
loginToken
=
DeckSquareApiUtil
.
getLoginData
();
if
(
loginToken
==
null
)
{
if
(
loginToken
==
null
)
{
return
;
}
...
...
@@ -53,21 +53,16 @@ public class MyDeckListAdapter extends BaseQuickAdapter<MyDeckItem, BaseViewHold
}).
fail
((
e
)
->
{
Log
.
e
(
TAG
,
e
+
""
);
//
if (dialog_read_ex.isShowing()) {//关闭异常
//
try {
//
dialog_read_ex.dismiss();
//
} catch (Exception ex) {
//
//
}
//
}
if
(
dialog_read_ex
.
isShowing
())
{
//关闭异常
try
{
dialog_read_ex
.
dismiss
();
}
catch
(
Exception
ex
)
{
}
}
LogUtil
.
i
(
TAG
,
"load mycard from server fail"
);
//只展示本地卡组
getData
().
clear
();
addData
(
localDecks
);
notifyDataSetChanged
();
}).
done
((
serverDecks
)
->
{
// List<MyDeckItem> serverItems = new ArrayList<>();
}).
done
((
serverDecks
)
->
{
if
(
serverDecks
!=
null
)
{
//将服务端的卡组也放到LocalDecks中
for
(
MyOnlineDeckDetail
detail
:
serverDecks
)
{
MyDeckItem
item
=
new
MyDeckItem
();
...
...
@@ -76,23 +71,21 @@ public class MyDeckListAdapter extends BaseQuickAdapter<MyDeckItem, BaseViewHold
item
.
setDeckId
(
detail
.
getDeckId
());
item
.
setUserId
(
detail
.
getUserId
());
item
.
setUpdateDate
(
detail
.
getDeckUpdateDate
());
local
Decks
.
add
(
item
);
myOnlie
Decks
.
add
(
item
);
}
}
LogUtil
.
i
(
TAG
,
"load mycard from server done"
);
//展示本地卡组和服务器上的卡组
getData
().
clear
();
addData
(
local
Decks
);
addData
(
myOnlie
Decks
);
notifyDataSetChanged
();
//
if (dialog_read_ex.isShowing()) {
//
try {
//
dialog_read_ex.dismiss();
//
} catch (Exception ex) {
//
}
//
}
if
(
dialog_read_ex
.
isShowing
())
{
try
{
dialog_read_ex
.
dismiss
();
}
catch
(
Exception
ex
)
{
}
}
});
}
...
...
mobile/src/main/res/layout/dialog_square_my_deck_detail.xml
View file @
892fec01
...
...
@@ -6,7 +6,7 @@
android:padding=
"16dp"
>
<LinearLayout
android:id=
"@+id/
server_download_layout
"
android:id=
"@+id/
delete_my_deck
"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
...
...
@@ -14,13 +14,13 @@
<ImageView
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:src=
"@drawable/
ic_server_download
"
/>
android:src=
"@drawable/
delete
"
/>
<Button
android:id=
"@+id/delete_my_online_deck_btn"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/
Download
"
/>
android:text=
"@string/
delete
"
/>
</LinearLayout>
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
892fec01
...
...
@@ -38,6 +38,9 @@
<string
name=
"quit_tip"
>
退出游戏?
</string>
<string
name=
"back_tip"
>
请再按一次返回键退出
</string>
<string
name=
"string_help_text"
>
当前应用缺少必要权限。\n请点击 设置-权限 打开所需权限。
</string>
<string
name=
"fetch_online_deck"
>
通过网络获取在线卡组
</string>
<string
name=
"fetch_ex_card"
>
通过网络获取先行卡
</string>
<string
name=
"ex_card_list_title"
>
超先行服☆专用☆
</string>
<string
name=
"ex_card_log_title"
>
更新日志
</string>
...
...
mobile/src/main/res/values/strings.xml
View file @
892fec01
...
...
@@ -45,6 +45,9 @@
<string
name=
"back_tip"
>
Press back key again to exit.
</string>
<string
name=
"string_help_text"
>
The current application lacks the necessary permissions. \n
please click Settings - permissions - open the required permissions.
</string>
<string
name=
"fetch_online_deck"
>
Fetching online decks via web
</string>
<string
name=
"fetch_ex_card"
>
Fetching pre-cards via web
</string>
<string
name=
"ex_card_list_title"
>
Card List
</string>
<string
name=
"ex_card_log_title"
>
update log
</string>
...
...
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