Verified
Status Update
Comments
gu...@google.com <gu...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Steps to capture bugreport:
===========================
Android Wear devices connected to Android devices
On you Android phone, following the instructions in this doc, under the section ‘Instructions on your companion phone or tablets (Android)’
Launch the ‘Android Wear’ app on your phone or tablet. Tap on the three vertical ellipsis on the top right hand corner of the screen and click on “Report Wearable Bug” to capture a bug report from the watch
On the watch, you will observe a notification card with the text “Bug report #X is being generated”. It can take up to 20 minutes for the bug report to be generated and transferred to your phone.
Once the bug report is done, the notification card on the watch changes to “Bug report #X captured” and you will receive a notification on the phone that reads “Wearable bug report finished. Tap to send." Tap on this notification and email the bug report to a pre populated email address
Instructions on your companion phone or tablets (Android)
On your Android device, go to Settings > About phone or About tablet.
At the bottom of the screen, touch 'Build number' seven times in quick succession. You’ll see a message saying you’re now in developer mode.
Press Back to go back to the main Settings screen.
Touch Developer options.
At the top of the screen, make sure 'Developer options' is set to ON.
Check the box next to USB debugging.
Check the box next to Bug report shortcut.
Reproduce the issue or error message on your phone or tablet. It’s important that your device logs at least one occurrence of the problem.
Immediately after seeing the issue, press and hold the power button until the power menu appears.
Select Take bug report, then select Report in the dialog that follows.
After a significant delay -- up to two minutes -- your phone or tablet will vibrate and display a notification saying ‘Bug report captured’. Touch the notification to open Gmail with the report attached.
After replying to this message, you can disable developer mode and bug reports by going to Settings > Developer Options and sliding the top toggle to OFF.
Note: Please upload the bug report and screenshot to google drive and share the folder to android-bugreport@google.com, then share the link here.
Screen Record of the Issue
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Steps to capture bugreport:
===========================
Android Wear devices connected to Android devices
On you Android phone, following the instructions in this doc, under the section ‘Instructions on your companion phone or tablets (Android)’
Launch the ‘Android Wear’ app on your phone or tablet. Tap on the three vertical ellipsis on the top right hand corner of the screen and click on “Report Wearable Bug” to capture a bug report from the watch
On the watch, you will observe a notification card with the text “Bug report #X is being generated”. It can take up to 20 minutes for the bug report to be generated and transferred to your phone.
Once the bug report is done, the notification card on the watch changes to “Bug report #X captured” and you will receive a notification on the phone that reads “Wearable bug report finished. Tap to send." Tap on this notification and email the bug report to a pre populated email address
Instructions on your companion phone or tablets (Android)
On your Android device, go to Settings > About phone or About tablet.
At the bottom of the screen, touch 'Build number' seven times in quick succession. You’ll see a message saying you’re now in developer mode.
Press Back to go back to the main Settings screen.
Touch Developer options.
At the top of the screen, make sure 'Developer options' is set to ON.
Check the box next to USB debugging.
Check the box next to Bug report shortcut.
Reproduce the issue or error message on your phone or tablet. It’s important that your device logs at least one occurrence of the problem.
Immediately after seeing the issue, press and hold the power button until the power menu appears.
Select Take bug report, then select Report in the dialog that follows.
After a significant delay -- up to two minutes -- your phone or tablet will vibrate and display a notification saying ‘Bug report captured’. Touch the notification to open Gmail with the report attached.
After replying to this message, you can disable developer mode and bug reports by going to Settings > Developer Options and sliding the top toggle to OFF.
Note: Please upload the bug report and screenshot to google drive and share the folder to android-bugreport@google.com, then share the link here.
st...@google.com <st...@google.com>
st...@google.com <st...@google.com>
st...@google.com <st...@google.com>
ap...@google.com <ap...@google.com> #3
Please provide the requested information to proceed further. Unfortunately the issue will be closed within 7 days if there is no further update.
ro...@google.com <ro...@google.com>
na...@google.com <na...@google.com> #4
We are closing this issue since we didn't receive a response. If you are still facing this problem, please open a new issue and add the relevant information along with reference to this issue.
na...@google.com <na...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.wear.compose:compose-material:1.4.0-rc01
Description
Function
rememberPickerState
is returning same instance ofPickerState
after recomposition, even when the input has changed.It looks like the issue is because line .
rememberPickerState
is not passing its parameters (initialNumberOfOptions
,initiallySelectedOption
andrepeatItems
) torememberSaveable
function in thisComponent used: rememberPickerState
Version used: 1.0.2
Devices/Android versions reproduced on: N/A
If this is a bug in the library, we would appreciate if you could attach:
I've added unit tests in this commit showing the issue and a proposed solution:https://github.com/luizgrp/horologist/blob/2be07856616edd7a3f833b96b706339897da10ab/sample/src/androidTest/java/androidx/wear/compose/material/PickerTest.kt
testOriginalFunction
test shows that after changing the value ofviewModel. _selectedOption
,MyComposable
does NOT show the new value.testFunctionWithFix
shows that after changing the value ofviewModel. _selectedOption
,MyComposableFixed
shows the new value.rememberPickerStateFixed
is the proposed fix for this issue.This issue was reported by a Googler while using Horologist's TimePicker. The value displayed on the TimePicker is not changing after the values are changed in the ViewModel. To demonstrate that on a simple screen, please see the video attached.
A simple composable displays the hash code value of two
PickerState
objects when the input value is changed, after recomposition. The first line uses the currentrememberPickerState
and the hash code does not change. The second line usesrememberPickerStateFixed
and the hash code changes.