Status Update
Comments
ar...@google.com <ar...@google.com>
be...@google.com <be...@google.com> #2
there are some image for help
ar...@google.com <ar...@google.com>
ar...@google.com <ar...@google.com> #3
hello?
bo...@unity3d.com <bo...@unity3d.com> #4
Application is obviously not a fullscreen, there is the system bar above the app.
ar...@google.com <ar...@google.com> #5
I created a new app with empty Activity, added logging in onTouchEvent, and the behavior is the same.
Code:
package com.example.fullscreen
import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.fullscreen.ui.theme.FullscreenTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
FullscreenTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
name = "Android",
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
override fun onTouchEvent(event: MotionEvent?): Boolean {
Log.d("fs_test_app", String.format("y=%f rawY=%f", event!!.y, event.rawY))
return super.onTouchEvent(event)
}
}
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
FullscreenTheme {
Greeting("Android")
}
}
output:
2024-10-24 16:17:16.461 1479-1479 fs_test_app com.example.fullscreen D y=225.000000 rawY=225.000000
2024-10-24 16:17:17.569 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.580 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.591 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.602 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.613 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.624 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.635 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.646 1479-1479 fs_test_app com.example.fullscreen D y=211.000000 rawY=211.000000
2024-10-24 16:17:17.938 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:17.949 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:17.960 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:17.971 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:17.983 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:17.987 1479-1479 fs_test_app com.example.fullscreen D y=204.000000 rawY=204.000000
2024-10-24 16:17:33.150 1479-1490 mple.fullscreen com.example.fullscreen I Background concurrent mark compact GC freed 2053KB AllocSpace bytes, 0(0B) LOS objects, 87% free, 3619KB/27MB, paused 264us,5.786ms total 83.692ms
2024-10-24 16:17:46.488 1479-1489 mple.fullscreen com.example.fullscreen W Missing inline cache for long androidx.compose.ui.node.NodeCoordinator.localPositionOf-R5De75A(androidx.compose.ui.layout.LayoutCoordinates, long)
2024-10-24 16:17:46.489 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.505 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.523 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.540 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.551 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.562 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.573 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
2024-10-24 16:17:46.578 1479-1479 fs_test_app com.example.fullscreen D y=1218.000000 rawY=1218.000000
Screenshot is attached. App is not fullscreen, but Y coordinates are the same.
bo...@unity3d.com <bo...@unity3d.com> #6
I'm going to prepare simple Unity project to demonstrate the difference between Activity and GameActivity, export grade project from it and attach to this bug report.
ar...@google.com <ar...@google.com> #7
Same in fullscreen, coordinates are the same:
y=688.000000 rawY=688.000000
Unity project is too big, and there is a lot happening behind the curtains. Can you repro the problem with the Empty Activity app?
bo...@unity3d.com <bo...@unity3d.com> #8
but anyway, this can't be expected behaviour, according to
bo...@unity3d.com <bo...@unity3d.com> #9
However Unity is using FULLSCREEN flag for the Window, we have this call:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
If add this call to the empty Activity onCreate method, everything starts working as expected, RawY is always greater than Y, when app is running alone, when app is in split screen mode in the upper or in the lower half.
I've tested this on Pixel 6 / Android 15, Samsung S10+ / Android 12, OnePlus 8T / Android 14.
As for the agdlksample, adding the same call to the AGDKTunnelActivity.onCreate method doesn't change anything, RawY is the same as Y when app is running alone (but in this case there is no status bar, so it's expected), or when app is in split screen mode in the upper half (which is not expected).
Also I've found one device which behaves differently - Samsung ZFold2 /Android 11, when running apps on the external (portrait) screen.
On this device agdksample works correctly, RawY is the same as Y when app is running alone (it's expected as there's no status bar), RawY greater than Y when app is in split screen mode in the upper or in the lower half (no need to set fullscreen flags).
Empty Activity application without setting fullscreen flags on this device works correctly in split screen mode, but still RawY is the same as Y when running alone. With setting fullscreen flags, everything always works correctly, just like on other devices.
ar...@google.com <ar...@google.com> #10
The same values can be logged if add onTouchEvent method with logging event.getRawY() and event.getY() values to
https://github.com/android/games-samples/blob/main/agdk/agdktunnel/app/src/main/java/com/google/sample/agdktunnel/AGDKTunnelActivity.java
Since you mentioned that input data at Java side is already wrong, this is not an AGDK bug. AGDK is a set of native libraries that serves as an bridge to use Java interfaces in C++ projects like games. Unfortunately I can't help here anymore. I'd ask our product managers to find the team which might be able to address this issue.
bo...@unity3d.com <bo...@unity3d.com> #11
ar...@google.com <ar...@google.com> #12
No, this can't be a GameActivity bug because inputs to onTouchEvent are already wrong.
Unfortunately, I don't understand what workaround could be made here. First of all, we want to understand if it's indeed a bug or an expected behavior.
Description
Version used: 3.0.5
Devices/Android versions reproduced on: Google Pixel 6/Android 15, OnePlus 8T/Android 14
- Get agdktunnel sample application (
- Modify AndroidManifest.xml by adding android:resizeableActivity="true" to activity
- Add logging to MotionEvent processing method (
- Build and run application
- Make it run in split screen mode with any other application, so the agdktunnel application is in the lower half of the screen.
- Touch agdktunnel view, closer to the upper border
- Check log, logged RawY and Y values will be different, RawY greater than Y by about 1200
- Make agdktunnel run in split screen mode with any other application, so the agdktunnel application is in the upper half of the screen.
- Touch agdktunnel view, closer to the upper border
- Check log, logged RawY and Y values will be equal, both greater than 128 - this is buggy behavior, expected RawY value greater than Y because of the system bar.
Notes:
- The same values can be logged if add onTouchEvent method with logging event.getRawY() and event.getY() values to
- Bug is not reproducible if use Activity