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
5c1aa6a3
Commit
5c1aa6a3
authored
Sep 01, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4520aeba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
mobile/src/main/java/cn/garymb/ygomobile/App.java
mobile/src/main/java/cn/garymb/ygomobile/App.java
+0
-4
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+10
-6
No files found.
mobile/src/main/java/cn/garymb/ygomobile/App.java
View file @
5c1aa6a3
...
@@ -38,7 +38,6 @@ public class App extends GameApplication {
...
@@ -38,7 +38,6 @@ public class App extends GameApplication {
@Override
@Override
public
NativeInitOptions
getNativeInitOptions
()
{
public
NativeInitOptions
getNativeInitOptions
()
{
NativeInitOptions
options
=
AppsSettings
.
get
().
getNativeInitOptions
();
NativeInitOptions
options
=
AppsSettings
.
get
().
getNativeInitOptions
();
Log
.
i
(
"我是getNativeInitOptions"
,
options
+
""
);
return
options
;
return
options
;
}
}
...
@@ -77,18 +76,15 @@ public class App extends GameApplication {
...
@@ -77,18 +76,15 @@ public class App extends GameApplication {
@Override
@Override
public
void
saveSetting
(
String
key
,
String
value
)
{
public
void
saveSetting
(
String
key
,
String
value
)
{
AppsSettings
.
get
().
saveSettings
(
key
,
value
);
AppsSettings
.
get
().
saveSettings
(
key
,
value
);
Log
.
i
(
"我是saveSetting的key+value"
,
key
+
"以及"
+
value
);
}
}
@Override
@Override
public
String
getSetting
(
String
key
)
{
public
String
getSetting
(
String
key
)
{
Log
.
i
(
"我是getSetting的key"
,
key
);
return
AppsSettings
.
get
().
getSettings
(
key
);
return
AppsSettings
.
get
().
getSettings
(
key
);
}
}
@Override
@Override
public
int
getIntSetting
(
String
key
,
int
def
)
{
public
int
getIntSetting
(
String
key
,
int
def
)
{
Log
.
i
(
"我是getIntSetting的key+def"
,
key
+
"以及"
+
def
);
return
AppsSettings
.
get
().
getIntSettings
(
key
,
def
);
return
AppsSettings
.
get
().
getIntSettings
(
key
,
def
);
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
5c1aa6a3
...
@@ -18,6 +18,7 @@ import java.util.Arrays;
...
@@ -18,6 +18,7 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.preference.PreferenceFragmentPlus
;
import
cn.garymb.ygomobile.ui.preference.PreferenceFragmentPlus
;
import
cn.garymb.ygomobile.utils.DeckUtil
;
import
cn.garymb.ygomobile.utils.DeckUtil
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
...
@@ -505,7 +506,10 @@ public class AppsSettings {
...
@@ -505,7 +506,10 @@ public class AppsSettings {
//保存最后卡组绝对路径、分类、卡组名
//保存最后卡组绝对路径、分类、卡组名
public
void
setLastDeckPath
(
String
path
)
{
public
void
setLastDeckPath
(
String
path
)
{
if
(
TextUtils
.
equals
(
path
,
getCurLastDeck
()))
{
Log
.
i
(
"我是path"
,
path
);
Log
.
i
(
"我是getCurLastDeckPath"
,
getCurLastDeckPath
());
Log
.
i
(
"我是getLastDeckPath"
,
getLastDeckPath
());
if
(
TextUtils
.
equals
(
path
,
getLastDeckPath
()))
{
//一样
//一样
return
;
return
;
}
}
...
@@ -517,10 +521,6 @@ public class AppsSettings {
...
@@ -517,10 +521,6 @@ public class AppsSettings {
File
lastDeck
=
new
File
(
path
);
File
lastDeck
=
new
File
(
path
);
String
lastDeckName
=
IOUtils
.
tirmName
(
lastDeck
.
getName
(),
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
(
"我是最后卡组路径+最后分类+最后卡组名"
,
getLastDeckPath
()
+
"以及"
+
getLastCategory
()
+
"以及"
+
getLastDeckName
());
}
}
//获得最后卡组绝对路径
//获得最后卡组绝对路径
...
@@ -545,11 +545,12 @@ public class AppsSettings {
...
@@ -545,11 +545,12 @@ public class AppsSettings {
path
=
getResourcePath
()
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
path
=
getResourcePath
()
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
if
(
TextUtils
.
equals
(
Constants
.
WINDBOT_DECK_PATH
,
Constants
.
PREF_LAST_CATEGORY
)){
}
else
if
(
TextUtils
.
equals
(
Constants
.
WINDBOT_DECK_PATH
,
Constants
.
PREF_LAST_CATEGORY
)){
path
=
getResourcePath
()
+
"/"
+
Constants
.
WINDBOT_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
path
=
getResourcePath
()
+
"/"
+
Constants
.
WINDBOT_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
if
(
TextUtils
.
equals
(
Constants
.
PREF_LAST_CATEGORY
,
null
)){
}
else
if
(
TextUtils
.
equals
(
context
.
getString
(
R
.
string
.
category_Uncategorized
),
Constants
.
PREF_LAST_CATEGORY
)){
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
else
{
}
else
{
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
path
=
getResourcePath
()
+
"/"
+
Constants
.
CORE_DECK_PATH
+
"/"
+
getLastCategory
()
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
}
}
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_DECK_PATH
,
path
);
return
path
;
return
path
;
}
}
...
@@ -619,9 +620,12 @@ public class AppsSettings {
...
@@ -619,9 +620,12 @@ 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
))
{
Log
.
i
(
"我是lastdeck的value"
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
value
);
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
Log
.
i
(
"我是lastcategory的value"
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_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
);
}
}
...
...
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