onPanelSelected
Notifies the client app that a specific panel was selected.
Overview
The SDK calls this method when a user selects a different panel type (Chat, Stats, Betting, etc.). Your app can use this information for analytics, UI adjustments, or other purposes.
Syntax
abstract fun onPanelSelected(panel: MaestroPanelType)
Parameters
| Parameter | Type | Description |
|---|---|---|
panel | MaestroPanelType | The type of panel that was selected |
Example
override fun onPanelSelected(panel: MaestroPanelType) {
// Log analytics
analytics.logEvent("panel_selected", mapOf(
"panel_type" to panel.name
))
// Update UI state if needed
when (panel) {
MaestroPanelType.Chat -> handleChatPanelSelected()
MaestroPanelType.Stats -> handleStatsPanelSelected()
MaestroPanelType.Bet -> handleBettingPanelSelected()
MaestroPanelType.Fantasy -> handleFantasyPanelSelected()
else -> handleOtherPanelSelected(panel)
}
// Log for debugging
Log.d("Maestro", "Panel selected: $panel")
}
private fun handleBettingPanelSelected() {
// Example: Track user interest in betting
userPreferences.incrementBettingEngagement()
}
Notes
- Use this for analytics to track which panels users engage with
- Panel types include Chat, Stats, Betting, Fantasy, Shop, Quest, Schedule, etc.
- This is informational - the SDK handles the panel switching
- Consider tracking panel selection frequency for feature prioritization
Related Methods
- shouldShowPanel() - Shows the panel
- didShowPanel() - Notifies SDK panel is shown