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
14fdeb99
Commit
14fdeb99
authored
Sep 21, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
曲面屏
parent
32845fb4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
4 deletions
+43
-4
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+17
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+2
-0
mobile/src/main/java/cn/garymb/ygomobile/utils/DensityUtils.java
...src/main/java/cn/garymb/ygomobile/utils/DensityUtils.java
+3
-0
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+1
-0
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-0
mobile/src/main/res/values/arrays.xml
mobile/src/main/res/values/arrays.xml
+6
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+7
-0
mobile/src/main/res/xml/preference_game.xml
mobile/src/main/res/xml/preference_game.xml
+6
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
14fdeb99
...
@@ -3,6 +3,7 @@ package cn.garymb.ygomobile;
...
@@ -3,6 +3,7 @@ package cn.garymb.ygomobile;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Point
;
import
android.graphics.Point
;
import
android.os.ParcelFileDescriptor
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
...
@@ -22,6 +23,7 @@ import cn.garymb.ygomobile.core.IrrlichtBridge;
...
@@ -22,6 +23,7 @@ import cn.garymb.ygomobile.core.IrrlichtBridge;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
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.DeckUtil
;
import
cn.garymb.ygomobile.utils.DensityUtils
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_DECK_PATH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_DECK_PATH
;
...
@@ -56,8 +58,8 @@ public class AppsSettings {
...
@@ -56,8 +58,8 @@ public class AppsSettings {
private
static
AppsSettings
sAppsSettings
;
private
static
AppsSettings
sAppsSettings
;
private
final
Point
mScreenSize
=
new
Point
();
private
final
Point
mScreenSize
=
new
Point
();
private
final
Point
mRealScreenSize
=
new
Point
();
private
final
Point
mRealScreenSize
=
new
Point
();
private
Context
context
;
private
final
Context
context
;
private
PreferenceFragmentPlus
.
SharedPreferencesPlus
mSharedPreferences
;
private
final
PreferenceFragmentPlus
.
SharedPreferencesPlus
mSharedPreferences
;
private
float
mDensity
;
private
float
mDensity
;
private
AppsSettings
(
Context
context
)
{
private
AppsSettings
(
Context
context
)
{
...
@@ -160,6 +162,15 @@ public class AppsSettings {
...
@@ -160,6 +162,15 @@ public class AppsSettings {
return
mSharedPreferences
.
getBoolean
(
PREF_KEEP_SCALE
,
DEF_PREF_KEEP_SCALE
);
return
mSharedPreferences
.
getBoolean
(
PREF_KEEP_SCALE
,
DEF_PREF_KEEP_SCALE
);
}
}
public
int
getScreenPadding
()
{
//ListPreference都是string
String
str
=
mSharedPreferences
.
getString
(
PREF_WINDOW_TOP_BOTTOM
,
null
);
if
(!
TextUtils
.
isEmpty
(
str
)
&&
TextUtils
.
isDigitsOnly
(
str
))
{
return
Integer
.
parseInt
(
str
);
}
return
0
;
}
public
float
getScreenWidth
()
{
public
float
getScreenWidth
()
{
int
w
,
h
;
int
w
,
h
;
if
(
isImmerSiveMode
())
{
if
(
isImmerSiveMode
())
{
...
@@ -171,7 +182,8 @@ public class AppsSettings {
...
@@ -171,7 +182,8 @@ public class AppsSettings {
}
}
int
ret
=
Math
.
min
(
w
,
h
);
int
ret
=
Math
.
min
(
w
,
h
);
//测试代码,曲面屏左右2变需要留空白,但是游戏画面比例不对,需要修改c那边代码
//测试代码,曲面屏左右2变需要留空白,但是游戏画面比例不对,需要修改c那边代码
int
fix_h
=
mSharedPreferences
.
getInt
(
PREF_WINDOW_TOP_BOTTOM
,
DEF_PREF_WINDOW_TOP_BOTTOM
);
int
fix_h
=
DensityUtils
.
dp2px
(
context
,
getScreenPadding
());
Log
.
d
(
IrrlichtBridge
.
TAG
,
"screen padding="
+
fix_h
);
return
ret
-
fix_h
*
2
;
return
ret
-
fix_h
*
2
;
}
}
...
@@ -525,7 +537,8 @@ public class AppsSettings {
...
@@ -525,7 +537,8 @@ public class AppsSettings {
}
}
//获得最后卡组绝对路径
//获得最后卡组绝对路径
public
@Nullable
String
getLastDeckPath
()
{
public
@Nullable
String
getLastDeckPath
()
{
String
path
;
String
path
;
if
(
TextUtils
.
equals
(
context
.
getString
(
R
.
string
.
category_pack
),
getLastCategory
()))
{
if
(
TextUtils
.
equals
(
context
.
getString
(
R
.
string
.
category_pack
),
getLastCategory
()))
{
path
=
getResourcePath
()
+
"/"
+
CORE_PACK_PATH
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
path
=
getResourcePath
()
+
"/"
+
CORE_PACK_PATH
+
"/"
+
getLastDeckName
()
+
YDK_FILE_EX
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
14fdeb99
...
@@ -74,6 +74,7 @@ import static cn.garymb.ygomobile.Constants.PREF_READ_EX;
...
@@ -74,6 +74,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_START_SERVICEDUELASSISTANT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_START_SERVICEDUELASSISTANT
;
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
.
PREF_WINDOW_TOP_BOTTOM
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_AVATAR
;
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
;
...
@@ -138,6 +139,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -138,6 +139,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
bind
(
PREF_READ_EX
,
mSettings
.
isReadExpansions
());
bind
(
PREF_READ_EX
,
mSettings
.
isReadExpansions
());
bind
(
PREF_DEL_EX
,
getString
(
R
.
string
.
about_delete_ex
));
bind
(
PREF_DEL_EX
,
getString
(
R
.
string
.
about_delete_ex
));
bind
(
PERF_TEST_REPLACE_KERNEL
,
"需root权限,请在开发者的指导下食用"
);
bind
(
PERF_TEST_REPLACE_KERNEL
,
"需root权限,请在开发者的指导下食用"
);
bind
(
PREF_WINDOW_TOP_BOTTOM
,
""
+
mSettings
.
getScreenPadding
());
Preference
preference
=
findPreference
(
PREF_READ_EX
);
Preference
preference
=
findPreference
(
PREF_READ_EX
);
if
(
preference
!=
null
)
{
if
(
preference
!=
null
)
{
preference
.
setSummary
(
mSettings
.
getExpansionsPath
().
getAbsolutePath
());
preference
.
setSummary
(
mSettings
.
getExpansionsPath
().
getAbsolutePath
());
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/DensityUtils.java
View file @
14fdeb99
...
@@ -7,6 +7,9 @@ public class DensityUtils {
...
@@ -7,6 +7,9 @@ public class DensityUtils {
* dp转px
* dp转px
*/
*/
public
static
int
dp2px
(
Context
ctx
,
float
dp
)
{
public
static
int
dp2px
(
Context
ctx
,
float
dp
)
{
if
(
dp
==
0
){
return
0
;
}
float
density
=
ctx
.
getResources
().
getDisplayMetrics
().
density
;
float
density
=
ctx
.
getResources
().
getDisplayMetrics
().
density
;
int
px
=
(
int
)
(
dp
*
density
+
0.5f
);
// 4.9->5 4.4->4
int
px
=
(
int
)
(
dp
*
density
+
0.5f
);
// 4.9->5 4.4->4
return
px
;
return
px
;
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
14fdeb99
...
@@ -318,4 +318,5 @@
...
@@ -318,4 +318,5 @@
<string
name=
"label_ot_All"
>
모든 카드
</string>
<string
name=
"label_ot_All"
>
모든 카드
</string>
<string
name=
"label_ot_No_Exclusive"
>
ID 없는 카드
</string>
<string
name=
"label_ot_No_Exclusive"
>
ID 없는 카드
</string>
<string
name=
"label_ot_CUSTOM"
>
커스텀 카드
</string>
<string
name=
"label_ot_CUSTOM"
>
커스텀 카드
</string>
<string
name=
"settings_screen_padding"
>
曲面屏预留高度
</string>
</resources>
</resources>
mobile/src/main/res/values-zh/strings.xml
View file @
14fdeb99
...
@@ -318,4 +318,5 @@
...
@@ -318,4 +318,5 @@
<string
name=
"ask_delete_ex"
>
点击确认以清空
</string>
<string
name=
"ask_delete_ex"
>
点击确认以清空
</string>
<string
name=
"about_delete_ex"
>
如果遇到拓展卡包问题时删除是个不错的办法
</string>
<string
name=
"about_delete_ex"
>
如果遇到拓展卡包问题时删除是个不错的办法
</string>
<string
name=
"file_installed"
>
文件已导入
</string>
<string
name=
"file_installed"
>
文件已导入
</string>
<string
name=
"settings_screen_padding"
>
曲面屏预留高度
</string>
</resources>
</resources>
mobile/src/main/res/values/arrays.xml
View file @
14fdeb99
...
@@ -9,6 +9,12 @@
...
@@ -9,6 +9,12 @@
<item>
0
</item>
<item>
0
</item>
<item>
1
</item>
<item>
1
</item>
</string-array>
</string-array>
<string-array
name=
"screen_top_bottom_value"
translatable=
"false"
>
<item>
0
</item>
<item>
5
</item>
<item>
10
</item>
<item>
15
</item>
</string-array>
<string-array
name=
"tips"
tools:ignore=
"InconsistentArrays"
>
<string-array
name=
"tips"
tools:ignore=
"InconsistentArrays"
>
<item>
Duel is One Thing, Kind is Everything
</item>
<item>
Duel is One Thing, Kind is Everything
</item>
<item>
Touching Inaccurately in Duelling? to Ephone「Settings」→「Display」→「NotchDisplay」→「Hide the notch area」
</item>
<item>
Touching Inaccurately in Duelling? to Ephone「Settings」→「Display」→「NotchDisplay」→「Hide the notch area」
</item>
...
...
mobile/src/main/res/values/strings.xml
View file @
14fdeb99
...
@@ -83,6 +83,12 @@
...
@@ -83,6 +83,12 @@
<item>
Speed
</item>
<item>
Speed
</item>
<item>
Quality
</item>
<item>
Quality
</item>
</string-array>
</string-array>
<string-array
name=
"screen_top_bottom_desc"
translatable=
"false"
>
<item>
Disable
</item>
<item>
5
</item>
<item>
10
</item>
<item>
15
</item>
</string-array>
<!-- settings -->
<!-- settings -->
<string
name=
"server_name"
>
Name:
</string>
<string
name=
"server_name"
>
Name:
</string>
...
@@ -321,4 +327,5 @@
...
@@ -321,4 +327,5 @@
<string
name=
"label_ot_CUSTOM"
>
Custom
</string>
<string
name=
"label_ot_CUSTOM"
>
Custom
</string>
<string
name=
"label_ot_No_Exclusive"
>
No exclusive
</string>
<string
name=
"label_ot_No_Exclusive"
>
No exclusive
</string>
<string
name=
"label_ot_SC_OCG"
>
SChinese OCG
</string>
<string
name=
"label_ot_SC_OCG"
>
SChinese OCG
</string>
<string
name=
"settings_screen_padding"
>
Reserved height of curved screen
</string>
</resources>
</resources>
mobile/src/main/res/xml/preference_game.xml
View file @
14fdeb99
...
@@ -37,6 +37,12 @@
...
@@ -37,6 +37,12 @@
android:key=
"pref_settings_keep_scale"
android:key=
"pref_settings_keep_scale"
android:persistent=
"false"
android:persistent=
"false"
android:title=
"@string/about_pref_settings_keep_scale"
/>
android:title=
"@string/about_pref_settings_keep_scale"
/>
<ListPreference
android:entries=
"@array/screen_top_bottom_desc"
android:entryValues=
"@array/screen_top_bottom_value"
android:key=
"pref_settings_window_top_bottom"
android:persistent=
"true"
android:title=
"@string/settings_screen_padding"
/>
<ListPreference
<ListPreference
android:entries=
"@array/opengl_version"
android:entries=
"@array/opengl_version"
...
...
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