Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Add configurable colored remote shortcuts

David Nashash07fdcd49924a
diff --git a/app/src/main/java/com/streamvault/app/ui/remote/RemoteShortcutDispatch.kt b/app/src/main/java/com/streamvault/app/ui/remote/RemoteShortcutDispatch.kt
new file mode 100644
index 00000000..d5abbffc
--- /dev/null
+++ b/app/src/main/java/com/streamvault/app/ui/remote/RemoteShortcutDispatch.kt
@@ -0,0 +1,128 @@
+package com.streamvault.app.ui.remote
+
+import android.view.KeyEvent
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutAction
+
+data class PlayerRemoteShortcutHandler(
+ val isLiveContent: Boolean,
+ val isCatchUpPlayback: Boolean,
+ val onOpenGuide: () -> Unit,
+ val onOpenPlayerControls: () -> Unit,
+ val onOpenChannelInfo: () -> Unit,
+ val onOpenChannelList: () -> Unit,
+ val onOpenCategoryList: () -> Unit,
+ val onLastChannel: () -> Unit,
+ val onNextChannel: () -> Unit,
+ val onPreviousChannel: () -> Unit,
+ val onAddToSplitScreen: () -> Unit
+)
+
+sealed interface LiveBrowseRemoteShortcutHandler {
+ val onOpenGuide: (() -> Unit)?
+
+ data class Channel(
+ val onToggleFavorite: () -> Unit,
+ val onPlayChannel: () -> Unit,
+ val onAddToSplitScreen: () -> Unit,
+ override val onOpenGuide: (() -> Unit)? = null
+ ) : LiveBrowseRemoteShortcutHandler
+
+ data class Category(
+ val onPinCategory: () -> Unit,
+ val onToggleCategoryLock: () -> Unit,
+ val onHideCategory: () -> Unit,
+ override val onOpenGuide: (() -> Unit)? = null
+ ) : LiveBrowseRemoteShortcutHandler
+}
+
+fun remoteColorButtonForKeyCode(keyCode: Int): RemoteColorButton? = when (keyCode) {
+ KeyEvent.KEYCODE_PROG_RED -> RemoteColorButton.RED
+ KeyEvent.KEYCODE_PROG_GREEN -> RemoteColorButton.GREEN
+ KeyEvent.KEYCODE_PROG_YELLOW -> RemoteColorButton.YELLOW
+ KeyEvent.KEYCODE_PROG_BLUE -> RemoteColorButton.BLUE
+ else -> null
+}
+
+fun dispatchPlayerRemoteShortcut(
+ action: RemoteShortcutAction,
+ handler: PlayerRemoteShortcutHandler
+): Boolean {
+ if (!action.isSupportedInPlayback(handler.isLiveContent, handler.isCatchUpPlayback)) return false
+ when (action) {
+ RemoteShortcutAction.NONE -> return true
+ RemoteShortcutAction.OPEN_GUIDE -> handler.onOpenGuide()
+ RemoteShortcutAction.OPEN_PLAYER_CONTROLS -> handler.onOpenPlayerControls()
+ RemoteShortcutAction.OPEN_CHANNEL_INFO -> handler.onOpenChannelInfo()
+ RemoteShortcutAction.LAST_CHANNEL -> handler.onLastChannel()
+ RemoteShortcutAction.NEXT_CHANNEL -> handler.onNextChannel()
+ RemoteShortcutAction.PREVIOUS_CHANNEL -> handler.onPreviousChannel()
+ RemoteShortcutAction.OPEN_CHANNEL_LIST -> handler.onOpenChannelList()
+ RemoteShortcutAction.OPEN_CATEGORY_LIST -> handler.onOpenCategoryList()
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN -> handler.onAddToSplitScreen()
+ else -> return false
+ }
+ return true
+}
+
+fun dispatchLiveBrowseRemoteShortcut(
+ action: RemoteShortcutAction,
+ handler: LiveBrowseRemoteShortcutHandler
+): Boolean {
+ if (!action.isSupportedInBrowse(handler)) return false
+ when (handler) {
+ is LiveBrowseRemoteShortcutHandler.Channel -> when (action) {
+ RemoteShortcutAction.NONE -> return true
+ RemoteShortcutAction.OPEN_GUIDE -> handler.onOpenGuide?.invoke() ?: return false
+ RemoteShortcutAction.TOGGLE_FAVORITE -> handler.onToggleFavorite()
+ RemoteShortcutAction.PLAY_CHANNEL -> handler.onPlayChannel()
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN -> handler.onAddToSplitScreen()
+ else -> return false
+ }
+ is LiveBrowseRemoteShortcutHandler.Category -> when (action) {
+ RemoteShortcutAction.NONE -> return true
+ RemoteShortcutAction.OPEN_GUIDE -> handler.onOpenGuide?.invoke() ?: return false
+ RemoteShortcutAction.PIN_CATEGORY -> handler.onPinCategory()
+ RemoteShortcutAction.TOGGLE_CATEGORY_LOCK -> handler.onToggleCategoryLock()
+ RemoteShortcutAction.HIDE_CATEGORY -> handler.onHideCategory()
+ else -> return false
+ }
+ }
+ return true
+}
+
+fun RemoteShortcutAction.isSupportedInPlayback(
+ isLiveContent: Boolean,
+ isCatchUpPlayback: Boolean
+): Boolean = when (this) {
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_PLAYER_CONTROLS -> true
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.OPEN_CHANNEL_INFO,
+ RemoteShortcutAction.LAST_CHANNEL,
+ RemoteShortcutAction.NEXT_CHANNEL,
+ RemoteShortcutAction.PREVIOUS_CHANNEL,
+ RemoteShortcutAction.OPEN_CHANNEL_LIST,
+ RemoteShortcutAction.OPEN_CATEGORY_LIST,
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN -> isLiveContent && !isCatchUpPlayback
+ else -> false
+}
+
+fun RemoteShortcutAction.isSupportedInBrowse(handler: LiveBrowseRemoteShortcutHandler): Boolean = when (handler) {
+ is LiveBrowseRemoteShortcutHandler.Channel -> when (this) {
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.TOGGLE_FAVORITE,
+ RemoteShortcutAction.PLAY_CHANNEL,
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN -> true
+ else -> false
+ }
+ is LiveBrowseRemoteShortcutHandler.Category -> when (this) {
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.PIN_CATEGORY,
+ RemoteShortcutAction.TOGGLE_CATEGORY_LOCK,
+ RemoteShortcutAction.HIDE_CATEGORY -> true
+ else -> false
+ }
+}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
index 8e87c08b..3d29ee86 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt
@@ -92,12 +92,21 @@ import java.util.Date
import java.util.Locale
import com.streamvault.app.ui.interaction.TvClickableSurface
import com.streamvault.app.ui.interaction.TvButton
+import com.streamvault.app.ui.remote.LiveBrowseRemoteShortcutHandler
+import com.streamvault.app.ui.remote.dispatchLiveBrowseRemoteShortcut
+import com.streamvault.app.ui.remote.remoteColorButtonForKeyCode
+import com.streamvault.domain.model.RemoteShortcutProfile
private enum class FocusRestoreTarget {
CATEGORY,
CHANNEL
}
+private sealed interface FocusedRemoteShortcutTarget {
+ data class CategoryTarget(val category: Category) : FocusedRemoteShortcutTarget
+ data class ChannelTarget(val channel: Channel) : FocusedRemoteShortcutTarget
+}
+
private const val HOME_ALL_FILTER_KEY = "__all_categories__"
@Composable
@@ -141,6 +150,7 @@ fun HomeScreen(
multiViewViewModel: MultiViewViewModel = hiltViewModel()
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
+ val remoteShortcutPreferences by viewModel.remoteShortcutPreferences.collectAsStateWithLifecycle()
val providerNameById = remember(uiState.allProviders) {
uiState.allProviders.associateBy({ it.id }, { it.name })
}
@@ -446,6 +456,7 @@ fun HomeScreen(
var pendingRestoreTarget by remember { mutableStateOf<FocusRestoreTarget?>(null) }
var focusRestoreNonce by rememberSaveable { mutableStateOf(0) }
var pendingCategoryContentJumpCategoryId by rememberSaveable { mutableStateOf<Long?>(null) }
+ var focusedRemoteShortcutTarget by remember { mutableStateOf<FocusedRemoteShortcutTarget?>(null) }
fun requestChannelFocus(channelId: Long?): Boolean {
val resolvedChannelId = channelId ?: return false
@@ -626,7 +637,58 @@ fun HomeScreen(
}
}
) {
- Row(modifier = Modifier.fillMaxSize()) {
+ Row(
+ modifier = Modifier
+ .fillMaxSize()
+ .onPreviewKeyEvent { event ->
+ if (event.type != KeyEventType.KeyDown) return@onPreviewKeyEvent false
+ if (hasOverlay || isReorderMode) return@onPreviewKeyEvent false
+ val button = remoteColorButtonForKeyCode(event.nativeKeyEvent.keyCode) ?: return@onPreviewKeyEvent false
+ val action = remoteShortcutPreferences.resolvedAction(RemoteShortcutProfile.BROWSE, button)
+ val handler = when (val target = focusedRemoteShortcutTarget) {
+ is FocusedRemoteShortcutTarget.ChannelTarget -> LiveBrowseRemoteShortcutHandler.Channel(
+ onToggleFavorite = {
+ if (target.channel.isFavorite) viewModel.removeFavorite(target.channel)
+ else viewModel.addFavorite(target.channel)
+ },
+ onPlayChannel = {
+ onChannelClick(
+ target.channel,
+ uiState.selectedCategory,
+ resolveProviderForChannel(target.channel),
+ (uiState.activeLiveSource as? ActiveLiveSource.CombinedM3uSource)?.profileId,
+ uiState.selectedCombinedSourceProviderId
+ )
+ },
+ onAddToSplitScreen = { pendingSplitPlannerChannel = target.channel },
+ onOpenGuide = { onNavigate(Routes.EPG) }
+ )
+ is FocusedRemoteShortcutTarget.CategoryTarget -> {
+ val category = target.category
+ val isLockedCategory = isCategoryLocked(category)
+ if (isLockedCategory && action in setOf(
+ com.streamvault.domain.model.RemoteShortcutAction.PIN_CATEGORY,
+ com.streamvault.domain.model.RemoteShortcutAction.HIDE_CATEGORY
+ )
+ ) {
+ null
+ } else {
+ LiveBrowseRemoteShortcutHandler.Category(
+ onPinCategory = { viewModel.toggleCategoryPinned(category) },
+ onToggleCategoryLock = {
+ pendingLockToggleCategory = category
+ showPinDialog = true
+ },
+ onHideCategory = { viewModel.hideCategory(category) },
+ onOpenGuide = { onNavigate(Routes.EPG) }
+ )
+ }
+ }
+ null -> null
+ } ?: return@onPreviewKeyEvent false
+ dispatchLiveBrowseRemoteShortcut(action, handler)
+ }
+ ) {
// Sidebar - Categories
val categorySearchFocusRequester = remember { FocusRequester() }
val focusManager = LocalFocusManager.current
@@ -897,7 +959,18 @@ fun HomeScreen(
false
}
},
- onFocused = { lastFocusedCategoryId = category.id }
+ onFocused = { lastFocusedCategoryId = category.id },
+ onFocusChanged = { isFocused ->
+ focusedRemoteShortcutTarget = if (isFocused) {
+ FocusedRemoteShortcutTarget.CategoryTarget(category)
+ } else if (focusedRemoteShortcutTarget is FocusedRemoteShortcutTarget.CategoryTarget &&
+ (focusedRemoteShortcutTarget as FocusedRemoteShortcutTarget.CategoryTarget).category.id == category.id
+ ) {
+ null
+ } else {
+ focusedRemoteShortcutTarget
+ }
+ }
)
}
}
@@ -1245,6 +1318,11 @@ fun HomeScreen(
.onFocusChanged { focusState ->
if (focusState.isFocused) {
lastFocusedChannelId = channel.id
+ focusedRemoteShortcutTarget = FocusedRemoteShortcutTarget.ChannelTarget(channel)
+ } else if (focusedRemoteShortcutTarget is FocusedRemoteShortcutTarget.ChannelTarget &&
+ (focusedRemoteShortcutTarget as FocusedRemoteShortcutTarget.ChannelTarget).channel.id == channel.id
+ ) {
+ focusedRemoteShortcutTarget = null
}
}
.onPreviewKeyEvent { event ->
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeSidebarComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeSidebarComponents.kt
index 15c720b3..86f42043 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeSidebarComponents.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeSidebarComponents.kt
@@ -274,7 +274,8 @@ internal fun CategoryItem(
onLongClick: (() -> Unit)? = null,
onJumpToSearch: () -> Boolean,
onJumpToContent: () -> Boolean,
- onFocused: () -> Unit
+ onFocused: () -> Unit,
+ onFocusChanged: (Boolean) -> Unit = {}
) {
var isFocused by remember { mutableStateOf(false) }
@@ -287,6 +288,7 @@ internal fun CategoryItem(
.focusRequester(focusRequester)
.onFocusChanged {
isFocused = it.isFocused
+ onFocusChanged(it.isFocused)
if (it.isFocused) onFocused()
}
.onPreviewKeyEvent { event ->
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeViewModel.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeViewModel.kt
index 8f08b220..be8e2d56 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeViewModel.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeViewModel.kt
@@ -100,6 +100,8 @@ class HomeViewModel @Inject constructor(
private val _uiState = MutableStateFlow(HomeUiState())
val uiState: StateFlow<HomeUiState> = _uiState.asStateFlow()
+ val remoteShortcutPreferences = preferencesRepository.remoteShortcutPreferences
+ .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000L), com.streamvault.domain.model.RemoteShortcutPreferences())
private val _localChannels = MutableStateFlow<List<Channel>>(emptyList())
private val _channelBrowseLimit = MutableStateFlow(CHANNEL_PAGE_SIZE)
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerScreen.kt
index ad7ec5ce..6f2ec4b2 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerScreen.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerScreen.kt
@@ -108,6 +108,10 @@ import com.streamvault.app.ui.screens.player.overlay.NextEpisodeCountdownOverlay
import com.streamvault.app.ui.screens.multiview.MultiViewViewModel
import com.streamvault.app.ui.screens.multiview.MultiViewPlannerDialog
import com.streamvault.app.navigation.Routes
+import com.streamvault.app.ui.remote.PlayerRemoteShortcutHandler
+import com.streamvault.app.ui.remote.dispatchPlayerRemoteShortcut
+import com.streamvault.app.ui.remote.remoteColorButtonForKeyCode
+import com.streamvault.domain.model.RemoteShortcutProfile
@@ -177,6 +181,7 @@ fun PlayerScreen(
val nextProgram by viewModel.nextProgram.collectAsStateWithLifecycle()
val programHistory by viewModel.programHistory.collectAsStateWithLifecycle()
val currentChannel by viewModel.currentChannel.collectAsStateWithLifecycle()
+ val remoteShortcutPreferences by viewModel.remoteShortcutPreferences.collectAsStateWithLifecycle()
val currentSeries by viewModel.currentSeries.collectAsStateWithLifecycle()
val currentEpisode by viewModel.currentEpisode.collectAsStateWithLifecycle()
val autoPlayCountdown by viewModel.autoPlayCountdown.collectAsStateWithLifecycle()
@@ -763,6 +768,33 @@ fun PlayerScreen(
}
}
when (event.nativeKeyEvent.keyCode) {
+ KeyEvent.KEYCODE_PROG_RED,
+ KeyEvent.KEYCODE_PROG_GREEN,
+ KeyEvent.KEYCODE_PROG_YELLOW,
+ KeyEvent.KEYCODE_PROG_BLUE -> {
+ val button = remoteColorButtonForKeyCode(event.nativeKeyEvent.keyCode)
+ ?: return@onKeyEvent false
+ val action = remoteShortcutPreferences.resolvedAction(RemoteShortcutProfile.PLAYBACK, button)
+ dispatchPlayerRemoteShortcut(
+ action = action,
+ handler = PlayerRemoteShortcutHandler(
+ isLiveContent = contentType == "LIVE",
+ isCatchUpPlayback = isCatchUpPlayback,
+ onOpenGuide = { viewModel.openEpgOverlay() },
+ onOpenPlayerControls = { viewModel.toggleControls() },
+ onOpenChannelInfo = {
+ if (showChannelInfoOverlay) viewModel.closeChannelInfoOverlay()
+ else viewModel.openChannelInfoOverlay()
+ },
+ onOpenChannelList = { viewModel.openChannelListOverlay() },
+ onOpenCategoryList = { viewModel.openCategoryListOverlay() },
+ onLastChannel = { viewModel.zapToLastChannel() },
+ onNextChannel = { viewModel.playNext() },
+ onPreviousChannel = { viewModel.playPrevious() },
+ onAddToSplitScreen = { showSplitDialog = true }
+ )
+ )
+ }
KeyEvent.KEYCODE_DPAD_CENTER, KeyEvent.KEYCODE_ENTER -> {
if (showChannelListOverlay || showEpgOverlay || showChannelInfoOverlay || showDiagnostics) {
viewModel.onLiveOverlayInteraction()
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerViewModel.kt b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerViewModel.kt
index 4e2e4e64..0d5abbf4 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerViewModel.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerViewModel.kt
@@ -218,6 +218,8 @@ class PlayerViewModel @Inject constructor(
val audioVideoOffsetUiState: StateFlow<PlayerAudioVideoOffsetUiState> = _audioVideoOffsetUiState.asStateFlow()
internal val _seekPreview = MutableStateFlow(SeekPreviewState())
val seekPreview: StateFlow<SeekPreviewState> = _seekPreview.asStateFlow()
+ val remoteShortcutPreferences = preferencesRepository.remoteShortcutPreferences
+ .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000L), com.streamvault.domain.model.RemoteShortcutPreferences())
private val _recordingItems = MutableStateFlow<List<RecordingItem>>(emptyList())
val recordingItems: StateFlow<List<RecordingItem>> = _recordingItems.asStateFlow()
private val currentChannelFlowRecording = MutableStateFlow<RecordingItem?>(null)
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsModels.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsModels.kt
new file mode 100644
index 00000000..2bdaa874
--- /dev/null
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsModels.kt
@@ -0,0 +1,21 @@
+package com.streamvault.app.ui.screens.settings
+
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutProfile
+
+internal data class RemoteShortcutDialogTarget(
+ val profile: RemoteShortcutProfile,
+ val button: RemoteColorButton
+) {
+ fun storageKey(): String = "${profile.storageValue}:${button.storageValue}"
+
+ companion object {
+ fun fromStorageKey(value: String?): RemoteShortcutDialogTarget? {
+ val parts = value?.split(':') ?: return null
+ if (parts.size != 2) return null
+ val profile = RemoteShortcutProfile.fromStorage(parts[0]) ?: return null
+ val button = RemoteColorButton.fromStorage(parts[1]) ?: return null
+ return RemoteShortcutDialogTarget(profile, button)
+ }
+ }
+}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsSupport.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsSupport.kt
new file mode 100644
index 00000000..69ff74ec
--- /dev/null
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/RemoteShortcutSettingsSupport.kt
@@ -0,0 +1,57 @@
+package com.streamvault.app.ui.screens.settings
+
+import com.streamvault.domain.model.RemoteShortcutAction
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
+
+internal fun availableRemoteShortcutActions(profile: RemoteShortcutProfile): List<RemoteShortcutAction> =
+ when (profile) {
+ RemoteShortcutProfile.GLOBAL -> listOf(
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.OPEN_PLAYER_CONTROLS,
+ RemoteShortcutAction.OPEN_CHANNEL_INFO,
+ RemoteShortcutAction.LAST_CHANNEL,
+ RemoteShortcutAction.NEXT_CHANNEL,
+ RemoteShortcutAction.PREVIOUS_CHANNEL,
+ RemoteShortcutAction.OPEN_CHANNEL_LIST,
+ RemoteShortcutAction.OPEN_CATEGORY_LIST,
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN,
+ RemoteShortcutAction.TOGGLE_FAVORITE,
+ RemoteShortcutAction.PLAY_CHANNEL,
+ RemoteShortcutAction.PIN_CATEGORY,
+ RemoteShortcutAction.TOGGLE_CATEGORY_LOCK,
+ RemoteShortcutAction.HIDE_CATEGORY
+ )
+ RemoteShortcutProfile.PLAYBACK -> listOf(
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.OPEN_PLAYER_CONTROLS,
+ RemoteShortcutAction.OPEN_CHANNEL_INFO,
+ RemoteShortcutAction.LAST_CHANNEL,
+ RemoteShortcutAction.NEXT_CHANNEL,
+ RemoteShortcutAction.PREVIOUS_CHANNEL,
+ RemoteShortcutAction.OPEN_CHANNEL_LIST,
+ RemoteShortcutAction.OPEN_CATEGORY_LIST,
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN
+ )
+ RemoteShortcutProfile.BROWSE -> listOf(
+ RemoteShortcutAction.NONE,
+ RemoteShortcutAction.OPEN_GUIDE,
+ RemoteShortcutAction.TOGGLE_FAVORITE,
+ RemoteShortcutAction.PLAY_CHANNEL,
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN,
+ RemoteShortcutAction.PIN_CATEGORY,
+ RemoteShortcutAction.TOGGLE_CATEGORY_LOCK,
+ RemoteShortcutAction.HIDE_CATEGORY
+ )
+ }
+
+internal fun remoteShortcutSelectionOptions(profile: RemoteShortcutProfile): List<RemoteShortcutSelection> {
+ val options = mutableListOf(RemoteShortcutSelection.profileDefault())
+ if (profile != RemoteShortcutProfile.GLOBAL) {
+ options += RemoteShortcutSelection.globalDefault()
+ }
+ options += availableRemoteShortcutActions(profile).map(RemoteShortcutSelection::explicit)
+ return options
+}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBrowsingSection.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBrowsingSection.kt
index 8f403f40..101779f6 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBrowsingSection.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsBrowsingSection.kt
@@ -26,6 +26,8 @@ import com.streamvault.app.ui.theme.Primary
import com.streamvault.domain.model.CategorySortMode
import com.streamvault.domain.model.ContentType
import com.streamvault.domain.model.LiveChannelGroupingMode
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutProfile
internal fun LazyListScope.settingsBrowsingSection(
uiState: SettingsUiState,
@@ -47,7 +49,8 @@ internal fun LazyListScope.settingsBrowsingSection(
onShowTimeFormatDialogChange: (Boolean) -> Unit,
onShowVodViewModeDialogChange: (Boolean) -> Unit,
onCategorySortDialogTypeChange: (String?) -> Unit,
- onShowLanguageDialogChange: (Boolean) -> Unit
+ onShowLanguageDialogChange: (Boolean) -> Unit,
+ onRemoteShortcutDialogTargetChange: (RemoteShortcutDialogTarget?) -> Unit
) {
item {
ClickableSettingsRow(
@@ -223,4 +226,80 @@ internal fun LazyListScope.settingsBrowsingSection(
}
}
}
+ item {
+ HorizontalDivider(color = Color.White.copy(alpha = 0.07f), modifier = Modifier.padding(vertical = 4.dp))
+ Text(
+ text = stringResource(R.string.settings_remote_shortcuts_title),
+ style = MaterialTheme.typography.titleSmall,
+ color = OnSurface,
+ modifier = Modifier.padding(horizontal = 8.dp, vertical = 6.dp)
+ )
+ Text(
+ text = stringResource(R.string.settings_remote_shortcuts_subtitle),
+ style = MaterialTheme.typography.bodySmall,
+ color = OnBackground.copy(alpha = 0.6f),
+ modifier = Modifier.padding(horizontal = 8.dp, vertical = 2.dp)
+ )
+ Text(
+ text = stringResource(R.string.settings_remote_profile_global),
+ style = MaterialTheme.typography.labelLarge,
+ color = Primary,
+ modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)
+ )
+ }
+ remoteShortcutRows(
+ profile = RemoteShortcutProfile.GLOBAL,
+ uiState = uiState,
+ context = context,
+ onRemoteShortcutDialogTargetChange = onRemoteShortcutDialogTargetChange
+ )
+ item {
+ HorizontalDivider(color = Color.White.copy(alpha = 0.07f), modifier = Modifier.padding(vertical = 4.dp))
+ Text(
+ text = stringResource(R.string.settings_remote_profile_playback),
+ style = MaterialTheme.typography.labelLarge,
+ color = Primary,
+ modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)
+ )
+ }
+ remoteShortcutRows(
+ profile = RemoteShortcutProfile.PLAYBACK,
+ uiState = uiState,
+ context = context,
+ onRemoteShortcutDialogTargetChange = onRemoteShortcutDialogTargetChange
+ )
+ item {
+ HorizontalDivider(color = Color.White.copy(alpha = 0.07f), modifier = Modifier.padding(vertical = 4.dp))
+ Text(
+ text = stringResource(R.string.settings_remote_profile_browse),
+ style = MaterialTheme.typography.labelLarge,
+ color = Primary,
+ modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)
+ )
+ }
+ remoteShortcutRows(
+ profile = RemoteShortcutProfile.BROWSE,
+ uiState = uiState,
+ context = context,
+ onRemoteShortcutDialogTargetChange = onRemoteShortcutDialogTargetChange
+ )
+}
+
+private fun LazyListScope.remoteShortcutRows(
+ profile: RemoteShortcutProfile,
+ uiState: SettingsUiState,
+ context: android.content.Context,
+ onRemoteShortcutDialogTargetChange: (RemoteShortcutDialogTarget?) -> Unit
+) {
+ RemoteColorButton.entries.forEach { button ->
+ item {
+ val selection = uiState.remoteShortcutPreferences.selection(profile, button)
+ ClickableSettingsRow(
+ label = stringResource(button.labelResId()),
+ value = formatRemoteShortcutSelectionLabel(selection, profile, button, context),
+ onClick = { onRemoteShortcutDialogTargetChange(RemoteShortcutDialogTarget(profile, button)) },
+ indent = if (profile == RemoteShortcutProfile.GLOBAL) 0.dp else 16.dp
+ )
+ }
+ }
}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsContentPane.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsContentPane.kt
index fab73846..09a15029 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsContentPane.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsContentPane.kt
@@ -122,7 +122,10 @@ internal fun SettingsContentPane(
onShowTimeFormatDialogChange = { dialogState.showTimeFormatDialog = it },
onShowVodViewModeDialogChange = { dialogState.showVodViewModeDialog = it },
onCategorySortDialogTypeChange = { dialogState.categorySortDialogType = it },
- onShowLanguageDialogChange = { dialogState.showLanguageDialog = it }
+ onShowLanguageDialogChange = { dialogState.showLanguageDialog = it },
+ onRemoteShortcutDialogTargetChange = {
+ dialogState.selectedRemoteShortcutTargetKey = it?.storageKey()
+ }
)
} else if (dialogState.selectedCategory == 3) {
settingsPrivacySection(
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsFormatting.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsFormatting.kt
index 7f1948af..66b40d58 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsFormatting.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsFormatting.kt
@@ -15,6 +15,11 @@ import com.streamvault.domain.model.GroupedChannelLabelMode
import com.streamvault.domain.model.LiveChannelGroupingMode
import com.streamvault.domain.model.LiveVariantPreferenceMode
import com.streamvault.domain.model.PlayerSurfaceMode
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutAction
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
+import com.streamvault.domain.model.RemoteShortcutSelectionMode
import java.text.DateFormat
import java.util.Locale
@@ -319,3 +324,58 @@ internal fun LiveVariantPreferenceMode.descriptionResId(): Int = when (this) {
LiveVariantPreferenceMode.BALANCED -> R.string.settings_live_variant_preference_balanced_desc
LiveVariantPreferenceMode.STABILITY_FIRST -> R.string.settings_live_variant_preference_stability_first_desc
}
+
+internal fun RemoteColorButton.labelResId(): Int = when (this) {
+ RemoteColorButton.RED -> R.string.settings_remote_button_red
+ RemoteColorButton.GREEN -> R.string.settings_remote_button_green
+ RemoteColorButton.YELLOW -> R.string.settings_remote_button_yellow
+ RemoteColorButton.BLUE -> R.string.settings_remote_button_blue
+}
+
+internal fun RemoteShortcutAction.labelResId(): Int = when (this) {
+ RemoteShortcutAction.NONE -> R.string.settings_remote_action_none
+ RemoteShortcutAction.OPEN_GUIDE -> R.string.settings_remote_action_open_guide
+ RemoteShortcutAction.OPEN_PLAYER_CONTROLS -> R.string.settings_remote_action_open_player_controls
+ RemoteShortcutAction.OPEN_CHANNEL_INFO -> R.string.settings_remote_action_open_channel_info
+ RemoteShortcutAction.LAST_CHANNEL -> R.string.settings_remote_action_last_channel
+ RemoteShortcutAction.NEXT_CHANNEL -> R.string.settings_remote_action_next_channel
+ RemoteShortcutAction.PREVIOUS_CHANNEL -> R.string.settings_remote_action_previous_channel
+ RemoteShortcutAction.OPEN_CHANNEL_LIST -> R.string.settings_remote_action_open_channel_list
+ RemoteShortcutAction.OPEN_CATEGORY_LIST -> R.string.settings_remote_action_open_category_list
+ RemoteShortcutAction.ADD_TO_SPLIT_SCREEN -> R.string.settings_remote_action_add_to_split_screen
+ RemoteShortcutAction.TOGGLE_FAVORITE -> R.string.settings_remote_action_toggle_favorite
+ RemoteShortcutAction.PLAY_CHANNEL -> R.string.settings_remote_action_play_channel
+ RemoteShortcutAction.PIN_CATEGORY -> R.string.settings_remote_action_pin_category
+ RemoteShortcutAction.TOGGLE_CATEGORY_LOCK -> R.string.settings_remote_action_toggle_category_lock
+ RemoteShortcutAction.HIDE_CATEGORY -> R.string.settings_remote_action_hide_category
+}
+
+internal fun RemoteShortcutProfile.labelResId(): Int = when (this) {
+ RemoteShortcutProfile.GLOBAL -> R.string.settings_remote_profile_global
+ RemoteShortcutProfile.PLAYBACK -> R.string.settings_remote_profile_playback
+ RemoteShortcutProfile.BROWSE -> R.string.settings_remote_profile_browse
+}
+
+internal fun formatRemoteShortcutSelectionLabel(
+ selection: RemoteShortcutSelection,
+ profile: RemoteShortcutProfile,
+ button: RemoteColorButton,
+ context: android.content.Context
+): String {
+ val resolvedLabel = context.getString(selection.resolve(profile, button).labelResId())
+ return when (selection.mode) {
+ RemoteShortcutSelectionMode.PROFILE_DEFAULT -> if (profile == RemoteShortcutProfile.GLOBAL) {
+ resolvedLabel
+ } else {
+ context.getString(
+ R.string.settings_remote_selection_profile_default,
+ resolvedLabel
+ )
+ }
+ RemoteShortcutSelectionMode.GLOBAL_DEFAULT -> context.getString(
+ R.string.settings_remote_selection_global_default,
+ resolvedLabel
+ )
+ RemoteShortcutSelectionMode.ACTION -> resolvedLabel
+ }
+}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsModeDialogs.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsModeDialogs.kt
index c37f191d..3d43c65d 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsModeDialogs.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsModeDialogs.kt
@@ -25,6 +25,9 @@ import com.streamvault.domain.model.ChannelNumberingMode
import com.streamvault.domain.model.GroupedChannelLabelMode
import com.streamvault.domain.model.LiveChannelGroupingMode
import com.streamvault.domain.model.LiveVariantPreferenceMode
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
@Composable
internal fun VodViewModeDialog(
@@ -279,4 +282,57 @@ internal fun LiveVariantPreferenceModeDialog(
)
}
)
-}
\ No newline at end of file
+}
+
+@Composable
+internal fun RemoteShortcutSelectionDialog(
+ target: RemoteShortcutDialogTarget,
+ selectedSelection: RemoteShortcutSelection,
+ onDismiss: () -> Unit,
+ onSelection: (RemoteShortcutSelection) -> Unit
+) {
+ PremiumDialog(
+ title = stringResource(R.string.settings_remote_dialog_title, stringResource(target.button.labelResId())),
+ subtitle = stringResource(R.string.settings_remote_dialog_subtitle, stringResource(target.profile.labelResId())),
+ onDismissRequest = onDismiss,
+ widthFraction = 0.56f,
+ content = {
+ Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
+ remoteShortcutSelectionOptions(target.profile).forEach { selection ->
+ val isSelected = selection == selectedSelection.normalizedForProfile(target.profile)
+ TvClickableSurface(
+ onClick = { onSelection(selection) },
+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(14.dp)),
+ colors = ClickableSurfaceDefaults.colors(
+ containerColor = if (isSelected) Primary.copy(alpha = 0.18f) else SurfaceElevated,
+ focusedContainerColor = Primary.copy(alpha = 0.28f)
+ ),
+ modifier = Modifier.fillMaxWidth()
+ ) {
+ Column(
+ modifier = Modifier.padding(horizontal = 16.dp, vertical = 14.dp),
+ verticalArrangement = Arrangement.spacedBy(4.dp)
+ ) {
+ Text(
+ text = formatRemoteShortcutSelectionLabel(
+ selection = selection,
+ profile = target.profile,
+ button = target.button,
+ context = androidx.compose.ui.platform.LocalContext.current
+ ),
+ style = MaterialTheme.typography.titleSmall,
+ color = if (isSelected) Primary else OnBackground
+ )
+ }
+ }
+ }
+ }
+ },
+ footer = {
+ PremiumDialogFooterButton(
+ label = stringResource(R.string.settings_cancel),
+ onClick = onDismiss
+ )
+ }
+ )
+}
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceDialogs.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceDialogs.kt
index 9a409e23..704bcf8e 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceDialogs.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceDialogs.kt
@@ -11,6 +11,7 @@ import com.streamvault.domain.model.CategorySortMode
import com.streamvault.domain.model.ContentType
import com.streamvault.domain.model.DecoderMode
import com.streamvault.domain.model.PlayerSurfaceMode
+import com.streamvault.domain.model.RemoteShortcutSelection
@Composable
internal fun SettingsPreferenceDialogs(
@@ -66,7 +67,9 @@ internal fun SettingsPreferenceDialogs(
showLanguageDialog: Boolean,
onShowLanguageDialogChange: (Boolean) -> Unit,
categorySortDialogType: String?,
- onCategorySortDialogTypeChange: (String?) -> Unit
+ onCategorySortDialogTypeChange: (String?) -> Unit,
+ selectedRemoteShortcutTargetKey: String?,
+ onSelectedRemoteShortcutTargetKeyChange: (String?) -> Unit
) {
SettingsPlayerPreferenceDialogs(
uiState = uiState,
@@ -149,6 +152,28 @@ internal fun SettingsPreferenceDialogs(
)
}
+ val remoteShortcutTarget = remember(selectedRemoteShortcutTargetKey) {
+ RemoteShortcutDialogTarget.fromStorageKey(selectedRemoteShortcutTargetKey)
+ }
+ if (remoteShortcutTarget != null) {
+ RemoteShortcutSelectionDialog(
+ target = remoteShortcutTarget,
+ selectedSelection = uiState.remoteShortcutPreferences.selection(
+ remoteShortcutTarget.profile,
+ remoteShortcutTarget.button
+ ),
+ onDismiss = { onSelectedRemoteShortcutTargetKeyChange(null) },
+ onSelection = { selection: RemoteShortcutSelection ->
+ viewModel.setRemoteShortcutSelection(
+ profile = remoteShortcutTarget.profile,
+ button = remoteShortcutTarget.button,
+ selection = selection
+ )
+ onSelectedRemoteShortcutTargetKeyChange(null)
+ }
+ )
+ }
+
if (showAudioLanguageDialog) {
val autoLabel = stringResource(R.string.settings_audio_language_auto)
val audioLanguageOptions = remember(autoLabel) { supportedAudioLanguages(autoLabel) }
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceModels.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceModels.kt
index d4d132c7..91b1f93e 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceModels.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceModels.kt
@@ -18,6 +18,7 @@ import com.streamvault.domain.model.LiveVariantPreferenceMode
import com.streamvault.domain.model.VodHttpProtocolMode
import com.streamvault.domain.model.PlayerSurfaceMode
import com.streamvault.domain.model.Provider
+import com.streamvault.domain.model.RemoteShortcutPreferences
enum class ProviderWarningAction {
EPG,
@@ -80,6 +81,7 @@ internal data class SettingsPreferenceSnapshot(
val showLiveSourceSwitcher: Boolean,
val showAllChannelsCategory: Boolean,
val showRecentChannelsCategory: Boolean,
+ val remoteShortcutPreferences: RemoteShortcutPreferences,
val liveTvCategoryFilters: List<String>,
val liveTvQuickFilterVisibilityMode: LiveTvQuickFilterVisibilityMode,
val liveChannelNumberingMode: ChannelNumberingMode,
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceSnapshotMapper.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceSnapshotMapper.kt
index 842a608d..6734e0b7 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceSnapshotMapper.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsPreferenceSnapshotMapper.kt
@@ -52,6 +52,7 @@ internal fun SettingsUiState.applyPreferenceSnapshot(snapshot: SettingsPreferenc
showLiveSourceSwitcher = snapshot.showLiveSourceSwitcher,
showAllChannelsCategory = snapshot.showAllChannelsCategory,
showRecentChannelsCategory = snapshot.showRecentChannelsCategory,
+ remoteShortcutPreferences = snapshot.remoteShortcutPreferences,
liveTvCategoryFilters = snapshot.liveTvCategoryFilters,
liveTvQuickFilterVisibilityMode = snapshot.liveTvQuickFilterVisibilityMode,
liveChannelNumberingMode = snapshot.liveChannelNumberingMode,
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogState.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogState.kt
index 711f3d7a..118b4601 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogState.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogState.kt
@@ -57,6 +57,7 @@ internal class SettingsScreenDialogState(
private val showRecordingConcurrencyDialogState: MutableState<Boolean>,
private val showRecordingPaddingDialogState: MutableState<Boolean>,
private val showRecordingBrowserDialogState: MutableState<Boolean>,
+ private val selectedRemoteShortcutTargetKeyState: MutableState<String?>,
private val selectedRecordingIdState: MutableState<String?>,
private val categorySortDialogTypeState: MutableState<String?>,
private val selectedCategoryState: MutableState<Int>,
@@ -113,6 +114,7 @@ internal class SettingsScreenDialogState(
var showRecordingConcurrencyDialog by showRecordingConcurrencyDialogState
var showRecordingPaddingDialog by showRecordingPaddingDialogState
var showRecordingBrowserDialog by showRecordingBrowserDialogState
+ var selectedRemoteShortcutTargetKey by selectedRemoteShortcutTargetKeyState
var selectedRecordingId by selectedRecordingIdState
var categorySortDialogType by categorySortDialogTypeState
var selectedCategory by selectedCategoryState
@@ -245,6 +247,7 @@ internal fun rememberSettingsScreenDialogState(): SettingsScreenDialogState {
val showRecordingConcurrencyDialogState = rememberSaveable { mutableStateOf(false) }
val showRecordingPaddingDialogState = rememberSaveable { mutableStateOf(false) }
val showRecordingBrowserDialogState = rememberSaveable { mutableStateOf(false) }
+ val selectedRemoteShortcutTargetKeyState = rememberSaveable { mutableStateOf<String?>(null) }
val selectedRecordingIdState = rememberSaveable { mutableStateOf<String?>(null) }
val categorySortDialogTypeState = rememberSaveable { mutableStateOf<String?>(null) }
val selectedCategoryState = rememberSaveable { mutableStateOf(0) }
@@ -302,6 +305,7 @@ internal fun rememberSettingsScreenDialogState(): SettingsScreenDialogState {
showRecordingConcurrencyDialogState = showRecordingConcurrencyDialogState,
showRecordingPaddingDialogState = showRecordingPaddingDialogState,
showRecordingBrowserDialogState = showRecordingBrowserDialogState,
+ selectedRemoteShortcutTargetKeyState = selectedRemoteShortcutTargetKeyState,
selectedRecordingIdState = selectedRecordingIdState,
categorySortDialogTypeState = categorySortDialogTypeState,
selectedCategoryState = selectedCategoryState,
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogs.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogs.kt
index f33b09e1..25c80755 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogs.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsScreenDialogs.kt
@@ -187,7 +187,9 @@ internal fun SettingsScreenDialogs(
showLanguageDialog = dialogState.showLanguageDialog,
onShowLanguageDialogChange = { dialogState.showLanguageDialog = it },
categorySortDialogType = dialogState.categorySortDialogType,
- onCategorySortDialogTypeChange = { dialogState.categorySortDialogType = it }
+ onCategorySortDialogTypeChange = { dialogState.categorySortDialogType = it },
+ selectedRemoteShortcutTargetKey = dialogState.selectedRemoteShortcutTargetKey,
+ onSelectedRemoteShortcutTargetKeyChange = { dialogState.selectedRemoteShortcutTargetKey = it }
)
SettingsProtectionDialogs(
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsStateBindings.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsStateBindings.kt
index 4e7a1aaa..f37e0cf0 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsStateBindings.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsStateBindings.kt
@@ -79,6 +79,7 @@ internal fun observeSettingsPreferenceSnapshot(
showLiveSourceSwitcher = false,
showAllChannelsCategory = true,
showRecentChannelsCategory = true,
+ remoteShortcutPreferences = com.streamvault.domain.model.RemoteShortcutPreferences(),
liveTvCategoryFilters = emptyList(),
liveTvQuickFilterVisibilityMode = LiveTvQuickFilterVisibilityMode.ALWAYS_VISIBLE,
liveChannelNumberingMode = ChannelNumberingMode.GROUP,
@@ -184,6 +185,8 @@ internal fun observeSettingsPreferenceSnapshot(
snapshot.copy(showAllChannelsCategory = showAllChannelsCategory)
}.combine(preferencesRepository.showRecentChannelsCategory) { snapshot, showRecentChannelsCategory ->
snapshot.copy(showRecentChannelsCategory = showRecentChannelsCategory)
+ }.combine(preferencesRepository.remoteShortcutPreferences) { snapshot, remoteShortcutPreferences ->
+ snapshot.copy(remoteShortcutPreferences = remoteShortcutPreferences)
}.combine(preferencesRepository.liveTvCategoryFilters) { snapshot, liveTvCategoryFilters ->
snapshot.copy(liveTvCategoryFilters = liveTvCategoryFilters)
}.combine(preferencesRepository.liveTvQuickFilterVisibility) { snapshot, visibilityMode ->
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsUiStateModel.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsUiStateModel.kt
index 5128dd87..a415980e 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsUiStateModel.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsUiStateModel.kt
@@ -29,6 +29,7 @@ import com.streamvault.domain.model.PlayerSurfaceMode
import com.streamvault.domain.model.Provider
import com.streamvault.domain.model.RecordingItem
import com.streamvault.domain.model.RecordingStorageState
+import com.streamvault.domain.model.RemoteShortcutPreferences
data class CrashReportUiModel(
val timestamp: String = "",
@@ -116,6 +117,7 @@ data class SettingsUiState(
val showLiveSourceSwitcher: Boolean = false,
val showAllChannelsCategory: Boolean = true,
val showRecentChannelsCategory: Boolean = true,
+ val remoteShortcutPreferences: RemoteShortcutPreferences = RemoteShortcutPreferences(),
val liveTvCategoryFilters: List<String> = emptyList(),
val liveTvQuickFilterVisibilityMode: LiveTvQuickFilterVisibilityMode = LiveTvQuickFilterVisibilityMode.ALWAYS_VISIBLE,
val liveChannelNumberingMode: ChannelNumberingMode = ChannelNumberingMode.GROUP,
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt
index a2e3ff16..65e57450 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/settings/SettingsViewModel.kt
@@ -52,6 +52,9 @@ import com.streamvault.domain.model.ProviderStatus
import com.streamvault.domain.model.RecordingItem
import com.streamvault.domain.model.RecordingStorageConfig
import com.streamvault.domain.model.RecordingStorageState
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
import com.streamvault.domain.model.EpgResolutionSummary
import com.streamvault.domain.model.Result
import com.streamvault.domain.model.VirtualCategoryIds
@@ -451,6 +454,16 @@ class SettingsViewModel @Inject constructor(
}
}
+ fun setRemoteShortcutSelection(
+ profile: RemoteShortcutProfile,
+ button: RemoteColorButton,
+ selection: RemoteShortcutSelection
+ ) {
+ viewModelScope.launch {
+ preferencesRepository.setRemoteShortcutSelection(profile, button, selection)
+ }
+ }
+
fun setLiveTvQuickFilterVisibilityMode(mode: LiveTvQuickFilterVisibilityMode) {
viewModelScope.launch {
preferencesRepository.setLiveTvQuickFilterVisibility(mode.storageValue)
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
index 2658bd2f..a6e4d8ad 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index 799c8b0b..b48f9bcd 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index ef1efe19..24af3356 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 197eccb5..e798f8bf 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index 62495451..b50bf25a 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index a8f99bfb..206ea2da 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -1442,5 +1442,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index 0d5eb39b..b7712bf2 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 2bbcf26d..757df3f7 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -1486,4 +1486,32 @@
<string name="settings_drive_last_pull">Récupéré : %1$s</string>
<string name="settings_drive_never_synced">Jamais synchronisé</string>
<string name="setup_import_from_drive">Importer depuis Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index cb9565d9..365e0072 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index fb203c65..fa092fc3 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index f098f39c..5c02cdb2 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml
index 5afcdb1a..4d4524b9 100644
--- a/app/src/main/res/values-iw/strings.xml
+++ b/app/src/main/res/values-iw/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 829ce84e..515b72b6 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 409f98a1..d8779432 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index fa4cb560..53ad8a30 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 51f75fa9..1bf41714 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 6b14c7cb..99ef8b0d 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 7c0ac973..1ef42caa 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 0da16ddf..1401ffa5 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index e69be48f..e2e1f062 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 0b163976..a908e92c 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index d7cb9be5..0c813973 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 49fe05bb..09787f39 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index d7474372..22af529e 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index 9827dad2..ea5cb17a 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -1441,5 +1441,33 @@
<string name="settings_drive_last_pull">Pulled: %1$s</string>
<string name="settings_drive_never_synced">Never synced yet</string>
<string name="setup_import_from_drive">Import from Drive</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 14bfd56c..f7bc6b6a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1604,4 +1604,32 @@
<string name="download_delete">Delete</string>
<string name="downloads_resumed">Download resumed</string>
<string name="download_error_no_url">Could not resolve stream URL for download</string>
+ <string name="settings_remote_shortcuts_title">Colored Remote Buttons</string>
+ <string name="settings_remote_shortcuts_subtitle">Works on remotes that send the Android red, green, yellow, and blue color key codes.</string>
+ <string name="settings_remote_button_red">Red button</string>
+ <string name="settings_remote_button_green">Green button</string>
+ <string name="settings_remote_button_yellow">Yellow button</string>
+ <string name="settings_remote_button_blue">Blue button</string>
+ <string name="settings_remote_profile_global">Global defaults</string>
+ <string name="settings_remote_profile_playback">Playback overrides</string>
+ <string name="settings_remote_profile_browse">Browse overrides</string>
+ <string name="settings_remote_action_none">No action</string>
+ <string name="settings_remote_action_open_guide">Open guide</string>
+ <string name="settings_remote_action_open_player_controls">Open player controls</string>
+ <string name="settings_remote_action_open_channel_info">Open channel info</string>
+ <string name="settings_remote_action_last_channel">Last channel</string>
+ <string name="settings_remote_action_next_channel">Next channel</string>
+ <string name="settings_remote_action_previous_channel">Previous channel</string>
+ <string name="settings_remote_action_open_channel_list">Open channel list</string>
+ <string name="settings_remote_action_open_category_list">Open category list</string>
+ <string name="settings_remote_action_add_to_split_screen">Add to split screen</string>
+ <string name="settings_remote_action_toggle_favorite">Add or remove favorite</string>
+ <string name="settings_remote_action_play_channel">Play channel</string>
+ <string name="settings_remote_action_pin_category">Pin or unpin category</string>
+ <string name="settings_remote_action_toggle_category_lock">Lock or unlock category</string>
+ <string name="settings_remote_action_hide_category">Hide category</string>
+ <string name="settings_remote_selection_profile_default">Profile default: %1$s</string>
+ <string name="settings_remote_selection_global_default">Use global default: %1$s</string>
+ <string name="settings_remote_dialog_title">%1$s action</string>
+ <string name="settings_remote_dialog_subtitle">Choose what this colored button should do in %1$s.</string>
</resources>
diff --git a/app/src/test/java/com/streamvault/app/ui/remote/RemoteShortcutDispatchTest.kt b/app/src/test/java/com/streamvault/app/ui/remote/RemoteShortcutDispatchTest.kt
new file mode 100644
index 00000000..d11e03f4
--- /dev/null
+++ b/app/src/test/java/com/streamvault/app/ui/remote/RemoteShortcutDispatchTest.kt
@@ -0,0 +1,92 @@
+package com.streamvault.app.ui.remote
+
+import com.google.common.truth.Truth.assertThat
+import com.streamvault.domain.model.RemoteShortcutAction
+import org.junit.Test
+
+class RemoteShortcutDispatchTest {
+
+ @Test
+ fun playbackDispatchRunsExpectedHandler() {
+ var guideOpened = false
+
+ val handled = dispatchPlayerRemoteShortcut(
+ action = RemoteShortcutAction.OPEN_GUIDE,
+ handler = PlayerRemoteShortcutHandler(
+ isLiveContent = true,
+ isCatchUpPlayback = false,
+ onOpenGuide = { guideOpened = true },
+ onOpenPlayerControls = {},
+ onOpenChannelInfo = {},
+ onOpenChannelList = {},
+ onOpenCategoryList = {},
+ onLastChannel = {},
+ onNextChannel = {},
+ onPreviousChannel = {},
+ onAddToSplitScreen = {}
+ )
+ )
+
+ assertThat(handled).isTrue()
+ assertThat(guideOpened).isTrue()
+ }
+
+ @Test
+ fun playbackDispatchIgnoresUnsupportedAction() {
+ var favoriteToggled = false
+
+ val handled = dispatchPlayerRemoteShortcut(
+ action = RemoteShortcutAction.TOGGLE_FAVORITE,
+ handler = PlayerRemoteShortcutHandler(
+ isLiveContent = true,
+ isCatchUpPlayback = false,
+ onOpenGuide = {},
+ onOpenPlayerControls = {},
+ onOpenChannelInfo = {},
+ onOpenChannelList = {},
+ onOpenCategoryList = {},
+ onLastChannel = {},
+ onNextChannel = {},
+ onPreviousChannel = {},
+ onAddToSplitScreen = { favoriteToggled = true }
+ )
+ )
+
+ assertThat(handled).isFalse()
+ assertThat(favoriteToggled).isFalse()
+ }
+
+ @Test
+ fun browseChannelDispatchTogglesFavorite() {
+ var favoriteToggled = false
+
+ val handled = dispatchLiveBrowseRemoteShortcut(
+ action = RemoteShortcutAction.TOGGLE_FAVORITE,
+ handler = LiveBrowseRemoteShortcutHandler.Channel(
+ onToggleFavorite = { favoriteToggled = true },
+ onPlayChannel = {},
+ onAddToSplitScreen = {}
+ )
+ )
+
+ assertThat(handled).isTrue()
+ assertThat(favoriteToggled).isTrue()
+ }
+
+ @Test
+ fun browseCategoryDispatchRejectsChannelOnlyAction() {
+ var hidden = false
+
+ val handled = dispatchLiveBrowseRemoteShortcut(
+ action = RemoteShortcutAction.ADD_TO_SPLIT_SCREEN,
+ handler = LiveBrowseRemoteShortcutHandler.Category(
+ onPinCategory = {},
+ onToggleCategoryLock = {},
+ onHideCategory = { hidden = true }
+ )
+ )
+
+ assertThat(handled).isFalse()
+ assertThat(hidden).isFalse()
+ }
+}
diff --git a/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt b/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt
index 7975dcb4..937f0b60 100644
--- a/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt
+++ b/data/src/main/java/com/streamvault/data/preferences/PreferencesRepository.kt
@@ -30,6 +30,10 @@ import com.streamvault.domain.model.LiveChannelObservedQuality
import com.streamvault.domain.model.LiveVariantPreferenceMode
import com.streamvault.domain.model.VodHttpProtocolMode
import com.streamvault.domain.model.PlayerSurfaceMode
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutPreferences
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
import com.streamvault.domain.model.SearchHistoryScope
import com.streamvault.domain.manager.ParentalPinVerifier
import com.streamvault.domain.manager.ParentalControlSessionState
@@ -1195,12 +1199,34 @@ class PreferencesRepository @Inject constructor(
preferences[PreferencesKeys.APP_LANGUAGE] ?: "system"
}
+ val remoteShortcutPreferences: Flow<RemoteShortcutPreferences> = context.dataStore.data.map { preferences ->
+ decodeRemoteShortcutPreferences { profile, button ->
+ preferences[stringPreferencesKey(remoteShortcutKey(profile, button))]
+ }
+ }
+
suspend fun setAppLanguage(language: String) {
context.dataStore.edit { preferences ->
preferences[PreferencesKeys.APP_LANGUAGE] = language
}
}
+ suspend fun setRemoteShortcutSelection(
+ profile: RemoteShortcutProfile,
+ button: RemoteColorButton,
+ selection: RemoteShortcutSelection
+ ) {
+ val key = stringPreferencesKey(remoteShortcutKey(profile, button))
+ context.dataStore.edit { preferences ->
+ val encoded = encodeRemoteShortcutSelection(profile, selection)
+ if (encoded.isNullOrBlank()) {
+ preferences.remove(key)
+ } else {
+ preferences[key] = encoded
+ }
+ }
+ }
+
val appLandingDestination: Flow<AppLandingDestination> = context.dataStore.data.map { preferences ->
AppLandingDestination.fromStorage(preferences[PreferencesKeys.APP_LANDING_DESTINATION])
}
@@ -1798,6 +1824,9 @@ class PreferencesRepository @Inject constructor(
private fun pinnedCategoriesKey(providerId: Long, type: ContentType): String =
"pinned_categories_${providerId}_${type.name}"
+ private fun remoteShortcutKey(profile: RemoteShortcutProfile, button: RemoteColorButton): String =
+ "remote_shortcut_${profile.storageValue}_${button.storageValue}"
+
private fun liveVariantSelectionKey(providerId: Long, logicalGroupId: String): String =
"${providerId}|${logicalGroupId.trim()}"
diff --git a/data/src/main/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodec.kt b/data/src/main/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodec.kt
new file mode 100644
index 00000000..fdc4731d
--- /dev/null
+++ b/data/src/main/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodec.kt
@@ -0,0 +1,43 @@
+package com.streamvault.data.preferences
+
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutPreferences
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
+import com.streamvault.domain.model.RemoteShortcutAction
+
+internal const val REMOTE_SHORTCUT_USE_GLOBAL_SENTINEL = "__global_default__"
+
+internal fun decodeRemoteShortcutSelection(
+ profile: RemoteShortcutProfile,
+ rawValue: String?
+): RemoteShortcutSelection = when {
+ rawValue.isNullOrBlank() -> RemoteShortcutSelection.profileDefault()
+ rawValue == REMOTE_SHORTCUT_USE_GLOBAL_SENTINEL && profile != RemoteShortcutProfile.GLOBAL ->
+ RemoteShortcutSelection.globalDefault()
+ else -> RemoteShortcutAction.fromStorage(rawValue)
+ ?.let(RemoteShortcutSelection::explicit)
+ ?: RemoteShortcutSelection.profileDefault()
+}
+
+internal fun encodeRemoteShortcutSelection(
+ profile: RemoteShortcutProfile,
+ selection: RemoteShortcutSelection
+): String? {
+ val normalized = selection.normalizedForProfile(profile)
+ return when (normalized.mode) {
+ com.streamvault.domain.model.RemoteShortcutSelectionMode.PROFILE_DEFAULT -> null
+ com.streamvault.domain.model.RemoteShortcutSelectionMode.GLOBAL_DEFAULT -> REMOTE_SHORTCUT_USE_GLOBAL_SENTINEL
+ com.streamvault.domain.model.RemoteShortcutSelectionMode.ACTION -> normalized.action?.storageValue
+ }
+}
+
+internal fun decodeRemoteShortcutPreferences(
+ read: (RemoteShortcutProfile, RemoteColorButton) -> String?
+): RemoteShortcutPreferences = RemoteShortcutPreferences(
+ selections = RemoteShortcutProfile.entries.associateWith { profile ->
+ RemoteColorButton.entries.associateWith { button ->
+ decodeRemoteShortcutSelection(profile, read(profile, button))
+ }
+ }
+)
diff --git a/data/src/test/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodecTest.kt b/data/src/test/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodecTest.kt
new file mode 100644
index 00000000..2b63633c
--- /dev/null
+++ b/data/src/test/java/com/streamvault/data/preferences/RemoteShortcutPreferenceCodecTest.kt
@@ -0,0 +1,63 @@
+package com.streamvault.data.preferences
+
+import com.google.common.truth.Truth.assertThat
+import com.streamvault.domain.model.RemoteColorButton
+import com.streamvault.domain.model.RemoteShortcutAction
+import com.streamvault.domain.model.RemoteShortcutProfile
+import com.streamvault.domain.model.RemoteShortcutSelection
+import org.junit.Test
+
+class RemoteShortcutPreferenceCodecTest {
+
+ @Test
+ fun decodePreferencesUsesProfileDefaultsWhenUnset() {
+ val preferences = decodeRemoteShortcutPreferences { _, _ -> null }
+
+ assertThat(
+ preferences.resolvedAction(RemoteShortcutProfile.PLAYBACK, RemoteColorButton.RED)
+ ).isEqualTo(RemoteShortcutAction.LAST_CHANNEL)
+ assertThat(
+ preferences.resolvedAction(RemoteShortcutProfile.BROWSE, RemoteColorButton.YELLOW)
+ ).isEqualTo(RemoteShortcutAction.HIDE_CATEGORY)
+ }
+
+ @Test
+ fun playbackGlobalSentinelFallsBackToGlobalDefault() {
+ val preferences = decodeRemoteShortcutPreferences { profile, button ->
+ if (profile == RemoteShortcutProfile.PLAYBACK && button == RemoteColorButton.GREEN) {
+ REMOTE_SHORTCUT_USE_GLOBAL_SENTINEL
+ } else {
+ null
+ }
+ }
+
+ val selection = preferences.selection(RemoteShortcutProfile.PLAYBACK, RemoteColorButton.GREEN)
+ assertThat(selection).isEqualTo(RemoteShortcutSelection.globalDefault())
+ assertThat(
+ preferences.resolvedAction(RemoteShortcutProfile.PLAYBACK, RemoteColorButton.GREEN)
+ ).isEqualTo(RemoteShortcutAction.OPEN_GUIDE)
+ }
+
+ @Test
+ fun encodeRoundTripPreservesExplicitAction() {
+ val encoded = encodeRemoteShortcutSelection(
+ profile = RemoteShortcutProfile.BROWSE,
+ selection = RemoteShortcutSelection.explicit(RemoteShortcutAction.PLAY_CHANNEL)
+ )
+
+ val decoded = decodeRemoteShortcutSelection(RemoteShortcutProfile.BROWSE, encoded)
+
+ assertThat(encoded).isEqualTo(RemoteShortcutAction.PLAY_CHANNEL.storageValue)
+ assertThat(decoded).isEqualTo(RemoteShortcutSelection.explicit(RemoteShortcutAction.PLAY_CHANNEL))
+ }
+
+ @Test
+ fun globalProfileCannotPersistGlobalFallbackSentinel() {
+ val encoded = encodeRemoteShortcutSelection(
+ profile = RemoteShortcutProfile.GLOBAL,
+ selection = RemoteShortcutSelection.globalDefault()
+ )
+
+ assertThat(encoded).isNull()
+ }
+}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 2e8d75a8..c1f5127e 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,6 +10,7 @@ All notable product changes are recorded in this document.
- Added external playback mode and chooser handling so users can hand streams off to external player apps more reliably.
- Added a stream format selector to the player so users can switch formats when decoder recovery needs an alternate stream variant.
- Added a default landing screen setting so startup can open Home, Live TV, Movies, Series, Guide, Downloads, Plugins, or Settings instead of always opening Home.
+- Added configurable colored remote button support for Android TV remotes, with global defaults plus playback and live-browse overrides for actions such as guide, channel info, favorites, category pinning, and split screen.
### Changed
diff --git a/domain/src/main/java/com/streamvault/domain/model/RemoteShortcutModels.kt b/domain/src/main/java/com/streamvault/domain/model/RemoteShortcutModels.kt
new file mode 100644
index 00000000..e24de36c
--- /dev/null
+++ b/domain/src/main/java/com/streamvault/domain/model/RemoteShortcutModels.kt
@@ -0,0 +1,114 @@
+package com.streamvault.domain.model
+
+enum class RemoteColorButton(val storageValue: String) {
+ RED("red"),
+ GREEN("green"),
+ YELLOW("yellow"),
+ BLUE("blue");
+
+ companion object {
+ fun fromStorage(value: String?): RemoteColorButton? = entries.firstOrNull { it.storageValue == value }
+ }
+}
+
+enum class RemoteShortcutProfile(val storageValue: String) {
+ GLOBAL("global"),
+ PLAYBACK("playback"),
+ BROWSE("browse");
+
+ companion object {
+ fun fromStorage(value: String?): RemoteShortcutProfile? = entries.firstOrNull { it.storageValue == value }
+ }
+}
+
+enum class RemoteShortcutAction(val storageValue: String) {
+ NONE("none"),
+ OPEN_GUIDE("open_guide"),
+ OPEN_PLAYER_CONTROLS("open_player_controls"),
+ OPEN_CHANNEL_INFO("open_channel_info"),
+ LAST_CHANNEL("last_channel"),
+ NEXT_CHANNEL("next_channel"),
+ PREVIOUS_CHANNEL("previous_channel"),
+ OPEN_CHANNEL_LIST("open_channel_list"),
+ OPEN_CATEGORY_LIST("open_category_list"),
+ ADD_TO_SPLIT_SCREEN("add_to_split_screen"),
+ TOGGLE_FAVORITE("toggle_favorite"),
+ PLAY_CHANNEL("play_channel"),
+ PIN_CATEGORY("pin_category"),
+ TOGGLE_CATEGORY_LOCK("toggle_category_lock"),
+ HIDE_CATEGORY("hide_category");
+
+ companion object {
+ fun fromStorage(value: String?): RemoteShortcutAction? = entries.firstOrNull { it.storageValue == value }
+ }
+}
+
+enum class RemoteShortcutSelectionMode {
+ PROFILE_DEFAULT,
+ GLOBAL_DEFAULT,
+ ACTION
+}
+
+data class RemoteShortcutSelection(
+ val mode: RemoteShortcutSelectionMode,
+ val action: RemoteShortcutAction? = null
+) {
+ fun resolve(profile: RemoteShortcutProfile, button: RemoteColorButton): RemoteShortcutAction =
+ when (mode) {
+ RemoteShortcutSelectionMode.PROFILE_DEFAULT -> profile.defaultAction(button)
+ RemoteShortcutSelectionMode.GLOBAL_DEFAULT -> RemoteShortcutProfile.GLOBAL.defaultAction(button)
+ RemoteShortcutSelectionMode.ACTION -> action ?: profile.defaultAction(button)
+ }
+
+ fun normalizedForProfile(profile: RemoteShortcutProfile): RemoteShortcutSelection =
+ when {
+ mode == RemoteShortcutSelectionMode.ACTION && action == null -> profileDefault()
+ profile == RemoteShortcutProfile.GLOBAL && mode == RemoteShortcutSelectionMode.GLOBAL_DEFAULT -> profileDefault()
+ else -> this
+ }
+
+ companion object {
+ fun profileDefault(): RemoteShortcutSelection = RemoteShortcutSelection(RemoteShortcutSelectionMode.PROFILE_DEFAULT)
+
+ fun globalDefault(): RemoteShortcutSelection = RemoteShortcutSelection(RemoteShortcutSelectionMode.GLOBAL_DEFAULT)
+
+ fun explicit(action: RemoteShortcutAction): RemoteShortcutSelection =
+ RemoteShortcutSelection(RemoteShortcutSelectionMode.ACTION, action)
+ }
+}
+
+data class RemoteShortcutPreferences(
+ val selections: Map<RemoteShortcutProfile, Map<RemoteColorButton, RemoteShortcutSelection>> =
+ RemoteShortcutProfile.entries.associateWith { profile ->
+ RemoteColorButton.entries.associateWith { profile.defaultSelection() }
+ }
+) {
+ fun selection(profile: RemoteShortcutProfile, button: RemoteColorButton): RemoteShortcutSelection =
+ selections[profile]?.get(button)?.normalizedForProfile(profile) ?: profile.defaultSelection()
+
+ fun resolvedAction(profile: RemoteShortcutProfile, button: RemoteColorButton): RemoteShortcutAction =
+ selection(profile, button).resolve(profile, button)
+}
+
+fun RemoteShortcutProfile.defaultSelection(): RemoteShortcutSelection = RemoteShortcutSelection.profileDefault()
+
+fun RemoteShortcutProfile.defaultAction(button: RemoteColorButton): RemoteShortcutAction = when (this) {
+ RemoteShortcutProfile.GLOBAL -> when (button) {
+ RemoteColorButton.RED -> RemoteShortcutAction.TOGGLE_FAVORITE
+ RemoteColorButton.GREEN -> RemoteShortcutAction.OPEN_GUIDE
+ RemoteColorButton.YELLOW -> RemoteShortcutAction.OPEN_CHANNEL_INFO
+ RemoteColorButton.BLUE -> RemoteShortcutAction.ADD_TO_SPLIT_SCREEN
+ }
+ RemoteShortcutProfile.PLAYBACK -> when (button) {
+ RemoteColorButton.RED -> RemoteShortcutAction.LAST_CHANNEL
+ RemoteColorButton.GREEN -> RemoteShortcutAction.OPEN_GUIDE
+ RemoteColorButton.YELLOW -> RemoteShortcutAction.OPEN_CHANNEL_INFO
+ RemoteColorButton.BLUE -> RemoteShortcutAction.ADD_TO_SPLIT_SCREEN
+ }
+ RemoteShortcutProfile.BROWSE -> when (button) {
+ RemoteColorButton.RED -> RemoteShortcutAction.TOGGLE_FAVORITE
+ RemoteColorButton.GREEN -> RemoteShortcutAction.PIN_CATEGORY
+ RemoteColorButton.YELLOW -> RemoteShortcutAction.HIDE_CATEGORY
+ RemoteColorButton.BLUE -> RemoteShortcutAction.ADD_TO_SPLIT_SCREEN
+ }
+}