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
c3356399
Commit
c3356399
authored
Jun 09, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加排序模式提示文字,优化刷新按钮排序模式切换逻辑
parent
7dc5d09b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
65 deletions
+107
-65
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
...a/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
+62
-59
mobile/src/main/res/layout/fragment_deck_square.xml
mobile/src/main/res/layout/fragment_deck_square.xml
+33
-6
mobile/src/main/res/values-es/strings.xml
mobile/src/main/res/values-es/strings.xml
+2
-0
mobile/src/main/res/values-jp/strings.xml
mobile/src/main/res/values-jp/strings.xml
+2
-0
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+2
-0
mobile/src/main/res/values-pt/strings.xml
mobile/src/main/res/values-pt/strings.xml
+2
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+2
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+2
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareFragment.java
View file @
c3356399
...
@@ -53,21 +53,76 @@ public class DeckSquareFragment extends Fragment {
...
@@ -53,21 +53,76 @@ public class DeckSquareFragment extends Fragment {
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
binding
.
refreshData
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
//根据按钮使用的图标决定是否是按赞排序还是按上传时间排序
//根据按钮使用的图标决定是否是按赞排序还是按上传时间排序, 切换成另一种图标
sortLike
=
binding
.
refreshData
.
getDrawable
()
==
icon_like
;
if
(
sortLike
==
false
)
{
sortLike
=
true
;
binding
.
tvSortMode
.
setText
(
R
.
string
.
sort_by_thumb
);
//当按时间顺序时,点击应切换为按点赞顺序
binding
.
refreshData
.
setImageDrawable
(
icon_new
);
//因为点击后会变成按点赞顺序,就需要图标显示为按时间顺序,告诉用户点它可变回时间顺序
}
else
{
sortLike
=
false
;
binding
.
tvSortMode
.
setText
(
R
.
string
.
sort_by_time
);
//当按点赞顺序时,点击应切换为按时间顺序
binding
.
refreshData
.
setImageDrawable
(
icon_like
);
//因为点击后会变成按时间顺序,就需要图标显示为按时间顺序,告诉用户点它可变回时间顺序
}
int
targetPage
=
1
;
int
targetPage
=
1
;
try
{
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
}
}
Log
.
d
(
"seesee sortlike"
,
sortLike
.
toString
());
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLike
,
false
,
""
);
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLike
,
false
,
""
);
//切换成另一种图标
}
if
(
sortLike
)
{
});
binding
.
refreshData
.
setImageDrawable
(
icon_new
);
// 设置页码跳转监听
}
else
{
binding
.
etGoToPage
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
binding
.
refreshData
.
setImageDrawable
(
icon_like
);
if
(
actionId
==
EditorInfo
.
IME_ACTION_DONE
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
v
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
}
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
targetPage
));
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
return
true
;
}
return
false
;
});
binding
.
nextPageBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
int
newPage
=
targetPage
+
1
;
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
});
binding
.
formerPageBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
int
newPage
=
targetPage
-
1
;
if
(
newPage
<
1
)
{
newPage
=
1
;
}
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
}
});
});
//查询卡组名称
//查询卡组名称
...
@@ -189,58 +244,6 @@ public class DeckSquareFragment extends Fragment {
...
@@ -189,58 +244,6 @@ public class DeckSquareFragment extends Fragment {
//设置清空按钮点击清除输入内容
//设置清空按钮点击清除输入内容
binding
.
btnClearDeckName
.
setOnClickListener
(
view
->
binding
.
etDeckSquareInputDeckName
.
getText
().
clear
());
binding
.
btnClearDeckName
.
setOnClickListener
(
view
->
binding
.
etDeckSquareInputDeckName
.
getText
().
clear
());
binding
.
btnClearContributorName
.
setOnClickListener
(
view
->
binding
.
etInputContributorName
.
getText
().
clear
());
binding
.
btnClearContributorName
.
setOnClickListener
(
view
->
binding
.
etInputContributorName
.
getText
().
clear
());
// 设置页码跳转监听
binding
.
etGoToPage
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_DONE
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
v
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
targetPage
));
deckSquareListAdapter
.
loadData
(
targetPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
return
true
;
}
return
false
;
});
binding
.
nextPageBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
int
newPage
=
targetPage
+
1
;
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
});
binding
.
formerPageBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
int
targetPage
=
0
;
try
{
targetPage
=
Integer
.
parseInt
(
binding
.
etGoToPage
.
getText
().
toString
());
}
catch
(
NumberFormatException
e
)
{
}
int
newPage
=
targetPage
-
1
;
if
(
newPage
<
1
)
{
newPage
=
1
;
}
deckSquareListAdapter
.
loadData
(
newPage
,
30
,
""
,
sortLike
,
false
,
""
);
binding
.
etGoToPage
.
setText
(
Integer
.
toString
(
newPage
));
binding
.
listDeckInfo
.
scrollToPosition
(
0
);
}
});
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/layout/fragment_deck_square.xml
View file @
c3356399
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
android:weightSum=
"3"
>
android:weightSum=
"3"
>
<View
<View
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"1dp"
android:layout_height=
"1dp"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
<EditText
<EditText
android:id=
"@+id/et_go_to_page"
android:id=
"@+id/et_go_to_page"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@drawable/veil2"
android:background=
"@drawable/veil2"
...
@@ -144,12 +144,39 @@
...
@@ -144,12 +144,39 @@
android:singleLine=
"true"
android:singleLine=
"true"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<
View
<
LinearLayout
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"
1dp
"
android:layout_height=
"
match_parent
"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@color/holo_blue_light"
/>
android:orientation=
"horizontal"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:background=
"@color/holo_blue_light"
/>
<TextView
android:id=
"@+id/tv_sort_mode"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:textColor=
"@color/holo_blue_light"
android:gravity=
"center"
android:textSize=
"5sp"
android:text=
"@string/sort_by_time"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:background=
"@color/holo_blue_light"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- 按钮控制区域 -->
<!-- 按钮控制区域 -->
...
...
mobile/src/main/res/values-es/strings.xml
View file @
c3356399
...
@@ -382,5 +382,7 @@
...
@@ -382,5 +382,7 @@
<string
name=
"deck_square"
>
Plaza de Decks
</string>
<string
name=
"deck_square"
>
Plaza de Decks
</string>
<string
name=
"my_deck_online"
>
Copia en la Nube
</string>
<string
name=
"my_deck_online"
>
Copia en la Nube
</string>
<string
name=
"input_contributor_name"
>
Introduce el Nombre del Compartidor
</string>
<string
name=
"input_contributor_name"
>
Introduce el Nombre del Compartidor
</string>
<string
name=
"sort_by_time"
>
Ordenar por Tiempo
</string>
<string
name=
"sort_by_thumb"
>
En el orden recomendado
</string>
</resources>
</resources>
mobile/src/main/res/values-jp/strings.xml
View file @
c3356399
...
@@ -376,4 +376,6 @@
...
@@ -376,4 +376,6 @@
<string
name=
"deck_square"
>
デッキ広場
</string>
<string
name=
"deck_square"
>
デッキ広場
</string>
<string
name=
"my_deck_online"
>
クラウド バックアップ
</string>
<string
name=
"my_deck_online"
>
クラウド バックアップ
</string>
<string
name=
"input_contributor_name"
>
共有者の名前を入力してください
</string>
<string
name=
"input_contributor_name"
>
共有者の名前を入力してください
</string>
<string
name=
"sort_by_time"
>
時間順に
</string>
<string
name=
"sort_by_thumb"
>
推薦順に
</string>
</resources>
</resources>
mobile/src/main/res/values-ko/strings.xml
View file @
c3356399
...
@@ -377,4 +377,6 @@
...
@@ -377,4 +377,6 @@
<string
name=
"deck_square"
>
덱 공유 광장
</string>
<string
name=
"deck_square"
>
덱 공유 광장
</string>
<string
name=
"my_deck_online"
>
클라우드 백업
</string>
<string
name=
"my_deck_online"
>
클라우드 백업
</string>
<string
name=
"input_contributor_name"
>
공유자의 이름을 입력하세요
</string>
<string
name=
"input_contributor_name"
>
공유자의 이름을 입력하세요
</string>
<string
name=
"sort_by_time"
>
시간 순서대로
</string>
<string
name=
"sort_by_thumb"
>
추천 순서대로
</string>
</resources>
</resources>
mobile/src/main/res/values-pt/strings.xml
View file @
c3356399
...
@@ -366,5 +366,7 @@
...
@@ -366,5 +366,7 @@
<string
name=
"deck_square"
>
Praça de Decks
</string>
<string
name=
"deck_square"
>
Praça de Decks
</string>
<string
name=
"my_deck_online"
>
Backup na Nuvem
</string>
<string
name=
"my_deck_online"
>
Backup na Nuvem
</string>
<string
name=
"input_contributor_name"
>
Insira o Nome do Compartilhador
</string>
<string
name=
"input_contributor_name"
>
Insira o Nome do Compartilhador
</string>
<string
name=
"sort_by_time"
>
Ordenar por Tempo
</string>
<string
name=
"sort_by_thumb"
>
Na ordem recomendada
</string>
</resources>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
c3356399
...
@@ -381,4 +381,6 @@
...
@@ -381,4 +381,6 @@
<string
name=
"deck_square"
>
卡组广场
</string>
<string
name=
"deck_square"
>
卡组广场
</string>
<string
name=
"my_deck_online"
>
云备份
</string>
<string
name=
"my_deck_online"
>
云备份
</string>
<string
name=
"input_contributor_name"
>
输入共享者名称
</string>
<string
name=
"input_contributor_name"
>
输入共享者名称
</string>
<string
name=
"sort_by_time"
>
按时间顺序
</string>
<string
name=
"sort_by_thumb"
>
按点赞顺序
</string>
</resources>
</resources>
mobile/src/main/res/values/strings.xml
View file @
c3356399
...
@@ -446,4 +446,6 @@
...
@@ -446,4 +446,6 @@
<string
name=
"deck_square"
>
Deck Plaza
</string>
<string
name=
"deck_square"
>
Deck Plaza
</string>
<string
name=
"my_deck_online"
>
Cloud Backup
</string>
<string
name=
"my_deck_online"
>
Cloud Backup
</string>
<string
name=
"input_contributor_name"
>
Enter the Sharer\'s Name
</string>
<string
name=
"input_contributor_name"
>
Enter the Sharer\'s Name
</string>
<string
name=
"sort_by_time"
>
Sort by Time
</string>
<string
name=
"sort_by_thumb"
>
Sort by Thumb
</string>
</resources>
</resources>
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