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
b3483d52
Commit
b3483d52
authored
Oct 03, 2021
by
noname
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deck copy/move
parent
da056f6b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+12
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
.../java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
+2
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
...rc/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
+4
-2
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
b3483d52
...
...
@@ -1145,9 +1145,13 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckMove
(
List
<
DeckFile
>
deckFileList
,
DeckType
toDeckType
)
{
String
currentDeckPath
=
mDeckAdapater
.
getYdkFile
().
getAbsolutePath
();
File
ydk
=
mDeckAdapater
.
getYdkFile
();
if
(
ydk
==
null
){
return
;
}
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
));
return
;
}
...
...
@@ -1156,9 +1160,13 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public
void
onDeckCopy
(
List
<
DeckFile
>
deckFileList
,
DeckType
toDeckType
)
{
String
currentDeckPath
=
mDeckAdapater
.
getYdkFile
().
getAbsolutePath
();
File
ydk
=
mDeckAdapater
.
getYdkFile
();
if
(
ydk
==
null
){
return
;
}
String
currentDeckPath
=
ydk
.
getPath
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
if
(
deckFile
.
getPath
().
equals
(
currentDeckPath
))
{
if
(
TextUtils
.
equals
(
currentDeckPath
,
deckFile
.
getPath
()
))
{
loadDeckFromFile
(
new
File
(
toDeckType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
));
return
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
View file @
b3483d52
...
...
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.Nullable
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.io.File
;
...
...
@@ -388,7 +389,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
return
mLimitList
;
}
public
File
getYdkFile
(){
public
@Nullable
File
getYdkFile
(){
if
(
mDeckInfo
!=
null
){
return
mDeckInfo
.
source
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
View file @
b3483d52
...
...
@@ -5,6 +5,7 @@ import android.content.Context;
import
android.content.DialogInterface
;
import
android.text.InputType
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.Gravity
;
import
android.view.KeyEvent
;
import
android.view.View
;
...
...
@@ -128,6 +129,7 @@ public class YGODialogUtil {
public
void
onItemSelect
(
int
position
,
DeckType
item
)
{
clearDeckSelect
();
deckList
.
clear
();
Log
.
d
(
"kk-test"
,
"read path"
+
item
.
getPath
());
deckList
.
addAll
(
DeckUtil
.
getDeckList
(
item
.
getPath
()));
if
(
position
==
0
)
{
if
(
AppsSettings
.
get
().
isReadExpansions
())
{
...
...
@@ -237,7 +239,7 @@ public class YGODialogUtil {
List
<
DeckFile
>
deckFileList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
try
{
FileUtils
.
moveFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()).
getPath
());
FileUtils
.
moveFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
).
getPath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -267,7 +269,7 @@ public class YGODialogUtil {
List
<
DeckFile
>
deckFileList
=
deckAdp
.
getSelectList
();
for
(
DeckFile
deckFile
:
deckFileList
)
{
try
{
FileUtils
.
copyFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()).
getPath
());
FileUtils
.
copyFile
(
deckFile
.
getPath
(),
new
File
(
toType
.
getPath
(),
deckFile
.
getName
()
+
".ydk"
).
getPath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
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