Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
4520aeba
Commit
4520aeba
authored
Sep 01, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建value拼接为绝对路径
同步saveSettings储存对应的key
parent
66789c18
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+19
-3
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
4520aeba
...
@@ -39,6 +39,7 @@ import static cn.garymb.ygomobile.Constants.PREF_NOTCH_HEIGHT;
...
@@ -39,6 +39,7 @@ import static cn.garymb.ygomobile.Constants.PREF_NOTCH_HEIGHT;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_ONLY_GAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_ONLY_GAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_READ_EX
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_READ_EX
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SENSOR_REFRESH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SENSOR_REFRESH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
YDK_FILE_EX
;
public
class
AppsSettings
{
public
class
AppsSettings
{
private
static
final
String
PREF_VERSION
=
"app_version"
;
private
static
final
String
PREF_VERSION
=
"app_version"
;
...
@@ -514,7 +515,7 @@ public class AppsSettings {
...
@@ -514,7 +515,7 @@ public class AppsSettings {
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_CATEGORY
,
DeckUtil
.
getDeckTypeName
(
path
));
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_CATEGORY
,
DeckUtil
.
getDeckTypeName
(
path
));
//保存最后卡组名
//保存最后卡组名
File
lastDeck
=
new
File
(
path
);
File
lastDeck
=
new
File
(
path
);
String
lastDeckName
=
IOUtils
.
tirmName
(
lastDeck
.
getName
(),
Constants
.
YDK_FILE_EX
);
String
lastDeckName
=
IOUtils
.
tirmName
(
lastDeck
.
getName
(),
YDK_FILE_EX
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
lastDeckName
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
lastDeckName
);
Log
.
i
(
"我是最后卡组路径+最后分类+最后卡组名"
,
Log
.
i
(
"我是最后卡组路径+最后分类+最后卡组名"
,
getLastDeckPath
()
+
"以及"
+
getLastDeckPath
()
+
"以及"
+
...
@@ -537,6 +538,21 @@ public class AppsSettings {
...
@@ -537,6 +538,21 @@ public class AppsSettings {
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_YDK
,
Constants
.
PREF_DEF_LAST_YDK
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_YDK
,
Constants
.
PREF_DEF_LAST_YDK
);
}
}
//从获得的key+value里拼接一个绝对路径
public
String
getCurLastDeckPath
()
{
String
path
;
if
(
TextUtils
.
equals
(
Constants
.
CORE_PACK_PATH
,
Constants
.
PREF_LAST_CATEGORY
))
{
path
=
getResourcePath
()
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
if
(
TextUtils
.
equals
(
Constants
.
WINDBOT_DECK_PATH
,
Constants
.
PREF_LAST_CATEGORY
)){
path
=
getResourcePath
()
+
"/"
+
Constants
.
WINDBOT_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
if
(
TextUtils
.
equals
(
Constants
.
PREF_LAST_CATEGORY
,
null
)){
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
{
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
return
path
;
}
public
void
saveIntSettings
(
String
key
,
int
value
)
{
public
void
saveIntSettings
(
String
key
,
int
value
)
{
mSharedPreferences
.
putInt
(
Constants
.
PREF_START
+
key
,
value
);
mSharedPreferences
.
putInt
(
Constants
.
PREF_START
+
key
,
value
);
}
}
...
@@ -603,9 +619,9 @@ public class AppsSettings {
...
@@ -603,9 +619,9 @@ public class AppsSettings {
public
void
saveSettings
(
String
key
,
String
value
)
{
public
void
saveSettings
(
String
key
,
String
value
)
{
if
(
"lastdeck"
.
equals
(
key
))
{
if
(
"lastdeck"
.
equals
(
key
))
{
mSharedPreferences
.
putString
(
Constants
.
PREF_
DEF_
LAST_YDK
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
value
);
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
mSharedPreferences
.
putString
(
Constants
.
PREF_
DEF_
LAST_CATEGORY
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_CATEGORY
,
value
);
}
else
{
}
else
{
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
4520aeba
...
@@ -59,6 +59,7 @@ public interface Constants {
...
@@ -59,6 +59,7 @@ public interface Constants {
String
DATABASE_NAME
=
"cards.cdb"
;
String
DATABASE_NAME
=
"cards.cdb"
;
String
BOT_CONF
=
"bot.conf"
;
String
BOT_CONF
=
"bot.conf"
;
String
WINDBOT_PATH
=
"windbot"
;
String
WINDBOT_PATH
=
"windbot"
;
String
WINDBOT_DECK_PATH
=
"Decks"
;
String
FONT_DIRECTORY
=
"fonts"
;
String
FONT_DIRECTORY
=
"fonts"
;
String
CORE_STRING_PATH
=
"strings.conf"
;
String
CORE_STRING_PATH
=
"strings.conf"
;
String
CORE_LIMIT_PATH
=
"lflist.conf"
;
String
CORE_LIMIT_PATH
=
"lflist.conf"
;
...
...
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