Bartuzen / qBitController

Control qBittorrent from your Android device
GNU General Public License v3.0
494 stars 11 forks source link

Back button closes search activity instead of closing keyboard #144

Closed tp0 closed 2 months ago

tp0 commented 2 months ago

Bug description

  1. Launch qBitController

  2. Tap magnifying glass icon to search, type something to get results

  3. Tap (software) back back button

What happens: entire search activity closes and app returns to the main torrent list.

Expected behaviour: only keyboard closes.

Logs

No response

qBitController version

0.8.5

qBittorrent version

4.5.5

Android version

14, can not repro on Android 11

Additional details

Keyboard can be closed by tapping enter on the keyboard. Even if one does this and then tap one of the torrents and then go back by tapping back button, the keyboard pops up again. On Android 11, the keyboard pops up only if was open while tapping a search result.

Something to do with [onBackPressed()](https://developer.android.com/reference/android/app/Activity#onBackPressed()) being deprecated in API level 33 (Android 13)?

Bartuzen commented 2 months ago

That search bar is a native Android component that handles back presses by itself. I assume this is a bug on Android's side. Anyway, I re-coded the torrent list screen with Compose and implemented the search bar manually. It now functions correctly. This change will be included in the next version.