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
88811777
Commit
88811777
authored
Jul 14, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改头像功能
parent
2c79768b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+2
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+32
-1
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-0
mobile/src/main/res/xml/preference_game.xml
mobile/src/main/res/xml/preference_game.xml
+5
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
88811777
...
@@ -44,7 +44,7 @@ public interface Constants {
...
@@ -44,7 +44,7 @@ public interface Constants {
boolean
PREF_DEF_DECK_DELETE_DILAOG
=
true
;
boolean
PREF_DEF_DECK_DELETE_DILAOG
=
true
;
String
SETTINGS_COVER
=
"settings_game_diy_card_cover"
;
String
SETTINGS_COVER
=
"settings_game_diy_card_cover"
;
String
SETTINGS_
COVER2
=
"settings_game_diy_card_cover2
"
;
String
SETTINGS_
AVATAR
=
"settings_game_avatar
"
;
String
SETTINGS_CARD_BG
=
"settings_game_diy_card_bg"
;
String
SETTINGS_CARD_BG
=
"settings_game_diy_card_bg"
;
String
ASSETS_PATH
=
"data/"
;
String
ASSETS_PATH
=
"data/"
;
String
ASSET_SERVER_LIST
=
"serverlist.xml"
;
String
ASSET_SERVER_LIST
=
"serverlist.xml"
;
...
@@ -81,6 +81,7 @@ public interface Constants {
...
@@ -81,6 +81,7 @@ public interface Constants {
String
YDK_FILE_EX
=
".ydk"
;
String
YDK_FILE_EX
=
".ydk"
;
int
[]
CORE_SKIN_BG_SIZE
=
new
int
[]{
1280
,
720
};
int
[]
CORE_SKIN_BG_SIZE
=
new
int
[]{
1280
,
720
};
int
[]
CORE_SKIN_CARD_COVER_SIZE
=
new
int
[]{
177
,
254
};
int
[]
CORE_SKIN_CARD_COVER_SIZE
=
new
int
[]{
177
,
254
};
int
[]
CORE_SKIN_AVATAR_SIZE
=
new
int
[]{
128
,
128
};
boolean
SUPPORT_BPG
=
true
;
boolean
SUPPORT_BPG
=
true
;
String
BPG
=
".bpg"
;
String
BPG
=
".bpg"
;
int
CARD_MAX_COUNT
=
3
;
int
CARD_MAX_COUNT
=
3
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
88811777
...
@@ -45,6 +45,7 @@ import ocgcore.ConfigManager;
...
@@ -45,6 +45,7 @@ import ocgcore.ConfigManager;
import
static
android
.
R
.
attr
.
key
;
import
static
android
.
R
.
attr
.
key
;
import
static
android
.
R
.
attr
.
packageNames
;
import
static
android
.
R
.
attr
.
packageNames
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_RELOAD
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_RELOAD
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_AVATAR_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_BG_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_BG_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_CARD_COVER_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_CARD_COVER_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHANGE_LOG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHANGE_LOG
;
...
@@ -66,6 +67,7 @@ import static cn.garymb.ygomobile.Constants.PREF_READ_EX;
...
@@ -66,6 +67,7 @@ import static cn.garymb.ygomobile.Constants.PREF_READ_EX;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SENSOR_REFRESH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SENSOR_REFRESH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SOUND_EFFECT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SOUND_EFFECT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_USE_EXTRA_CARD_CARDS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_USE_EXTRA_CARD_CARDS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_AVATAR
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_CARD_BG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_CARD_BG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_COVER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_COVER
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
...
@@ -113,6 +115,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -113,6 +115,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
}
bind
(
PREF_DECK_DELETE_DILAOG
,
mSettings
.
isDialogDelete
());
bind
(
PREF_DECK_DELETE_DILAOG
,
mSettings
.
isDialogDelete
());
//bind(PREF_USE_EXTRA_CARD_CARDS, mSettings.isUseExtraCards());
//bind(PREF_USE_EXTRA_CARD_CARDS, mSettings.isUseExtraCards());
bind
(
SETTINGS_AVATAR
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_ME
).
getAbsolutePath
());
bind
(
SETTINGS_COVER
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_COVER
).
getAbsolutePath
());
bind
(
SETTINGS_COVER
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_COVER
).
getAbsolutePath
());
bind
(
SETTINGS_CARD_BG
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_BG
).
getAbsolutePath
());
bind
(
SETTINGS_CARD_BG
,
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_BG
).
getAbsolutePath
());
bind
(
PREF_FONT_SIZE
,
mSettings
.
getFontSize
());
bind
(
PREF_FONT_SIZE
,
mSettings
.
getFontSize
());
...
@@ -186,7 +189,34 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -186,7 +189,34 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
else
if
(
PREF_GAME_FONT
.
equals
(
key
))
{
}
else
if
(
PREF_GAME_FONT
.
equals
(
key
))
{
//选择ttf字体文件,保存
//选择ttf字体文件,保存
showFileChooser
(
preference
,
"*.ttf"
,
mSettings
.
getFontDirPath
(),
getString
(
R
.
string
.
dialog_select_font
));
showFileChooser
(
preference
,
"*.ttf"
,
mSettings
.
getFontDirPath
(),
getString
(
R
.
string
.
dialog_select_font
));
}
else
if
(
SETTINGS_COVER
.
equals
(
key
))
{
}
else
if
(
SETTINGS_AVATAR
.
equals
(
key
))
{
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
dialog
.
setContentView
(
R
.
layout
.
dialog_avatar_select
);
dialog
.
setTitle
(
R
.
string
.
settings_game_avatar
);
dialog
.
show
();
//显示头像图片对话框
View
viewDialog
=
dialog
.
getContentView
();
ImageView
avatar1
=
viewDialog
.
findViewById
(
R
.
id
.
me
);
ImageView
avatar2
=
viewDialog
.
findViewById
(
R
.
id
.
opponent
);
setImage
(
mSettings
.
getCoreSkinPath
()+
"/"
+
Constants
.
CORE_SKIN_AVATAR_ME
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar1
);
setImage
(
mSettings
.
getCoreSkinPath
()+
"/"
+
Constants
.
CORE_SKIN_AVATAR_OPPONENT
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
],
avatar2
);
avatar1
.
setOnClickListener
((
v
)
->
{
//打开系统文件相册
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_ME
).
getAbsolutePath
();
showImageDialog
(
preference
,
getString
(
R
.
string
.
settings_game_avatar
),
outFile
,
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
dialog
.
dismiss
();
});
avatar2
.
setOnClickListener
((
v
)
->
{
//打开系统文件相册
String
outFile
=
new
File
(
mSettings
.
getCoreSkinPath
(),
Constants
.
CORE_SKIN_AVATAR_OPPONENT
).
getAbsolutePath
();
showImageDialog
(
preference
,
getString
(
R
.
string
.
settings_game_avatar
),
outFile
,
true
,
CORE_SKIN_AVATAR_SIZE
[
0
],
CORE_SKIN_AVATAR_SIZE
[
1
]);
dialog
.
dismiss
();
});
}
else
if
(
SETTINGS_COVER
.
equals
(
key
))
{
//显示卡背图片对话框
//显示卡背图片对话框
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
dialog
.
setContentView
(
R
.
layout
.
dialog_cover_select
);
dialog
.
setContentView
(
R
.
layout
.
dialog_cover_select
);
...
@@ -214,6 +244,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -214,6 +244,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
dialog
.
dismiss
();
dialog
.
dismiss
();
});
});
}
else
if
(
SETTINGS_CARD_BG
.
equals
(
key
))
{
}
else
if
(
SETTINGS_CARD_BG
.
equals
(
key
))
{
//显示背景图片对话框
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
final
DialogPlus
dialog
=
new
DialogPlus
(
getContext
());
dialog
.
setContentView
(
R
.
layout
.
dialog_bg_select
);
dialog
.
setContentView
(
R
.
layout
.
dialog_bg_select
);
dialog
.
setTitle
(
R
.
string
.
game_bg
);
dialog
.
setTitle
(
R
.
string
.
game_bg
);
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
88811777
...
@@ -62,6 +62,7 @@
...
@@ -62,6 +62,7 @@
<string
name=
"settings_game_diy_card_db"
>
使用自定义数据库
</string>
<string
name=
"settings_game_diy_card_db"
>
使用自定义数据库
</string>
<string
name=
"settings_game_immersive_mode"
>
在游戏隐藏虚拟键盘
</string>
<string
name=
"settings_game_immersive_mode"
>
在游戏隐藏虚拟键盘
</string>
<string
name=
"settings_game_opengl"
>
OpenGL
</string>
<string
name=
"settings_game_opengl"
>
OpenGL
</string>
<string
name=
"settings_game_avatar"
>
头像图片
</string>
<string
name=
"restart_app"
>
请重启本应用
</string>
<string
name=
"restart_app"
>
请重启本应用
</string>
<string-array
name=
"opengl_version"
>
<string-array
name=
"opengl_version"
>
<item>
OpenGL ES 1.X
</item>
<item>
OpenGL ES 1.X
</item>
...
...
mobile/src/main/res/values/strings.xml
View file @
88811777
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
<string
name=
"settings_game_diy_card_db"
>
Use your own card database
</string>
<string
name=
"settings_game_diy_card_db"
>
Use your own card database
</string>
<string
name=
"settings_game_immersive_mode"
>
Immersive Mode
</string>
<string
name=
"settings_game_immersive_mode"
>
Immersive Mode
</string>
<string
name=
"settings_game_opengl"
>
OpenGL
</string>
<string
name=
"settings_game_opengl"
>
OpenGL
</string>
<string
name=
"settings_game_avatar"
>
Game Avatar
</string>
<string
name=
"settings_author"
translatable=
"false"
>
菜菜、暗星
</string>
<string
name=
"settings_author"
translatable=
"false"
>
菜菜、暗星
</string>
<string
name=
"restart_app"
>
"Please restart app!"
</string>
<string
name=
"restart_app"
>
"Please restart app!"
</string>
<string-array
name=
"opengl_version"
>
<string-array
name=
"opengl_version"
>
...
...
mobile/src/main/res/xml/preference_game.xml
View file @
88811777
...
@@ -82,6 +82,11 @@
...
@@ -82,6 +82,11 @@
android:persistent=
"true"
android:persistent=
"true"
android:title=
"@string/settings_game_font_name"
/>
android:title=
"@string/settings_game_font_name"
/>
<Preference
android:key=
"settings_game_avatar"
android:persistent=
"true"
android:title=
"@string/settings_game_avatar"
/>
<Preference
<Preference
android:key=
"settings_game_diy_card_cover"
android:key=
"settings_game_diy_card_cover"
android:persistent=
"true"
android:persistent=
"true"
...
...
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