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
b7e9253e
Commit
b7e9253e
authored
Mar 04, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打卡卡组管理时,列表自动滚动到选中卡组的位置
parent
9797d05d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
...rc/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
+21
-11
No files found.
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
View file @
b7e9253e
package
cn.garymb.ygomobile.utils
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
YDK_FILE_EX
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.os.Build
;
...
...
@@ -136,21 +138,21 @@ public class YGODialogUtil {
if
(!
TextUtils
.
isEmpty
(
selectDeckPath
))
{
File
file
=
new
File
(
selectDeckPath
);
if
(
file
.
exists
())
{
String
n
ame
=
file
.
getParentFile
().
getName
();
String
las
tName
=
file
.
getParentFile
().
getParentFile
().
getName
();
if
(
name
.
equals
(
"pack"
)
||
n
ame
.
equals
(
"cacheDeck"
))
{
String
cateN
ame
=
file
.
getParentFile
().
getName
();
String
paren
tName
=
file
.
getParentFile
().
getParentFile
().
getName
();
if
(
cateName
.
equals
(
"pack"
)
||
cateN
ame
.
equals
(
"cacheDeck"
))
{
//卡包
typeSelectPosition
=
0
;
}
else
if
(
name
.
equals
(
"Decks"
)
&&
las
tName
.
equals
(
Constants
.
WINDBOT_PATH
))
{
}
else
if
(
cateName
.
equals
(
"Decks"
)
&&
paren
tName
.
equals
(
Constants
.
WINDBOT_PATH
))
{
//ai卡组
typeSelectPosition
=
1
;
}
else
if
(
name
.
equals
(
"deck"
)
&&
las
tName
.
equals
(
Constants
.
PREF_DEF_GAME_DIR
))
{
}
else
if
(
cateName
.
equals
(
"deck"
)
&&
paren
tName
.
equals
(
Constants
.
PREF_DEF_GAME_DIR
))
{
//如果是deck并且上一个目录是ygocore的话,保证不会把名字为deck的卡包识别为未分类
}
else
{
//其他卡包
for
(
int
i
=
3
;
i
<
typeList
.
size
();
i
++)
{
DeckType
deckType
=
typeList
.
get
(
i
);
if
(
deckType
.
getName
().
equals
(
n
ame
))
{
if
(
deckType
.
getName
().
equals
(
cateN
ame
))
{
typeSelectPosition
=
i
;
break
;
}
...
...
@@ -160,13 +162,12 @@ public class YGODialogUtil {
}
deckList
=
DeckUtil
.
getDeckList
(
typeList
.
get
(
typeSelectPosition
).
getPath
());
for
(
int
i
=
0
;
i
<
typeList
.
size
();
i
++)
{
allDeckList
.
addAll
(
DeckUtil
.
getDeckList
(
typeList
.
get
(
i
).
getPath
()));
Log
.
i
(
TAG
,
allDeckList
.
size
()
+
""
);
allDeckList
.
addAll
(
DeckUtil
.
getDeckList
(
typeList
.
get
(
i
).
getPath
()));
//把所有分类里的卡组全部纳入,用于关键词查询目标
}
if
(
typeSelectPosition
==
0
)
{
if
(
AppsSettings
.
get
().
isReadExpansions
())
{
try
{
deckList
.
addAll
(
0
,
DeckUtil
.
getExpansionsDeckList
());
deckList
.
addAll
(
0
,
DeckUtil
.
getExpansionsDeckList
());
//置顶ypk缓存的cacheDeck下的先行卡ydk
}
catch
(
IOException
e
)
{
YGOUtil
.
show
(
"额外卡库加载失败,原因为"
+
e
);
}
...
...
@@ -245,7 +246,7 @@ public class YGODialogUtil {
searchDeck
();
});
et_input_deck_name
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
et_input_deck_name
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
InputMethodManager
imm
=
(
InputMethodManager
)
context
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
hideSoftInputFromWindow
(
v
.
getWindowToken
(),
0
);
...
...
@@ -491,9 +492,18 @@ public class YGODialogUtil {
}
}));
itemTouchHelper
.
attachToRecyclerView
(
rv_type
);
if
(!
TextUtils
.
isEmpty
(
selectDeckPath
))
{
for
(
int
i
=
0
;
i
<
deckList
.
size
();
i
++)
{
if
(
selectDeckPath
.
endsWith
(
deckList
.
get
(
i
).
getName
()
+
YDK_FILE_EX
))
{
rv_deck
.
scrollToPosition
(
i
);
rv_deck
.
set
break
;
}
}
}
}
private
void
searchDeck
(){
private
void
searchDeck
()
{
resultList
.
clear
();
et_input_deck_name
.
clearFocus
();
String
keyword
=
et_input_deck_name
.
getText
().
toString
();
...
...
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