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
5a50a7df
Commit
5a50a7df
authored
Jul 23, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getAiDeckDir为WINDBOT_PATH
arrange strings.xml
parent
b48921de
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
20 deletions
+30
-20
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+7
-8
mobile/src/main/java/cn/garymb/ygomobile/utils/DeckUtil.java
mobile/src/main/java/cn/garymb/ygomobile/utils/DeckUtil.java
+14
-12
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+3
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+3
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+3
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
5a50a7df
...
@@ -46,12 +46,11 @@ public class AppsSettings {
...
@@ -46,12 +46,11 @@ public class AppsSettings {
private
float
mScreenHeight
,
mScreenWidth
,
mDensity
;
private
float
mScreenHeight
,
mScreenWidth
,
mDensity
;
private
AppsSettings
(
Context
context
)
{
private
AppsSettings
(
Context
context
)
{
this
.
context
=
context
;
this
.
context
=
context
;
mSharedPreferences
=
PreferenceFragmentPlus
.
SharedPreferencesPlus
.
create
(
context
,
context
.
getPackageName
()
+
".settings"
);
mSharedPreferences
=
PreferenceFragmentPlus
.
SharedPreferencesPlus
.
create
(
context
,
context
.
getPackageName
()
+
".settings"
);
mSharedPreferences
.
setAutoSave
(
true
);
mSharedPreferences
.
setAutoSave
(
true
);
Log
.
e
(
"YGOMobileLog"
,
"初始化类地址: "
+
System
.
identityHashCode
(
this
));
Log
.
e
(
"YGOMobileLog"
,
"初始化类地址: "
+
System
.
identityHashCode
(
this
));
update
(
context
);
update
(
context
);
}
}
...
@@ -79,9 +78,9 @@ public class AppsSettings {
...
@@ -79,9 +78,9 @@ public class AppsSettings {
if
(
dm
!=
null
)
{
if
(
dm
!=
null
)
{
int
height
=
Math
.
max
(
dm
.
widthPixels
,
dm
.
heightPixels
);
int
height
=
Math
.
max
(
dm
.
widthPixels
,
dm
.
heightPixels
);
Log
.
e
(
"YGOMobileLog"
,
"类地址"
+
System
.
identityHashCode
(
this
));
Log
.
e
(
"YGOMobileLog"
,
"类地址"
+
System
.
identityHashCode
(
this
));
int
notchHeight
=
getNotchHeight
();
int
notchHeight
=
getNotchHeight
();
try
{
try
{
FileLogUtil
.
writeAndTime
(
"是否沉浸: "
+
isImmerSiveMode
());
FileLogUtil
.
writeAndTime
(
"是否沉浸: "
+
isImmerSiveMode
());
...
@@ -89,7 +88,7 @@ public class AppsSettings {
...
@@ -89,7 +88,7 @@ public class AppsSettings {
FileLogUtil
.
writeAndTime
(
"原始宽: "
+
mScreenWidth
);
FileLogUtil
.
writeAndTime
(
"原始宽: "
+
mScreenWidth
);
FileLogUtil
.
writeAndTime
(
"界面长: "
+
dm
.
heightPixels
);
FileLogUtil
.
writeAndTime
(
"界面长: "
+
dm
.
heightPixels
);
FileLogUtil
.
writeAndTime
(
"界面宽: "
+
dm
.
widthPixels
);
FileLogUtil
.
writeAndTime
(
"界面宽: "
+
dm
.
widthPixels
);
FileLogUtil
.
writeAndTime
(
"刘海长: "
+
notchHeight
);
FileLogUtil
.
writeAndTime
(
"刘海长: "
+
notchHeight
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -147,7 +146,7 @@ public class AppsSettings {
...
@@ -147,7 +146,7 @@ public class AppsSettings {
return
mSharedPreferences
.
getInt
(
PREF_NOTCH_HEIGHT
,
DEF_PREF_NOTCH_HEIGHT
);
return
mSharedPreferences
.
getInt
(
PREF_NOTCH_HEIGHT
,
DEF_PREF_NOTCH_HEIGHT
);
}
}
public
void
setNotchHeight
(
int
height
){
public
void
setNotchHeight
(
int
height
)
{
mSharedPreferences
.
putInt
(
PREF_NOTCH_HEIGHT
,
height
);
mSharedPreferences
.
putInt
(
PREF_NOTCH_HEIGHT
,
height
);
}
}
...
@@ -469,7 +468,7 @@ public class AppsSettings {
...
@@ -469,7 +468,7 @@ public class AppsSettings {
//获取ai卡组文件夹
//获取ai卡组文件夹
public
String
getAiDeckDir
()
{
public
String
getAiDeckDir
()
{
return
new
File
(
getResourcePath
(),
Constants
.
CORE_DECK_PATH
+
"/Decks"
).
getAbsolutePath
();
return
new
File
(
getResourcePath
(),
Constants
.
WINDBOT_PATH
+
"/Decks"
).
getAbsolutePath
();
}
}
//获取新卡卡包文件夹
//获取新卡卡包文件夹
...
@@ -478,7 +477,7 @@ public class AppsSettings {
...
@@ -478,7 +477,7 @@ public class AppsSettings {
}
}
//获取临时存放卡组的目录
//获取临时存放卡组的目录
public
String
getCacheDeckDir
(){
public
String
getCacheDeckDir
()
{
return
context
.
getExternalFilesDir
(
"cacheDeck"
).
getAbsolutePath
();
return
context
.
getExternalFilesDir
(
"cacheDeck"
).
getAbsolutePath
();
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/DeckUtil.java
View file @
5a50a7df
package
cn.garymb.ygomobile.utils
;
package
cn.garymb.ygomobile.utils
;
import
android.content.Context
;
import
android.os.Build
;
import
android.os.Build
;
import
java.io.File
;
import
java.io.File
;
...
@@ -15,14 +16,15 @@ import cn.garymb.ygomobile.AppsSettings;
...
@@ -15,14 +16,15 @@ import cn.garymb.ygomobile.AppsSettings;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.bean.DeckType
;
import
cn.garymb.ygomobile.bean.DeckType
;
import
cn.garymb.ygomobile.bean.events.DeckFile
;
import
cn.garymb.ygomobile.bean.events.DeckFile
;
import
cn.garymb.ygomobile.lite.R
;
public
class
DeckUtil
{
public
class
DeckUtil
{
public
static
List
<
DeckType
>
getDeckTypeList
()
{
public
static
List
<
DeckType
>
getDeckTypeList
(
Context
context
)
{
List
<
DeckType
>
deckTypeList
=
new
ArrayList
<>();
List
<
DeckType
>
deckTypeList
=
new
ArrayList
<>();
deckTypeList
.
add
(
new
DeckType
(
"卡包展示"
,
AppsSettings
.
get
().
getPackDeckDir
()));
deckTypeList
.
add
(
new
DeckType
(
context
.
getResources
().
getString
(
R
.
string
.
category_pack
)
,
AppsSettings
.
get
().
getPackDeckDir
()));
deckTypeList
.
add
(
new
DeckType
(
"人机卡组"
,
AppsSettings
.
get
().
getAiDeckDir
()));
deckTypeList
.
add
(
new
DeckType
(
context
.
getResources
().
getString
(
R
.
string
.
category_windbot_deck
)
,
AppsSettings
.
get
().
getAiDeckDir
()));
deckTypeList
.
add
(
new
DeckType
(
"未分类"
,
AppsSettings
.
get
().
getDeckDir
()));
deckTypeList
.
add
(
new
DeckType
(
context
.
getResources
().
getString
(
R
.
string
.
category_Uncategorized
)
,
AppsSettings
.
get
().
getDeckDir
()));
File
[]
files
=
new
File
(
AppsSettings
.
get
().
getDeckDir
()).
listFiles
();
File
[]
files
=
new
File
(
AppsSettings
.
get
().
getDeckDir
()).
listFiles
();
if
(
files
!=
null
)
{
if
(
files
!=
null
)
{
...
@@ -38,7 +40,7 @@ public class DeckUtil {
...
@@ -38,7 +40,7 @@ public class DeckUtil {
public
static
List
<
DeckFile
>
getDeckList
(
String
path
)
{
public
static
List
<
DeckFile
>
getDeckList
(
String
path
)
{
List
<
DeckFile
>
deckList
=
new
ArrayList
<>();
List
<
DeckFile
>
deckList
=
new
ArrayList
<>();
File
[]
files
=
new
File
(
path
).
listFiles
();
File
[]
files
=
new
File
(
path
).
listFiles
();
if
(
files
!=
null
){
if
(
files
!=
null
)
{
for
(
File
file
:
files
)
{
for
(
File
file
:
files
)
{
if
(
file
.
isFile
()
&&
file
.
getName
().
endsWith
(
".ydk"
))
{
if
(
file
.
isFile
()
&&
file
.
getName
().
endsWith
(
".ydk"
))
{
deckList
.
add
(
new
DeckFile
(
file
));
deckList
.
add
(
new
DeckFile
(
file
));
...
@@ -49,10 +51,10 @@ public class DeckUtil {
...
@@ -49,10 +51,10 @@ public class DeckUtil {
}
}
public
static
List
<
DeckFile
>
getExpansionsDeckList
()
throws
IOException
{
public
static
List
<
DeckFile
>
getExpansionsDeckList
()
throws
IOException
{
AppsSettings
appsSettings
=
AppsSettings
.
get
();
AppsSettings
appsSettings
=
AppsSettings
.
get
();
List
<
DeckFile
>
deckList
=
new
ArrayList
<>();
List
<
DeckFile
>
deckList
=
new
ArrayList
<>();
File
[]
files
=
new
File
(
appsSettings
.
getExpansionsPath
(),
Constants
.
CORE_DECK_PATH
).
listFiles
();
File
[]
files
=
new
File
(
appsSettings
.
getExpansionsPath
(),
Constants
.
CORE_DECK_PATH
).
listFiles
();
if
(
files
!=
null
)
{
if
(
files
!=
null
)
{
for
(
File
file
:
files
)
{
for
(
File
file
:
files
)
{
if
(
file
.
isFile
()
&&
file
.
getName
().
endsWith
(
".ydk"
))
{
if
(
file
.
isFile
()
&&
file
.
getName
().
endsWith
(
".ydk"
))
{
deckList
.
add
(
new
DeckFile
(
file
));
deckList
.
add
(
new
DeckFile
(
file
));
...
@@ -66,13 +68,13 @@ public class DeckUtil {
...
@@ -66,13 +68,13 @@ public class DeckUtil {
Enumeration
entries
=
zipFile
.
entries
();
Enumeration
entries
=
zipFile
.
entries
();
while
(
entries
.
hasMoreElements
())
{
while
(
entries
.
hasMoreElements
())
{
ZipEntry
entry
=
(
ZipEntry
)
entries
.
nextElement
();
ZipEntry
entry
=
(
ZipEntry
)
entries
.
nextElement
();
if
(
entry
.
getName
().
endsWith
(
".ydk"
)){
if
(
entry
.
getName
().
endsWith
(
".ydk"
))
{
String
name
=
entry
.
getName
();
String
name
=
entry
.
getName
();
name
=
name
.
substring
(
name
.
lastIndexOf
(
"/"
),
name
.
length
());
name
=
name
.
substring
(
name
.
lastIndexOf
(
"/"
),
name
.
length
());
InputStream
inputStream
=
zipFile
.
getInputStream
(
entry
);
InputStream
inputStream
=
zipFile
.
getInputStream
(
entry
);
deckList
.
add
(
new
DeckFile
(
deckList
.
add
(
new
DeckFile
(
IOUtils
.
asFile
(
inputStream
,
IOUtils
.
asFile
(
inputStream
,
appsSettings
.
getCacheDeckDir
()
+
"/"
+
name
)));
appsSettings
.
getCacheDeckDir
()
+
"/"
+
name
)));
}
}
}
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
5a50a7df
...
@@ -251,4 +251,7 @@
...
@@ -251,4 +251,7 @@
<string
name=
"save_n_open"
>
저장후 열기
</string>
<string
name=
"save_n_open"
>
저장후 열기
</string>
<string
name=
"searchresult"
>
결과
</string>
<string
name=
"searchresult"
>
결과
</string>
<string
name=
"Pre_share"
>
공유 준비
</string>
<string
name=
"Pre_share"
>
공유 준비
</string>
<string
name=
"category_pack"
>
한 갑
</string>
<string
name=
"category_windbot_deck"
>
AI 덱
</string>
<string
name=
"category_Uncategorized"
>
분류되지 않은
</string>
</resources>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
5a50a7df
...
@@ -250,4 +250,7 @@
...
@@ -250,4 +250,7 @@
<string
name=
"save_n_open"
>
保存并打开
</string>
<string
name=
"save_n_open"
>
保存并打开
</string>
<string
name=
"searchresult"
>
搜索结果
</string>
<string
name=
"searchresult"
>
搜索结果
</string>
<string
name=
"Pre_share"
>
准备分享,请稍候……
</string>
<string
name=
"Pre_share"
>
准备分享,请稍候……
</string>
<string
name=
"category_pack"
>
卡包展示
</string>
<string
name=
"category_windbot_deck"
>
人机卡组
</string>
<string
name=
"category_Uncategorized"
>
未分类卡组
</string>
</resources>
</resources>
mobile/src/main/res/values/strings.xml
View file @
5a50a7df
...
@@ -253,4 +253,7 @@
...
@@ -253,4 +253,7 @@
<string
name=
"save_n_open"
>
Save and Open
</string>
<string
name=
"save_n_open"
>
Save and Open
</string>
<string
name=
"searchresult"
>
Results
</string>
<string
name=
"searchresult"
>
Results
</string>
<string
name=
"Pre_share"
>
Prepare to Share
</string>
<string
name=
"Pre_share"
>
Prepare to Share
</string>
<string
name=
"category_pack"
>
Pack
</string>
<string
name=
"category_windbot_deck"
>
BotDeck
</string>
<string
name=
"category_Uncategorized"
>
UncategorizedDeck
</string>
</resources>
</resources>
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