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
3726d381
Commit
3726d381
authored
Aug 31, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
从android传key和value到gframe
parent
1493624b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
35 deletions
+20
-35
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+18
-34
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+2
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
3726d381
...
@@ -222,7 +222,6 @@ public class AppsSettings {
...
@@ -222,7 +222,6 @@ public class AppsSettings {
//
//
}
}
for
(
File
file
:
cdbs
)
{
for
(
File
file
:
cdbs
)
{
Log
.
i
(
"合法的数据库才会加载"
,
"菜菜辛苦了"
);
//if (CardManager.checkDataBase(file)) {
//if (CardManager.checkDataBase(file)) {
//合法数据库才会加载
//合法数据库才会加载
pathList
.
add
(
file
.
getAbsolutePath
());
pathList
.
add
(
file
.
getAbsolutePath
());
...
@@ -510,36 +509,32 @@ public class AppsSettings {
...
@@ -510,36 +509,32 @@ public class AppsSettings {
return
;
return
;
}
}
//保存最后卡组绝对路径
//保存最后卡组绝对路径
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_
YDK
,
path
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_
DECK_PATH
,
path
);
//保存最后分类名
//保存最后分类名
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
DeckUtil
.
getDeckTypeName
(
path
));
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_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
(),
Constants
.
YDK_FILE_EX
);
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
Log
.
i
(
"我是最后卡组+最后分类+最后卡组名"
,
path
+
"以及"
+
DeckUtil
.
getDeckTypeName
(
path
)
+
"以及"
+
lastDeckName
);
Log
.
i
(
"我是最后卡组路径+最后分类+最后卡组名"
,
getLastDeckPath
()
+
"以及"
+
getLastCategory
()
+
"以及"
+
getLastDeckName
());
}
}
//获得最后卡组绝对路径
//获得最后卡组绝对路径
public
String
getLastDeckPath
()
{
public
String
getLastDeckPath
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_
YDK
,
Constants
.
PREF_DEF_LAST_YDK
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_
DECK_PATH
,
null
);
}
}
//获得最后分类名
//获得最后分类名
public
String
getLastCategory
(
String
path
)
{
public
String
getLastCategory
()
{
String
lastCategoryName
=
DeckUtil
.
getDeckTypeName
(
path
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
null
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
lastCategoryName
);
}
}
//获得最后卡组名
//获得最后卡组名
public
String
getLastDeckName
(
String
path
)
{
public
String
getLastDeckName
()
{
File
lastDeck
=
new
File
(
path
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
null
);
String
lastDeckName
=
IOUtils
.
tirmName
(
lastDeck
.
getName
(),
Constants
.
YDK_FILE_EX
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
}
public
String
getCurLastCategory
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
null
);
}
}
public
void
saveIntSettings
(
String
key
,
int
value
)
{
public
void
saveIntSettings
(
String
key
,
int
value
)
{
...
@@ -607,33 +602,22 @@ public class AppsSettings {
...
@@ -607,33 +602,22 @@ public class AppsSettings {
}*/
}*/
public
void
saveSettings
(
String
key
,
String
value
)
{
public
void
saveSettings
(
String
key
,
String
value
)
{
Log
.
i
(
"我是key+value"
,
key
+
"+"
+
value
);
if
(
"lastdeck"
.
equals
(
key
))
{
if
(
"lastdeck"
.
equals
(
key
)
||
"lastcategory"
.
equals
(
key
))
{
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_YDK
,
value
);
setLastDeckPath
(
value
);
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
value
);
}
else
{
}
else
{
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
}
}
}
}
public
String
getSettings
(
String
key
)
{
public
String
getSettings
(
String
key
)
{
String
val
;
if
(
"lastdeck"
.
equals
(
key
))
{
if
(
"lastdeck"
.
equals
(
key
))
{
String
val
=
getLastDeckPath
();
val
=
getLastDeckName
();
return
val
;
return
val
;
}
}
else
if
(
"lastcategory"
.
equals
(
key
))
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_START
+
key
,
null
);
val
=
getLastCategory
();
}
public
void
saveCategorySettings
(
String
key
,
String
value
)
{
if
(
"lastcategory"
.
equals
(
key
))
{
setLastDeckPath
(
value
);
}
else
{
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
}
}
public
String
getCategorySettings
(
String
key
)
{
if
(
"lastcategory"
.
equals
(
key
))
{
String
val
=
getLastCategory
(
key
);
return
val
;
return
val
;
}
}
return
mSharedPreferences
.
getString
(
Constants
.
PREF_START
+
key
,
null
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_START
+
key
,
null
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
3726d381
...
@@ -7,9 +7,10 @@ import cn.garymb.ygomobile.lite.BuildConfig;
...
@@ -7,9 +7,10 @@ import cn.garymb.ygomobile.lite.BuildConfig;
public
interface
Constants
{
public
interface
Constants
{
boolean
DEBUG
=
BuildConfig
.
DEBUG
;
boolean
DEBUG
=
BuildConfig
.
DEBUG
;
String
PREF_START
=
"game_pref_"
;
String
PREF_START
=
"game_pref_"
;
String
PREF_LAST_DECK_PATH
=
"pref_last_deck_path"
;
String
PREF_LAST_YDK
=
"pref_last_ydk"
;
String
PREF_LAST_YDK
=
"pref_last_ydk"
;
String
PREF_DEF_LAST_YDK
=
"new"
;
String
PREF_DEF_LAST_YDK
=
"new"
;
String
PREF_LAST_CATEGORY
=
"pre_last_category"
;
String
PREF_LAST_CATEGORY
=
"pre
f
_last_category"
;
String
PREF_DEF_LAST_CATEGORY
=
"newcate"
;
String
PREF_DEF_LAST_CATEGORY
=
"newcate"
;
String
PREF_GAME_PATH
=
"pref_key_game_res_path"
;
String
PREF_GAME_PATH
=
"pref_key_game_res_path"
;
String
PREF_DEF_GAME_DIR
=
"ygocore"
;
String
PREF_DEF_GAME_DIR
=
"ygocore"
;
...
...
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