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
3e8c02b0
Commit
3e8c02b0
authored
Jun 06, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
如果卡组数量只有1则询问是否还原
parent
911d3b43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+27
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
3e8c02b0
...
@@ -12,9 +12,11 @@ import android.os.Bundle;
...
@@ -12,9 +12,11 @@ import android.os.Bundle;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.AppsSettings
;
...
@@ -145,6 +147,31 @@ public class MainActivity extends HomeActivity {
...
@@ -145,6 +147,31 @@ public class MainActivity extends HomeActivity {
public
void
onDismiss
(
DialogInterface
dialogInterface
)
{
public
void
onDismiss
(
DialogInterface
dialogInterface
)
{
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
()
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
()
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
YGOUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
YGOUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
File
oriDeckFiles
=
new
File
(
ORI_DECK
);
File
deckFiles
=
new
File
(
AppsSettings
.
get
().
getDeckDir
());
if
(
oriDeckFiles
.
exists
()
&&
deckFiles
.
list
().
length
<=
1
)
{
DialogPlus
dlgpls
=
new
DialogPlus
(
MainActivity
.
this
);
dlgpls
.
setTitle
(
R
.
string
.
tip
);
dlgpls
.
setMessage
(
R
.
string
.
restore_deck
);
dlgpls
.
setLeftButtonText
(
R
.
string
.
Cancel
);
dlgpls
.
setLeftButtonListener
((
dlg
,
i
)
->
{
dlgpls
.
dismiss
();
});
dlgpls
.
setRightButtonText
(
R
.
string
.
deck_restore
);
dlgpls
.
setRightButtonListener
((
dlg
,
i
)
->
{
try
{
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
(),
false
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
MainActivity
.
this
,
e
+
""
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast
.
makeText
(
MainActivity
.
this
,
R
.
string
.
done
,
Toast
.
LENGTH_SHORT
).
show
();
dlgpls
.
dismiss
();
});
dlgpls
.
show
();
}
else
{
Toast
.
makeText
(
MainActivity
.
this
,
"不符合提示备份条件"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
});
});
dialog
.
show
();
dialog
.
show
();
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
3e8c02b0
...
@@ -285,7 +285,7 @@
...
@@ -285,7 +285,7 @@
<string
name=
"deck_backup_n_restore"
>
备份/还原
</string>
<string
name=
"deck_backup_n_restore"
>
备份/还原
</string>
<string
name=
"deck_explain"
>
备份:将当前所有卡组备份到内存根目录的ygocore文件夹
<string
name=
"deck_explain"
>
备份:将当前所有卡组备份到内存根目录的ygocore文件夹
\n还原:将已在上述备份路径的所有卡组还原到此
</string>
\n还原:将已在上述备份路径的所有卡组还原到此
</string>
<string
name=
"restore_deck"
>
发现本机有卡组备份记录,是否
导入
?
</string>
<string
name=
"restore_deck"
>
发现本机有卡组备份记录,是否
还原
?
</string>
<string
name=
"explain_permission"
>
<string
name=
"explain_permission"
>
将申请以下必要权限:
将申请以下必要权限:
\n电话权限:不获得电话号码等个人信息,只获得机型信息用于BUG排查和适配
\n电话权限:不获得电话号码等个人信息,只获得机型信息用于BUG排查和适配
...
...
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