Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

"Camera unavailable" when pressing near emoji/keyboard switcher

Open ComeGitSome opened this issue 11 years ago • 2 comments

Easiest way to do this is to add a couple of lines in the message with the enter key and press the space above, but it works all around the icon.

emoji

ComeGitSome avatar Jul 12 '15 12:07 ComeGitSome

Confirmed on Nexus 4, stock 5.1.1, TS 2.22.0.

2-4601 avatar Jul 12 '15 14:07 2-4601

I ran into this earlier today, as well, on master (3ae1c5c, 2.22.0):

Left side, "Camera unavailable" (swap_camera_button) tap-left-kbd-open

Right side, launches camera preview (fullscreen_button) tap-right-kbd-open

Although the quick_attachment_toggle was set to GONE in a44a4bc, quick_camera_controls* are still inflated programmatically when the conversation is opened:

src/org/thoughtcrime/securesms/components/camera/QuickAttachmentDrawer.java

  private void updateControlsView() {
    int controlsIndex = indexOfChild(controls);
    if (controlsIndex > -1) removeView(controls);
    controls = LayoutInflater.from(getContext()).inflate(isLandscape() ? R.layout.quick_camera_controls_land
                                                                       : R.layout.quick_camera_controls,
                                                         this, false);
    shutterButton    = (ImageButton) controls.findViewById(R.id.shutter_button);
    swapCameraButton = (ImageButton) controls.findViewById(R.id.swap_camera_button);
    fullScreenButton = (ImageButton) controls.findViewById(R.id.fullscreen_button);

Note that this indicates that the issue likely exists even when quick capture is enabled.

Commenting out the contents of updateControlsView() resulted in NPE's due to the buttons still being referenced elsewhere. Appending the following code at the end of the method as a temporary workaround is working well so far, but it needs further testing:

    if (!isOpen()) {
      shutterButton.setVisibility(GONE);
      swapCameraButton.setVisibility(GONE);
      fullScreenButton.setVisibility(GONE);
    }

Since this feature is still in development, a longer-term solution would probably be better handled by the feature developer.

unrulygnu avatar Jul 12 '15 14:07 unrulygnu