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
38338e1d
Commit
38338e1d
authored
Jun 13, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除卡组广场长按显示列表的旧功能
parent
54227641
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
138 deletions
+0
-138
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
...a/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
+0
-9
mobile/src/main/java/cn/garymb/ygomobile/deck_square/SquareDeckDetailDialog.java
.../garymb/ygomobile/deck_square/SquareDeckDetailDialog.java
+0
-129
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
View file @
38338e1d
...
...
@@ -243,15 +243,6 @@ public class DeckSquareFragment extends Fragment {
//设置清空按钮点击清除输入内容
binding
.
btnClearDeckName
.
setOnClickListener
(
view
->
binding
.
etDeckSquareInputDeckName
.
getText
().
clear
());
binding
.
btnClearContributorName
.
setOnClickListener
(
view
->
binding
.
etInputContributorName
.
getText
().
clear
());
deckSquareListAdapter
.
setOnItemLongClickListener
((
adapter
,
view
,
position
)
->
{
OnlineDeckDetail
item
=
(
OnlineDeckDetail
)
adapter
.
getItem
(
position
);
// Show the dialog
SquareDeckDetailDialog
dialog
=
new
SquareDeckDetailDialog
(
getContext
(),
item
);
dialog
.
show
();
return
true
;
});
// Set click listener in your adapter
deckSquareListAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
OnlineDeckDetail
item
=
(
OnlineDeckDetail
)
adapter
.
getItem
(
position
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/SquareDeckDetailDialog.java
deleted
100644 → 0
View file @
54227641
package
cn.garymb.ygomobile.deck_square
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.os.Bundle
;
import
android.view.Window
;
import
android.widget.Button
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.util.List
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.deck_square.api_response.OnlineDeckDetail
;
import
cn.garymb.ygomobile.deck_square.api_response.BasicResponse
;
import
cn.garymb.ygomobile.deck_square.api_response.MyOnlineDeckDetail
;
import
cn.garymb.ygomobile.deck_square.api_response.DownloadDeckResponse
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.adapters.DeckPreviewListAdapter
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.utils.LogUtil
;
import
cn.garymb.ygomobile.utils.SharedPreferenceUtil
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
import
ocgcore.data.Card
;
public
class
SquareDeckDetailDialog
extends
Dialog
{
private
static
final
String
TAG
=
DeckSquareListAdapter
.
class
.
getSimpleName
();
DeckPreviewListAdapter
mListAdapter
;
private
RecyclerView
mListView
;
private
MyOnlineDeckDetail
mMyOnlineDeckDetail
=
null
;
private
OnlineDeckDetail
mItem
=
null
;
public
SquareDeckDetailDialog
(
Context
context
,
OnlineDeckDetail
item
)
{
super
(
context
);
mItem
=
item
;
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
setContentView
(
R
.
layout
.
dialog_square_deck_detail
);
//Button btnDownload = findViewById(R.id.dialog_square_deck_btn_download);
Button
btnLike
=
findViewById
(
R
.
id
.
btnLike
);
previewDeckCard
();
mListAdapter
=
new
DeckPreviewListAdapter
(
R
.
layout
.
item_square_deck_card_preview
);
mListView
=
findViewById
(
R
.
id
.
dialog_square_deck_detail_list
);
LinearLayoutManager
linearLayoutManager
=
new
LinearLayoutManager
(
getContext
());
mListView
.
setLayoutManager
(
linearLayoutManager
);
mListView
.
setAdapter
(
mListAdapter
);
//下载卡组广场的卡组
// btnDownload.setOnClickListener(v -> {
// if (mMyOnlineDeckDetail != null) {
// //todo 删除云上的卡组
// String path = AppsSettings.get().getDeckDir();
// boolean result = DeckSquareFileUtil.saveFileToPath(path, mMyOnlineDeckDetail.getDeckName() + ".ydk", mMyOnlineDeckDetail.getDeckYdk());
// if (result) {
//
// YGOUtil.showTextToast("Download deck success!");
// } else {
//
// YGOUtil.showTextToast("Download deck fail!");
// }
// }
// });
//给卡组点赞
btnLike
.
setOnClickListener
(
v
->
{
VUiKit
.
defer
().
when
(()
->
{
BasicResponse
result
=
DeckSquareApiUtil
.
likeDeck
(
mItem
.
getDeckId
());
return
result
;
}).
fail
(
e
->
{
LogUtil
.
i
(
TAG
,
"Like deck fail"
+
e
.
getMessage
());
}).
done
(
data
->
{
if
(
data
.
getMessage
().
equals
(
"true"
))
{
YGOUtil
.
showTextToast
(
"Like deck success!"
);
}
else
{
YGOUtil
.
showTextToast
(
data
.
getMessage
());
}
});
});
}
private
void
previewDeckCard
()
{
Integer
userId
=
SharedPreferenceUtil
.
getServerUserId
();
if
(
userId
==
null
)
{
YGOUtil
.
showTextToast
(
"Please login first!"
);
return
;
}
VUiKit
.
defer
().
when
(()
->
{
DownloadDeckResponse
response
=
DeckSquareApiUtil
.
getDeckById
(
mItem
.
getDeckId
());
if
(
response
!=
null
)
{
return
response
.
getData
();
}
else
{
return
null
;
}
}).
fail
((
e
)
->
{
LogUtil
.
i
(
TAG
,
"square deck detail fail"
+
e
.
getMessage
());
}).
done
((
deckData
)
->
{
if
(
deckData
!=
null
)
{
mMyOnlineDeckDetail
=
deckData
;
LogUtil
.
i
(
TAG
,
"square deck detail done"
);
List
<
Card
>
cardList
=
DeckSquareFileUtil
.
convertTempDeckYdk
(
deckData
.
getDeckYdk
());
mListAdapter
.
updateData
(
cardList
);
}
});
}
}
\ No newline at end of file
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