Assigned
Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
Can you attach / share a project that reproduces the issue?
al...@google.com <al...@google.com> #3
Now i sure this is viewpager2's bug.
because just occur recyclerview inside viewpager2 with constraintlayout, if paging3 use Independently with viewpage2 it's not problem.
because just occur recyclerview inside viewpager2 with constraintlayout, if paging3 use Independently with viewpage2 it's not problem.
Description
Version used: 1.0.1 / 1.1.0-alpha03
Devices/Android versions reproduced on: Galaxy Watch 4 / R890XXU1EVA8
The shouldAnimate method does not work correctly for the GLES render. If the watch state is changed to ambient (isAmbient=true), I want to continue drawing for 500ms to do an animation. So I return true until the time is over. The render method is called correctly, but the screen content does not update. Below is a code that illustrates this. I set the delay to 10s in the example, so that's easier to identify the issue
var ambientModeStartTime=0L
var isAmbient=false
override fun shouldAnimate(): Boolean {
val default=super.shouldAnimate()
if (watchState.isAmbient.value!=null) {
if (watchState.isAmbient.value!!) {
if (!isAmbient) {
Log.d("GDApp","staring ambient at ${System.currentTimeMillis()}")
ambientModeStartTime=System.currentTimeMillis()
}
isAmbient = true
if ((System.currentTimeMillis()-ambientModeStartTime)<10000) {
Log.d("GDApp","continuing drawing at ${System.currentTimeMillis()}")
return true
} else {
Log.d("GDApp","returning default at ${System.currentTimeMillis()}")
return default
}
} else {
if (isAmbient) {
Log.d("GDApp","stopping ambient at ${System.currentTimeMillis()}")
}
isAmbient = false
coreObject?.executeCoreCommand("setAmbientModeStartTime", "1000000");
}
}
return default
}
override fun render(zonedDateTime: ZonedDateTime) {
if (isAmbient) {
Log.d("GDApp","transitioning to ambient at ${System.currentTimeMillis()}")
}
if (renderParameters.drawMode==DrawMode.AMBIENT) {
Log.d("GDApp","in ambient at ${System.currentTimeMillis()}")
}
GLES20.glClearColor(Random.nextInt(from=0,until=255).toFloat()/255.0f, Random.nextInt(from=0,until=255).toFloat()/255.0f, Random.nextInt(from=0,until=255).toFloat()/255.0f, 1.0f);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
}