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

[Bug] Screen Highlights/Darkens with Bluetooth Keyboard or Controller (Regression)

Open MarkusJLechner opened this issue 2 years ago • 6 comments

In update 2.16.3, fix #14231 for issue #14142 was published, altering the behavior of a specific bug. While the highlight color changed from bright to dark, the root problem still persists. Reverting the Pull Request would not be beneficial, as it would not resolve the underlying issue.

Reproduction Steps

Option 1: Using a Bluetooth Keyboard

  1. Connect a Bluetooth keyboard.
  2. Go to the deck.
  3. Press space, then 4.

Option 2: Using an (Xbox) Bluetooth Controller

  1. Connect an (Xbox) Bluetooth controller.
  2. Assign a key to a joystick or trigger (seem to always trigger the problem).
  3. Go to the deck.
  4. Press one of the assigned keys.
Expected Result

The screen's brightness/contrast should not change.

Actual Result

Instead, the screen appears as though it has been selected or highlighted (dark). This state persists through the cards, and the only ways to fix it are to either exit to the deck overview or close the app altogether.


Normal: Screenshot_2023-08-19-06-56-33-91_a9eef3a2a561b80d5c76daebd0f9a14c

Highlighted Screenshot_2023-08-19-06-57-15-07_a9eef3a2a561b80d5c76daebd0f9a14c


I have no experience with Android, so I consulted GPT-4 about this issue. My insights may not be of much help, as I'm unfamiliar with the underlying setup, such as the use of WebView or the specific layout causing the problem. Additionally, I am not aware of any potential side effects that may arise from this:

WebView webView = findViewById(R.id.webView);
webView.setFocusable(false);
webView.setFocusableInTouchMode(false);

Or

<resources>
    <style name="ThemeOverlay.DisableKeyboardHighlight" parent="">
        <item name="android:focusable">false</item>
        <item name="android:focusableInTouchMode">false</item>
    </style>
</resources>
Debug info

Refer to the support page if you are unsure where to get the "debug info".

Research

Enter an [x] character to confirm the points below:

  • [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
  • [x] I have checked the manual and the FAQ and could not find a solution to my issue
  • [x] I have searched for similar existing issues here and on the user forum
  • [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)

MarkusJLechner avatar Aug 19 '23 05:08 MarkusJLechner

Same behavior as #14142, but this is much less intrusive. The major problem is risk of regressions

AtilioA avatar Aug 29 '23 16:08 AtilioA

I don't have a solution for this, but I'm commenting to follow the issue. I sporadically experience this screen hightlight when using a keyboard with other apps such as Fennec and NewPipe

sudomain avatar Sep 02 '23 19:09 sudomain

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Dec 01 '23 19:12 github-actions[bot]

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Feb 29 '24 21:02 github-actions[bot]

it has been almost a year since this issue was created, but it seems that none of 2.18 beta branches contain fix of this issue. and any patch note about 2.18 branches doesn't mention this issue. so i just wanted ask.. by any chance does 2.18 beta branches contain fix of this issue..?

inherithandle avatar May 05 '24 16:05 inherithandle

It doesn't

david-allison avatar May 05 '24 17:05 david-allison