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
1493624b
Commit
1493624b
authored
Aug 30, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean & log
parent
1a7ae14f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
24 deletions
+15
-24
mobile/src/main/java/cn/garymb/ygomobile/App.java
mobile/src/main/java/cn/garymb/ygomobile/App.java
+7
-3
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+7
-13
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
...cn/garymb/ygomobile/ui/cards/DeckManagerActivityImpl.java
+0
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/PreferenceFragmentPlus.java
...arymb/ygomobile/ui/preference/PreferenceFragmentPlus.java
+1
-7
No files found.
mobile/src/main/java/cn/garymb/ygomobile/App.java
View file @
1493624b
package
cn.garymb.ygomobile
;
package
cn.garymb.ygomobile
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.util.Log
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
androidx.appcompat.app.AppCompatDelegate
;
import
androidx.appcompat.app.AppCompatDelegate
;
...
@@ -23,11 +23,11 @@ public class App extends GameApplication {
...
@@ -23,11 +23,11 @@ public class App extends GameApplication {
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
AppsSettings
.
init
(
this
);
AppsSettings
.
init
(
this
);
//初始化异常工具类
//初始化异常工具类
CrashHandler
crashHandler
=
CrashHandler
.
getInstance
();
CrashHandler
crashHandler
=
CrashHandler
.
getInstance
();
crashHandler
.
init
(
getApplicationContext
());
crashHandler
.
init
(
getApplicationContext
());
if
(
AppsSettings
.
get
().
isSoundEffect
())
{
if
(
AppsSettings
.
get
().
isSoundEffect
())
{
initSoundEffectPool
();
initSoundEffectPool
();
setInitSoundEffectPool
(
true
);
setInitSoundEffectPool
(
true
);
}
}
//初始化图片选择器
//初始化图片选择器
initImgsel
();
initImgsel
();
...
@@ -38,6 +38,7 @@ public class App extends GameApplication {
...
@@ -38,6 +38,7 @@ 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
;
}
}
...
@@ -76,15 +77,18 @@ public class App extends GameApplication {
...
@@ -76,15 +77,18 @@ 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 @
1493624b
...
@@ -499,6 +499,10 @@ public class AppsSettings {
...
@@ -499,6 +499,10 @@ public class AppsSettings {
return
mSharedPreferences
.
getBoolean
(
PREF_SENSOR_REFRESH
,
PREF_DEF_SENSOR_REFRESH
);
return
mSharedPreferences
.
getBoolean
(
PREF_SENSOR_REFRESH
,
PREF_DEF_SENSOR_REFRESH
);
}
}
public
String
getCurLastDeck
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
null
);
}
//保存最后卡组绝对路径、分类、卡组名
//保存最后卡组绝对路径、分类、卡组名
public
void
setLastDeckPath
(
String
path
)
{
public
void
setLastDeckPath
(
String
path
)
{
if
(
TextUtils
.
equals
(
path
,
getCurLastDeck
()))
{
if
(
TextUtils
.
equals
(
path
,
getCurLastDeck
()))
{
...
@@ -534,17 +538,6 @@ public class AppsSettings {
...
@@ -534,17 +538,6 @@ public class AppsSettings {
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
lastDeckName
);
}
}
public
String
getCurLastDeck
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_YDK
,
null
);
}
/***
* 获得最后卡组分类名
*/
public
String
getLastCategory
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_LAST_CATEGORY
,
Constants
.
PREF_DEF_LAST_CATEGORY
);
}
public
String
getCurLastCategory
()
{
public
String
getCurLastCategory
()
{
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
null
);
return
mSharedPreferences
.
getString
(
Constants
.
PREF_DEF_LAST_CATEGORY
,
null
);
}
}
...
@@ -614,7 +607,8 @@ public class AppsSettings {
...
@@ -614,7 +607,8 @@ public class AppsSettings {
}*/
}*/
public
void
saveSettings
(
String
key
,
String
value
)
{
public
void
saveSettings
(
String
key
,
String
value
)
{
if
(
"lastdeck"
.
equals
(
key
))
{
Log
.
i
(
"我是key+value"
,
key
+
"+"
+
value
);
if
(
"lastdeck"
.
equals
(
key
)
||
"lastcategory"
.
equals
(
key
))
{
setLastDeckPath
(
value
);
setLastDeckPath
(
value
);
}
else
{
}
else
{
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
mSharedPreferences
.
putString
(
Constants
.
PREF_START
+
key
,
value
);
...
@@ -639,7 +633,7 @@ public class AppsSettings {
...
@@ -639,7 +633,7 @@ public class AppsSettings {
public
String
getCategorySettings
(
String
key
)
{
public
String
getCategorySettings
(
String
key
)
{
if
(
"lastcategory"
.
equals
(
key
))
{
if
(
"lastcategory"
.
equals
(
key
))
{
String
val
=
getLastCategory
();
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/ui/cards/DeckManagerActivityImpl.java
View file @
1493624b
...
@@ -262,7 +262,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
...
@@ -262,7 +262,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
if
(
file
==
null
)
{
if
(
file
==
null
)
{
return
new
DeckInfo
();
return
new
DeckInfo
();
}
}
Log
.
i
(
"最后分类"
,
mSettings
.
getLastCategory
());
Log
.
i
(
"kk"
,
"load ydk "
+
file
);
Log
.
i
(
"kk"
,
"load ydk "
+
file
);
if
(
mCardLoader
.
isOpen
()
&&
file
.
exists
())
{
if
(
mCardLoader
.
isOpen
()
&&
file
.
exists
())
{
return
mDeckAdapater
.
read
(
mCardLoader
,
file
,
mCardLoader
.
getLimitList
());
return
mDeckAdapater
.
read
(
mCardLoader
,
file
,
mCardLoader
.
getLimitList
());
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/PreferenceFragmentPlus.java
View file @
1493624b
...
@@ -8,7 +8,6 @@ import android.graphics.Color;
...
@@ -8,7 +8,6 @@ import android.graphics.Color;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.preference.Preference
;
import
android.preference.Preference
;
import
android.util.Log
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.yuyh.library.imgsel.ISNav
;
import
com.yuyh.library.imgsel.ISNav
;
...
@@ -18,7 +17,6 @@ import com.yuyh.library.imgsel.ui.ISListActivity;
...
@@ -18,7 +17,6 @@ import com.yuyh.library.imgsel.ui.ISListActivity;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -27,10 +25,7 @@ import cn.garymb.ygomobile.lite.R;
...
@@ -27,10 +25,7 @@ import cn.garymb.ygomobile.lite.R;
import
cn.garymb.ygomobile.ui.file.FileActivity
;
import
cn.garymb.ygomobile.ui.file.FileActivity
;
import
cn.garymb.ygomobile.ui.file.FileOpenType
;
import
cn.garymb.ygomobile.ui.file.FileOpenType
;
import
cn.garymb.ygomobile.utils.FileUtils
;
import
cn.garymb.ygomobile.utils.FileUtils
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
static
android
.
app
.
Activity
.
RESULT_OK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_FILE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_FILE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_FOLDER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_FOLDER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_IMG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
REQUEST_CHOOSE_IMG
;
...
@@ -38,7 +33,6 @@ import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG;
...
@@ -38,7 +33,6 @@ import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG;
public
abstract
class
PreferenceFragmentPlus
extends
BasePreferenceFragment
{
public
abstract
class
PreferenceFragmentPlus
extends
BasePreferenceFragment
{
private
Preference
curPreference
;
private
Preference
curPreference
;
private
CurImageInfo
mCurImageInfo
;
private
CurImageInfo
mCurImageInfo
;
private
Uri
saveimgUri
;
protected
void
onChooseFileOk
(
Preference
preference
,
String
file
)
{
protected
void
onChooseFileOk
(
Preference
preference
,
String
file
)
{
onPreferenceChange
(
preference
,
file
);
onPreferenceChange
(
preference
,
file
);
...
@@ -99,7 +93,7 @@ public abstract class PreferenceFragmentPlus extends BasePreferenceFragment {
...
@@ -99,7 +93,7 @@ public abstract class PreferenceFragmentPlus extends BasePreferenceFragment {
// startActivityForResult(intent, REQUEST_CHOOSE_IMG);
// startActivityForResult(intent, REQUEST_CHOOSE_IMG);
// intent.addCategory(Intent.CATEGORY_OPENABLE);
// intent.addCategory(Intent.CATEGORY_OPENABLE);
//
intent.setType("image/*");
// intent.setType("image/*");
ISListConfig
config
=
new
ISListConfig
.
Builder
()
ISListConfig
config
=
new
ISListConfig
.
Builder
()
// 是否多选, 默认true
// 是否多选, 默认true
.
multiSelect
(
false
)
.
multiSelect
(
false
)
...
...
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