Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
9680f33b
Commit
9680f33b
authored
Aug 05, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将在线备份排序在回调时执行,使得各处调用保持统一
parent
2a9ff9ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/DeckSquareApiUtil.java
...ymb/ygomobile/ui/cards/deck_square/DeckSquareApiUtil.java
+6
-5
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/MyDeckListAdapter.java
...ymb/ygomobile/ui/cards/deck_square/MyDeckListAdapter.java
+0
-11
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/api_response/MyDeckResponse.java
...ile/ui/cards/deck_square/api_response/MyDeckResponse.java
+10
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/DeckSquareApiUtil.java
View file @
9680f33b
package
cn.garymb.ygomobile.ui.cards.deck_square
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
cards
.
DeckManagerFragment
.
getOriginalData
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
cards
.
DeckManagerFragment
.
originalData
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
cards
.
deck_square
.
DeckSquareFileUtil
.
toDeckItemList
;
...
...
@@ -240,7 +241,7 @@ public class DeckSquareApiUtil {
if
(
deckIdList
==
null
)
{
return
null
;
}
else
{
LogUtil
.
i
(
TAG
,
"requestIdAndPushNewDecks deckIdList"
+
deckIdList
);
LogUtil
.
i
(
TAG
,
"requestIdAndPushNewDecks deckIdList"
+
deckIdList
);
}
return
pushDecks
(
deckDataList
,
loginToken
,
deckIdList
);
...
...
@@ -275,7 +276,7 @@ public class DeckSquareApiUtil {
deckContent
=
DeckSquareFileUtil
.
setDeckId
(
item
.
getDeckPath
(),
loginToken
.
getUserId
(),
item
.
getDeckId
());
}
data
.
setDeckYdk
(
deckContent
);
LogUtil
.
w
(
TAG
,
"syncMyDecks *要上传的* 本地卡组: \n是否删除?: "
+
data
.
isDelete
()
+
"\n卡组分类:"
+
data
.
getDeckType
()
+
"\n卡组名称: "
+
data
.
getDeckName
()+
"\n封面id: "
+
data
.
getDeckCoverCard1
()+
"\n卡组id: "
+
data
.
getDeckId
());
LogUtil
.
w
(
TAG
,
"syncMyDecks *要上传的* 本地卡组: \n是否删除?: "
+
data
.
isDelete
()
+
"\n卡组分类:"
+
data
.
getDeckType
()
+
"\n卡组名称: "
+
data
.
getDeckName
()
+
"\n封面id: "
+
data
.
getDeckCoverCard1
()
+
"\n卡组id: "
+
data
.
getDeckId
());
dataList
.
add
(
data
);
}
return
pushMultiDecks
(
dataList
,
loginToken
);
...
...
@@ -470,7 +471,7 @@ public class DeckSquareApiUtil {
}
// 剩余的在线卡组都是新卡组(云端独有,需要下载)
LogUtil
.
i
(
TAG
,
"看看剩余onlineDecks:"
+
onlineDecks
);
LogUtil
.
i
(
TAG
,
"看看剩余onlineDecks:"
+
onlineDecks
);
for
(
MyOnlineDeckDetail
onlineDeck
:
onlineDecks
)
{
LogUtil
.
d
(
TAG
,
"synchronizeDecks +要下载的 云备份卡组: \n卡组分类:"
+
onlineDeck
.
getDeckType
()
+
"\n卡组名:"
+
onlineDeck
.
getDeckName
()
+
"\n卡组id:"
+
onlineDeck
.
getDeckId
());
// 确保文件名包含.ydk扩展名
...
...
@@ -481,7 +482,7 @@ public class DeckSquareApiUtil {
String
fileFullPath
=
AppsSettings
.
get
().
getDeckDir
()
+
"/"
+
fileName
;
if
(!
onlineDeck
.
getDeckType
().
equals
(
""
))
fileFullPath
=
AppsSettings
.
get
().
getDeckDir
()
+
"/"
+
onlineDeck
.
getDeckType
()+
"/"
+
fileName
;
fileFullPath
=
AppsSettings
.
get
().
getDeckDir
()
+
"/"
+
onlineDeck
.
getDeckType
()
+
"/"
+
fileName
;
// 保存在线卡组到本地
boolean
saved
=
DeckSquareFileUtil
.
saveFileToPath
(
fileFullPath
,
onlineDeck
.
getDeckYdk
(),
onlineDeck
.
getDeckUpdateDate
());
...
...
@@ -500,7 +501,7 @@ public class DeckSquareApiUtil {
LogUtil
.
w
(
TAG
,
"+上传新增的 本地卡组newPushDecks: "
+
newPushDecks
);
if
(!
newPushDecks
.
isEmpty
())
{
PushMultiResponse
result
=
requestIdAndPushNewDecks
(
newPushDecks
,
loginToken
);
LogUtil
.
w
(
TAG
,
"上传结果数:"
+
result
.
getData
());
LogUtil
.
w
(
TAG
,
"上传结果数:"
+
result
.
getData
());
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/MyDeckListAdapter.java
View file @
9680f33b
...
...
@@ -72,17 +72,6 @@ public class MyDeckListAdapter extends BaseQuickAdapter<MyOnlineDeckDetail, Base
LogUtil
.
i
(
TAG
,
"load mycard from server failed:"
+
e
);
}).
done
((
serverDecks
)
->
{
if
(
serverDecks
!=
null
)
{
//将服务端的卡组也放到缓存中
//根据deckType排序,提高观感
serverDecks
.
sort
((
o1
,
o2
)
->
{
String
type1
=
o1
.
getDeckType
();
String
type2
=
o2
.
getDeckType
();
if
(
type1
==
null
&&
type2
==
null
)
return
0
;
if
(
type1
==
null
)
return
1
;
if
(
type2
==
null
)
return
-
1
;
return
type1
.
compareTo
(
type2
);
});
DeckManagerFragment
.
getOriginalData
().
clear
();
//虽然判断originalData是空的才会执行到这里,但还是写上保险
DeckManagerFragment
.
getOriginalData
().
addAll
(
serverDecks
);
// 保存原始数据
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck_square/api_response/MyDeckResponse.java
View file @
9680f33b
...
...
@@ -24,6 +24,16 @@ public class MyDeckResponse {
}
public
List
<
MyOnlineDeckDetail
>
getData
()
{
//根据deckType排序,提高观感
data
.
sort
((
o1
,
o2
)
->
{
String
type1
=
o1
.
getDeckType
();
String
type2
=
o2
.
getDeckType
();
if
(
type1
==
null
&&
type2
==
null
)
return
0
;
if
(
type1
==
null
)
return
1
;
if
(
type2
==
null
)
return
-
1
;
return
type1
.
compareTo
(
type2
);
});
return
data
;
}
...
...
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