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
1ccf21da
Commit
1ccf21da
authored
Nov 01, 2018
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认数据库路径改为外置ygocore文件夹
去除进入软件时没有更新的提示 设置额外卡库时重新加载卡片数据库
parent
e0094bd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+6
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+5
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+6
-1
mobile/src/main/java/ocgcore/CardManager.java
mobile/src/main/java/ocgcore/CardManager.java
+1
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
1ccf21da
...
...
@@ -20,6 +20,7 @@ import java.util.Locale;
import
cn.garymb.ygomobile.ui.preference.PreferenceFragmentPlus
;
import
cn.garymb.ygomobile.utils.SystemUtils
;
import
ocgcore.CardManager
;
import
ocgcore.DataManager
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_EXPANSIONS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SYSTEM_PATH
;
...
...
@@ -302,7 +303,9 @@ public class AppsSettings {
if
(
isUseExtraCards
())
{
return
getResourcePath
();
}
else
{
return
getDataBaseDefault
();
//返回游戏根目录,即ygocore文件夹
return
getResourcePath
();
// return getDataBaseDefault();
}
}
...
...
@@ -323,7 +326,7 @@ public class AppsSettings {
}
/***
*
使用外置数据库文件夹
*
是否使用额外卡库
*/
public
boolean
isUseExtraCards
()
{
return
mSharedPreferences
.
getBoolean
(
Constants
.
PREF_USE_EXTRA_CARD_CARDS
,
Constants
.
PREF_DEF_USE_EXTRA_CARD_CARDS
);
...
...
@@ -334,7 +337,7 @@ public class AppsSettings {
}
/***
*
使用外置数据库文件夹
*
设置是否使用额外卡库
*/
public
void
setUseExtraCards
(
boolean
useExtraCards
)
{
mSharedPreferences
.
putBoolean
(
Constants
.
PREF_USE_EXTRA_CARD_CARDS
,
useExtraCards
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
1ccf21da
...
...
@@ -111,7 +111,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
//trpay
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
//autoupadte checking
checkPgyerUpdateSilent
(
getContext
());
checkPgyerUpdateSilent
(
getContext
()
,
false
);
//ServiceDuelAssistant
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
this
.
startForegroundService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
...
...
@@ -399,7 +399,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
mMenuIds
.
put
(
mMenuIds
.
size
(),
menuId
);
}
public
static
void
checkPgyerUpdateSilent
(
Context
context
)
{
public
static
void
checkPgyerUpdateSilent
(
Context
context
,
boolean
isToastNoUpdata
)
{
final
DialogPlus
builder
=
new
DialogPlus
(
context
);;
//蒲公英自动检查更新
new
PgyUpdateManager
.
Builder
()
...
...
@@ -409,7 +409,9 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
.
setUpdateManagerListener
(
new
UpdateManagerListener
()
{
@Override
public
void
onNoUpdateAvailable
()
{
Toast
.
makeText
(
context
,
R
.
string
.
Already_Lastest
,
Toast
.
LENGTH_SHORT
).
show
();
if
(
isToastNoUpdata
)
{
Toast
.
makeText
(
context
,
R
.
string
.
Already_Lastest
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
public
void
onUpdateAvailable
(
AppBean
appBean
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
1ccf21da
...
...
@@ -157,6 +157,11 @@ public class SettingFragment extends PreferenceFragmentPlus {
if
(
preference
instanceof
CheckBoxPreference
)
{
CheckBoxPreference
checkBoxPreference
=
(
CheckBoxPreference
)
preference
;
mSharedPreferences
.
edit
().
putBoolean
(
preference
.
getKey
(),
checkBoxPreference
.
isChecked
()).
apply
();
//如果事设置额外卡库的选项
if
(
preference
.
getKey
().
equals
(
PREF_READ_EX
)){
//设置使用额外卡库后重新加载卡片数据
DataManager
.
get
().
load
(
true
);
}
return
true
;
}
boolean
rs
=
super
.
onPreferenceChange
(
preference
,
value
);
...
...
@@ -181,7 +186,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
.
show
();
}
if
(
PREF_CHECK_UPDATE
.
equals
(
preference
.
getKey
()))
{
HomeActivity
.
checkPgyerUpdateSilent
(
getContext
());
HomeActivity
.
checkPgyerUpdateSilent
(
getContext
()
,
true
);
}
if
(
PREF_PENDULUM_SCALE
.
equals
(
key
))
{
CheckBoxPreference
checkBoxPreference
=
(
CheckBoxPreference
)
preference
;
...
...
mobile/src/main/java/ocgcore/CardManager.java
View file @
1ccf21da
...
...
@@ -37,6 +37,7 @@ public class CardManager {
@WorkerThread
public
void
loadCards
()
{
cardDataHashMap
.
clear
();
int
count
=
readAllCards
(
AppsSettings
.
get
().
getDataBaseFile
(),
cardDataHashMap
);
Log
.
i
(
"Irrlicht"
,
"load defualt cdb:"
+
count
);
if
(
AppsSettings
.
get
().
isReadExpansions
())
{
...
...
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