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
fd4ce275
Commit
fd4ce275
authored
Oct 05, 2019
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setLayout
parent
3a84e840
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+10
-6
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+11
-0
No files found.
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
fd4ce275
...
...
@@ -274,6 +274,7 @@ public class YGOMobileActivity extends NativeActivity implements
replaced
=
true
;
mSurfaceView
.
getHolder
().
addCallback
(
this
);
mSurfaceView
.
requestFocus
();
getWindow
().
setGravity
(
Gravity
.
CENTER
);
}
else
{
mLayout
.
addView
(
view
,
lp
);
getWindow
().
setLayout
(
w
,
h
);
...
...
@@ -285,12 +286,8 @@ public class YGOMobileActivity extends NativeActivity implements
private
void
changeGameSize
(){
//游戏大小
int
[]
size
=
getGameSize
();
int
w
=
mLayout
.
getMeasuredWidth
();
int
h
=
mLayout
.
getMeasuredHeight
();
if
(
w
==
0
||
h
==
0
){
w
=
(
int
)
app
().
getScreenHeight
();
h
=
(
int
)
app
().
getScreenWidth
();
}
int
w
=
(
int
)
app
().
getScreenHeight
();
int
h
=
(
int
)
app
().
getScreenWidth
();
int
spX
=
(
int
)
((
w
-
size
[
0
])
/
2.0f
);
int
spY
=
(
int
)
((
h
-
size
[
1
])
/
2.0f
);
// Log.i("ygo", "Android command 1:posX=" + spX + ",posY=" + spY);
...
...
@@ -306,6 +303,13 @@ public class YGOMobileActivity extends NativeActivity implements
// Log.i("ygo", "Android command setInputFix2:posX=" + spX + ",posY=" + spY);
IrrlichtBridge
.
setInputFix
(
mPositionX
,
mPositionY
);
}
if
(
app
().
isKeepScale
())
{
//设置为屏幕宽高
getWindow
().
setLayout
(
w
,
h
);
}
else
{
//拉伸,画布设置为游戏宽高
getWindow
().
setLayout
(
size
[
0
],
size
[
1
]);
}
}
private
void
initExtraView
()
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
fd4ce275
...
...
@@ -12,14 +12,17 @@ import org.json.JSONArray;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Locale
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.preference.PreferenceFragmentPlus
;
import
cn.garymb.ygomobile.utils.DeckUtil
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_DECK_PATH
;
...
...
@@ -183,6 +186,14 @@ public class AppsSettings {
//刘海高度
ret
-=
getNotchHeight
();
}
if
(
BuildConfig
.
DEBUG
)
{
try
{
FileLogUtil
.
write
(
"\n===============================getScreenHeight:real.w="
+
mRealScreenSize
.
x
+
",real.h="
+
mRealScreenSize
.
y
+
",cur.w="
+
mScreenSize
.
x
+
",cur.h="
+
mScreenSize
.
y
+
",nh="
+
getNotchHeight
()+
",ret="
+
ret
+
"\n"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
ret
;
}
...
...
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