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
01ac4858
Commit
01ac4858
authored
Aug 29, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存最后卡组绝对路径,分类,卡组名
parent
d42d7ebe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+15
-15
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
...cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
01ac4858
...
@@ -18,8 +18,11 @@ import java.util.Arrays;
...
@@ -18,8 +18,11 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
cn.garymb.ygomobile.bean.DeckInfo
;
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.FileLogUtil
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
cn.garymb.ygomobile.utils.SystemUtils
;
import
cn.garymb.ygomobile.utils.SystemUtils
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_EXPANSIONS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_EXPANSIONS
;
...
@@ -506,18 +509,26 @@ public class AppsSettings {
...
@@ -506,18 +509,26 @@ public class AppsSettings {
}
}
/***
/***
* 保存最后卡组绝对路径
* 保存最后卡组绝对路径
、分类、卡组名
*/
*/
public
void
setLastDeckPath
(
String
path
)
{
public
void
setLastDeckPath
(
String
path
)
{
if
(
TextUtils
.
equals
(
path
,
getCurLastDeck
()))
{
if
(
TextUtils
.
equals
(
path
,
getCurLastDeck
()))
{
//一样
//一样
return
;
return
;
}
}
//保存最后卡组绝对路径
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
path
);
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_YDK
,
path
);
//保存最后分类名
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
DeckUtil
.
getDeckTypeName
(
path
));
//保存最后卡组名
File
lastDeck
=
new
File
(
path
);
String
lastDeckName
=
IOUtils
.
tirmName
(
lastDeck
.
getName
(),
Constants
.
YDK_FILE_EX
);
mSharedPreferences
.
putString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
Log
.
i
(
"我是最后卡组+最后分类+最后卡组名"
,
path
+
"以及"
+
DeckUtil
.
getDeckTypeName
(
path
)
+
"以及"
+
lastDeckName
);
}
}
public
String
getCurLastDeck
()
{
public
String
getCurLastDeck
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_YDK
,
null
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_
DEF_
LAST_YDK
,
null
);
}
}
/***
/***
...
@@ -527,19 +538,8 @@ public class AppsSettings {
...
@@ -527,19 +538,8 @@ public class AppsSettings {
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_CATEGORY
,
Constants
.
PREF_DEF_LAST_CATEGORY
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_CATEGORY
,
Constants
.
PREF_DEF_LAST_CATEGORY
);
}
}
/***
* 保存最后卡组分类名
*/
public
void
setLastCategory
(
String
name
)
{
if
(
TextUtils
.
equals
(
name
,
getCurLastCategory
()))
{
//一样
return
;
}
mSharedPreferences
.
putString
(
Constants
.
PREF_LAST_CATEGORY
,
name
);
}
public
String
getCurLastCategory
()
{
public
String
getCurLastCategory
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_CATEGORY
,
null
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_
DEF_
LAST_CATEGORY
,
null
);
}
}
public
void
saveIntSettings
(
String
key
,
int
value
)
{
public
void
saveIntSettings
(
String
key
,
int
value
)
{
...
@@ -624,7 +624,7 @@ public class AppsSettings {
...
@@ -624,7 +624,7 @@ public class AppsSettings {
public
void
saveCategorySettings
(
String
key
,
String
value
)
{
public
void
saveCategorySettings
(
String
key
,
String
value
)
{
if
(
"lastcategory"
.
equals
(
key
))
{
if
(
"lastcategory"
.
equals
(
key
))
{
setLast
Category
(
value
);
setLast
DeckPath
(
value
);
}
else
{
}
else
{
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
View file @
01ac4858
...
@@ -296,7 +296,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
...
@@ -296,7 +296,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
// if (inDeckDir(file)) {
// if (inDeckDir(file)) {
//记住最后打开的卡组
//记住最后打开的卡组
mSettings
.
setLastDeckPath
(
file
.
getAbsolutePath
());
mSettings
.
setLastDeckPath
(
file
.
getAbsolutePath
());
mSettings
.
setLastCategory
(
DeckUtil
.
getDeckTypeName
(
file
.
getAbsolutePath
()));
tv_deck
.
setText
(
name
);
tv_deck
.
setText
(
name
);
// }
// }
}
else
{
}
else
{
...
...
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