From f038e01981b1280cc8d37283c5571f715ed26173 Mon Sep 17 00:00:00 2001 From: Michatec Date: Sat, 28 Mar 2026 21:03:54 +0100 Subject: [PATCH] feat(ui): add keyboard shortcut for favouriting stations --- README.md | 3 ++- .../java/com/michatec/radio/collection/CollectionAdapter.kt | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28e9d95..47fce0d 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,11 @@ You can help out the radio-browser.info community by [adding the missing station When **Edit Stations** is enabled: - Press **← (Left)** on the remote to open the detailed station editing area -- Press **1** or **Back** to close the editing area +- Press **2** or **Back** to close the editing area **General TV** Controls: - Press **0** or **DEL** to remove the selected radio station +- Press **1** or **SPACE** to make the selected radio station favourite diff --git a/app/src/main/java/com/michatec/radio/collection/CollectionAdapter.kt b/app/src/main/java/com/michatec/radio/collection/CollectionAdapter.kt index f078107..f3fa4fd 100644 --- a/app/src/main/java/com/michatec/radio/collection/CollectionAdapter.kt +++ b/app/src/main/java/com/michatec/radio/collection/CollectionAdapter.kt @@ -419,7 +419,7 @@ class CollectionAdapter( return@setOnKeyListener true } } - KeyEvent.KEYCODE_NUMPAD_1, KeyEvent.KEYCODE_1, KeyEvent.KEYCODE_BACK -> { + KeyEvent.KEYCODE_NUMPAD_2, KeyEvent.KEYCODE_2, KeyEvent.KEYCODE_BACK -> { if (expandedStationPosition == stationViewHolder.bindingAdapterPosition) { val position: Int = stationViewHolder.bindingAdapterPosition toggleEditViews(position, station.uuid) @@ -430,6 +430,10 @@ class CollectionAdapter( removeStation(context, stationViewHolder.bindingAdapterPosition) return@setOnKeyListener true } + KeyEvent.KEYCODE_NUMPAD_1, KeyEvent.KEYCODE_1, KeyEvent.KEYCODE_SPACE -> { + toggleStarredStation(context, stationViewHolder.bindingAdapterPosition) + return@setOnKeyListener true + } } } false