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
2b42637d
Commit
2b42637d
authored
May 08, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在卡组编辑下进行备份、还原卡组。
parent
d4047e3f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
10 deletions
+63
-10
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
...cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
+42
-5
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+0
-5
mobile/src/main/res/menu/deck_menu.xml
mobile/src/main/res/menu/deck_menu.xml
+6
-0
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+5
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+5
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+5
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
View file @
2b42637d
...
...
@@ -2,11 +2,13 @@ package cn.garymb.ygomobile.ui.cards;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Environment
;
import
android.os.Handler
;
import
android.text.InputType
;
import
android.text.TextUtils
;
...
...
@@ -83,6 +85,7 @@ import ocgcore.data.Card;
import
ocgcore.data.LimitList
;
import
ocgcore.enums.LimitType
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_DECK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
YDK_FILE_EX
;
class
DeckManagerActivityImpl
extends
BaseCardsAcitivity
implements
RecyclerViewItemListener
.
OnItemListener
,
OnItemDragListener
,
YGODialogUtil
.
OnDeckMenuListener
{
...
...
@@ -619,9 +622,29 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
}
public
boolean
doMenu
(
int
menuId
)
{
DialogPlus
builder
=
new
DialogPlus
(
this
);
switch
(
menuId
)
{
case
R
.
id
.
action_quit
:
onBackHome
();
case
R
.
id
.
action_deck_backup_n_restore
:
builder
.
setTitle
(
R
.
string
.
question
);
builder
.
setMessage
(
R
.
string
.
deck_explain
);
builder
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
builder
.
setLeftButtonText
(
R
.
string
.
deck_restore
);
builder
.
setRightButtonText
(
R
.
string
.
deck_back_up
);
builder
.
setRightButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
doBackUpDeck
();
}
});
builder
.
setLeftButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
doRestoreDeck
();
}
});
builder
.
show
();
break
;
// case R.id.action_refresh:
// mDeckAdapater.notifyDataSetChanged();
...
...
@@ -672,7 +695,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
break
;
case
R
.
id
.
action_clear_deck
:
{
DialogPlus
builder
=
new
DialogPlus
(
this
);
builder
.
setTitle
(
R
.
string
.
question
);
builder
.
setMessage
(
R
.
string
.
question_clear_deck
);
builder
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
...
...
@@ -692,7 +714,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
if
(
mDeckAdapater
.
getYdkFile
().
getParent
().
equals
(
mSettings
.
getAiDeckDir
()))
{
Toast
.
makeText
(
this
,
R
.
string
.
donot_editor_bot_Deck
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
DialogPlus
builder
=
new
DialogPlus
(
this
);
builder
.
setTitle
(
R
.
string
.
question
);
builder
.
setMessage
(
R
.
string
.
question_delete_deck
);
builder
.
setMessageGravity
(
Gravity
.
CENTER_HORIZONTAL
);
...
...
@@ -1090,7 +1111,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
addMenuButton
(
mMenuIds
,
menu
,
R
.
id
.
action_unsort
,
R
.
string
.
unsort
,
R
.
drawable
.
unsort
);
addMenuButton
(
mMenuIds
,
menu
,
R
.
id
.
action_sort
,
R
.
string
.
sort
,
R
.
drawable
.
sort
);
addMenuButton
(
mMenuIds
,
menu
,
R
.
id
.
action_
quit
,
R
.
string
.
quit
,
R
.
drawable
.
quit
);
addMenuButton
(
mMenuIds
,
menu
,
R
.
id
.
action_
deck_backup_n_restore
,
R
.
string
.
deck_backup_n_restore
,
R
.
drawable
.
downloadimages
);
//设置展开或隐藏的延时。 默认值为 800ms。
menu
.
setDuration
(
150
);
...
...
@@ -1119,6 +1140,22 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
mMenuIds
.
put
(
mMenuIds
.
size
(),
menuId
);
}
private
void
doBackUpDeck
()
{
try
{
FileUtils
.
copyDir
(
mSettings
.
getDeckDir
(),
ORI_DECK
,
true
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
getContext
(),
e
+
""
,
Toast
.
LENGTH_SHORT
);
}
}
private
void
doRestoreDeck
()
{
try
{
FileUtils
.
copyDir
(
ORI_DECK
,
mSettings
.
getDeckDir
(),
false
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
getContext
(),
e
+
""
,
Toast
.
LENGTH_SHORT
);
}
}
@Override
public
void
onDeckSelect
(
DeckFile
deckFile
)
{
loadDeckFromFile
(
new
File
(
deckFile
.
getPath
()));
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
2b42637d
...
...
@@ -259,11 +259,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
//复制人机资源
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
resPath
,
needsUpdate
);
//复制原目录文件
FileUtils
.
copyDir
(
ORI_DECK
,
mSettings
.
getDeckDir
(),
false
);
FileUtils
.
copyDir
(
ORI_REPLAY
,
resPath
+
"/"
+
Constants
.
CORE_REPLAY_PATH
,
false
);
//FileUtils.copyDir(ORI_TEXTURES, mSettings.getCoreSkinPath(), true);
//FileUtils.copyDir(ORI_PICS, mSettings.getCardImagePath(), false);
han
.
sendEmptyMessage
(
0
);
...
...
mobile/src/main/res/menu/deck_menu.xml
View file @
2b42637d
...
...
@@ -13,6 +13,12 @@
android:title=
"@string/share_deck"
app:showAsAction=
"always"
/>
<item
android:id=
"@+id/action_deck_backup_n_restore"
android:icon=
"@drawable/downloadimages"
android:title=
"@string/deck_backup_n_restore"
app:showAsAction=
"always"
/>
<!--<item-->
<!--android:id="@+id/action_card_list"-->
<!--android:icon="@drawable/listicon"-->
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
2b42637d
...
...
@@ -281,4 +281,9 @@
<string
name=
"ypk_installed"
>
확장팩 설치되어
</string>
<string
name=
"ypk_go_setting"
>
점검 \"확장팩 사용\"
</string>
<string
name=
"ypk_failed_bcos"
>
확장팩 설치 실패, 왜냐하면\:
</string>
<string
name=
"deck_back_up"
>
BackUp
</string>
<string
name=
"deck_restore"
>
Restore
</string>
<string
name=
"deck_backup_n_restore"
>
BackUp/Restore
</string>
<string
name=
"deck_explain"
>
BackUp\: back up all decks to Sdcard/ygocore
\nRestore\: restore backed up decks
</string>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
2b42637d
...
...
@@ -280,4 +280,9 @@
<string
name=
"ypk_installed"
>
拓展卡包文件已安装
</string>
<string
name=
"ypk_go_setting"
>
这是拓展卡包文件,要使用须启用扩展卡包
</string>
<string
name=
"ypk_failed_bcos"
>
拓展卡包安装失败,原因:
</string>
<string
name=
"deck_back_up"
>
备份
</string>
<string
name=
"deck_restore"
>
还原
</string>
<string
name=
"deck_backup_n_restore"
>
备份/还原
</string>
<string
name=
"deck_explain"
>
备份:将当前所有卡组备份到内存根目录的ygocore文件夹
\n还原:将已在上述备份路径的所有卡组还原到此
</string>
</resources>
mobile/src/main/res/values/strings.xml
View file @
2b42637d
...
...
@@ -283,4 +283,9 @@
<string
name=
"ypk_installed"
>
expansion file installed
</string>
<string
name=
"ypk_go_setting"
>
check \"Use Expansions\" to use it
</string>
<string
name=
"ypk_failed_bcos"
>
expansion file install failed, because\:
</string>
<string
name=
"deck_back_up"
>
BackUp
</string>
<string
name=
"deck_restore"
>
Restore
</string>
<string
name=
"deck_backup_n_restore"
>
BackUp/Restore
</string>
<string
name=
"deck_explain"
>
BackUp\: back up all decks to Sdcard/ygocore
\nRestore\: restore backed up decks
</string>
</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