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
9ced9733
Commit
9ced9733
authored
Jun 08, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将刷新按钮变为切换根据点赞排序和根据上传时间排序
parent
67f6bef9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
...a/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
+27
-15
mobile/src/main/res/drawable/upload_time.xml
mobile/src/main/res/drawable/upload_time.xml
+5
-0
mobile/src/main/res/layout/fragment_deck_square.xml
mobile/src/main/res/layout/fragment_deck_square.xml
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
View file @
9ced9733
package
cn.garymb.ygomobile.deck_square
;
package
cn.garymb.ygomobile.deck_square
;
import
android.graphics.drawable.Drawable
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.TextWatcher
;
...
@@ -46,6 +47,29 @@ public class DeckSquareFragment extends Fragment {
...
@@ -46,6 +47,29 @@ public class DeckSquareFragment extends Fragment {
binding
.
listDeckInfo
.
setAdapter
(
deckSquareListAdapter
);
binding
.
listDeckInfo
.
setAdapter
(
deckSquareListAdapter
);
deckSquareListAdapter
.
loadData
();
deckSquareListAdapter
.
loadData
();
binding
.
etGoToPage
.
setText
(
"1"
);
binding
.
etGoToPage
.
setText
(
"1"
);
sortLike
=
false
;
Drawable
icon_like
=
getContext
().
getDrawable
(
R
.
drawable
.
baseline_thumb_up_24
);
Drawable
icon_new
=
getContext
().
getDrawable
(
R
.
drawable
.
upload_time
);
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
//根据按钮使用的图标决定是否是按赞排序还是按上传时间排序
sortLike
=
binding
.
refreshData
.
getDrawable
()
==
icon_like
;
int
targetPage
=
1
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLike
,
false
,
""
);
//切换成另一种图标
if
(
sortLike
)
{
binding
.
refreshData
.
setImageDrawable
(
icon_new
);
}
else
{
binding
.
refreshData
.
setImageDrawable
(
icon_like
);
}
}
});
//查询卡组名称
//查询卡组名称
binding
.
etDeckSquareInputDeckName
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
binding
.
etDeckSquareInputDeckName
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
...
@@ -176,7 +200,7 @@ public class DeckSquareFragment extends Fragment {
...
@@ -176,7 +200,7 @@ public class DeckSquareFragment extends Fragment {
}
}
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
targetPage
));
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
targetPage
));
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
fals
e
,
false
,
""
);
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLik
e
,
false
,
""
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
return
true
;
return
true
;
}
}
...
@@ -192,7 +216,7 @@ public class DeckSquareFragment extends Fragment {
...
@@ -192,7 +216,7 @@ public class DeckSquareFragment extends Fragment {
}
}
int
newPage
=
targetPage
+
1
;
int
newPage
=
targetPage
+
1
;
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
fals
e
,
false
,
""
);
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLik
e
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
...
@@ -211,24 +235,12 @@ public class DeckSquareFragment extends Fragment {
...
@@ -211,24 +235,12 @@ public class DeckSquareFragment extends Fragment {
if
(
newPage
<
1
)
{
if
(
newPage
<
1
)
{
newPage
=
1
;
newPage
=
1
;
}
}
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
fals
e
,
false
,
""
);
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLik
e
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
}
});
});
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
int
targetPage
=
1
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
false
,
false
,
""
);
}
});
deckSquareListAdapter
.
setOnItemLongClickListener
((
adapter
,
view
,
position
)
->
{
deckSquareListAdapter
.
setOnItemLongClickListener
((
adapter
,
view
,
position
)
->
{
OnlineDeckDetail
item
=
(
OnlineDeckDetail
)
adapter
.
getItem
(
position
);
OnlineDeckDetail
item
=
(
OnlineDeckDetail
)
adapter
.
getItem
(
position
);
...
...
mobile/src/main/res/drawable/upload_time.xml
0 → 100644
View file @
9ced9733
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:height=
"24dp"
android:viewportHeight=
"1024"
android:viewportWidth=
"1024"
android:width=
"24dp"
>
<path
android:fillColor=
"#ffffff"
android:pathData=
"M371.7,665.3a40.8,40.8 0,0 1,-40.5 -40.6,40.5 40.5,0 0,1 11.9,-28.6l114.6,-114.6L457.6,212.5a40.6,40.6 0,0 1,81.2 0v287.3c0,1.5 -0.5,3.8 -1.2,5.1 0,0.3 -0.1,0.6 -0.2,0.9h0.3a14.3,14.3 0,0 1,-0.7 1.5h0.3l-0.4,1.2 0.1,-0.1 -0.2,0.8s-1.5,4.1 -2,5v0.1a9.9,9.9 0,0 0,0.9 -1.3,61.7 61.7,0 0,1 -3.4,6.8 41.1,41.1 0,0 1,-6 7.4l-126.1,126.1a39.9,39.9 0,0 1,-28.6 11.9zM750.9,949.6a40.3,40.3 0,0 1,-40.4 -40.5l0.5,-218.9 -89.4,89.4a40.5,40.5 0,0 1,-57.3 -57.3l158.1,-158.2a40.5,40.5 0,0 1,28.7 -11.9c13.8,0 26.2,6.4 33.8,17.2l152.9,152.8a40.6,40.6 0,0 1,-28.6 69.2,40.4 40.4,0 0,1 -28.6,-11.9l-88.7,-88.7 -0.5,218.3a40.8,40.8 0,0 1,-40.6 40.4h-0.1zM498.2,949.9C249.2,949.9 46.5,747.3 46.5,498.2 46.5,249.2 249.2,46.5 498.3,46.5c249.1,0 451.7,202.6 451.7,451.6a40.6,40.6 0,0 1,-81.1 0c0,-204.4 -166.3,-370.6 -370.7,-370.6 -204.4,0 -370.7,166.3 -370.7,370.6 0,204.5 166.3,370.7 370.7,370.7 22.3,0 40.5,18.2 40.5,40.4 0,22.3 -18.2,40.5 -40.5,40.5z"
/>
</vector>
mobile/src/main/res/layout/fragment_deck_square.xml
View file @
9ced9733
...
@@ -183,7 +183,7 @@
...
@@ -183,7 +183,7 @@
android:layout_margin=
"5dp"
android:layout_margin=
"5dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/ic_radius_bg"
android:background=
"@drawable/ic_radius_bg"
android:src=
"@drawable/
ic_refresh
"
/>
android:src=
"@drawable/
upload_time
"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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