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
2ca6e12c
Commit
2ca6e12c
authored
Jun 08, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化翻页按钮可用逻辑
parent
aafbf4f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
...a/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
+28
-20
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
View file @
2ca6e12c
...
...
@@ -45,6 +45,7 @@ public class DeckSquareFragment extends Fragment {
binding
.
listDeckInfo
.
setAdapter
(
deckSquareListAdapter
);
deckSquareListAdapter
.
loadData
();
binding
.
etGoToPage
.
setText
(
"1"
);
//查询卡组名称
binding
.
etDeckSquareInputDeckName
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
Editable
contributerName
=
binding
.
etInputContributerName
.
getText
();
...
...
@@ -52,13 +53,6 @@ public class DeckSquareFragment extends Fragment {
keyWord
=
v
.
getText
().
toString
();
binding
.
etGoToPage
.
setText
(
"1"
);
binding
.
etGoToPage
.
setEnabled
(
false
);
// 底部按钮不可用状态
binding
.
formerPageBtn
.
setEnabled
(
false
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
nextPageBtn
.
setEnabled
(
false
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
refreshData
.
setEnabled
(
false
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
deckSquareListAdapter
.
loadData
(
1
,
1000
,
keyWord
,
true
,
false
,
""
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
return
true
;
...
...
@@ -82,33 +76,38 @@ public class DeckSquareFragment extends Fragment {
binding
.
btnClearDeckName
.
setVisibility
(
View
.
GONE
);
// 恢复底部按钮可用状态
binding
.
formerPageBtn
.
setEnabled
(
true
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
formerPageBtn
.
clearColorFilter
(
);
binding
.
nextPageBtn
.
setEnabled
(
true
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
nextPageBtn
.
clearColorFilter
(
);
binding
.
refreshData
.
setEnabled
(
true
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
refreshData
.
clearColorFilter
(
);
// 重置页码为1
binding
.
etGoToPage
.
setText
(
"1"
);
binding
.
etGoToPage
.
setEnabled
(
true
);
deckSquareListAdapter
.
loadData
();
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
else
{
// 底部按钮不可用状态
binding
.
formerPageBtn
.
setEnabled
(
false
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
nextPageBtn
.
setEnabled
(
false
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
refreshData
.
setEnabled
(
false
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
}
}
});
//添加贡献者查询
binding
.
etInputContributerName
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
//清除卡组名称输入的内容
Editable
deckName
=
binding
.
etDeckSquareInputDeckName
.
getText
();
if
(
deckName
!=
null
)
deckName
.
clear
();
//获取输入内容
contributer
=
v
.
getText
().
toString
();
binding
.
etGoToPage
.
setText
(
"1"
);
binding
.
etGoToPage
.
setEnabled
(
false
);
// 底部按钮不可用状态
binding
.
formerPageBtn
.
setEnabled
(
false
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
nextPageBtn
.
setEnabled
(
false
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
refreshData
.
setEnabled
(
false
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
deckSquareListAdapter
.
loadData
(
1
,
1000
,
null
,
true
,
false
,
contributer
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
return
true
;
...
...
@@ -132,16 +131,25 @@ public class DeckSquareFragment extends Fragment {
binding
.
btnClearDeckName
.
setVisibility
(
View
.
GONE
);
// 恢复底部按钮可用状态
binding
.
formerPageBtn
.
setEnabled
(
true
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
formerPageBtn
.
clearColorFilter
(
);
binding
.
nextPageBtn
.
setEnabled
(
true
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
nextPageBtn
.
clearColorFilter
(
);
binding
.
refreshData
.
setEnabled
(
true
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
selector_text_color_white_gold
);
binding
.
refreshData
.
clearColorFilter
(
);
// 重置页码为1
binding
.
etGoToPage
.
setText
(
"1"
);
binding
.
etGoToPage
.
setEnabled
(
true
);
deckSquareListAdapter
.
loadData
();
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
else
{
// 底部按钮不可用状态
binding
.
formerPageBtn
.
setEnabled
(
false
);
binding
.
formerPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
nextPageBtn
.
setEnabled
(
false
);
binding
.
nextPageBtn
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
binding
.
refreshData
.
setEnabled
(
false
);
binding
.
refreshData
.
setColorFilter
(
R
.
color
.
navigator_dir_text_color
);
}
}
});
...
...
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