ControlButtonsContainer
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
ExpandedControllerActivity
|
This abstract class provides most of the
implementation of an expanded controller, which is an out-of-the-box remote
player, used when casting media to a cast device. |
MiniControllerFragment
|
A fragment that provides remote control
functionality. |
|
An interface that defines a container which holds a certain number of slots to show
control buttons.
Public Methods
Returns the ImageView
of the button at slotIndex
in this container. The ImageView
is defined in the layout of the Activity
which
implements this interface.
Parameters
slotIndex |
the index of the slot in this container. |
Returns the number of slots to hold control buttons in this container.
Returns the type of the button at slotIndex
in this container.
Button types are defined as one of the ID resources:
@id/cast_button_type_empty
: Not placing a button in this slot.
@id/cast_button_type_custom
: A custom button.
@id/cast_button_type_play_pause_toggle
: A button that toggles
playback.
@id/cast_button_type_skip_previous
: A button that skips to the
previous item in the queue.
@id/cast_button_type_skip_next
: A button that skips to the next item
in the queue.
@id/cast_button_type_rewind_30_seconds
: A button that rewinds the
playback by 30 seconds.
@id/cast_button_type_forward_30_seconds
: A button that skips forward
the playback by 30 seconds.
@id/cast_button_type_mute_toggle
: A button that mutes and unmutes
the remote receiver.
@id/cast_button_type_closed_caption
: A button that opens a dialog to
select text and audio tracks.
Parameters
slotIndex |
the index of the slot in this container. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eControlButtonsContainer\u003c/code\u003e is an interface for managing the layout and functionality of media control buttons in Android Cast applications.\u003c/p\u003e\n"],["\u003cp\u003eIt defines methods for accessing button views, determining button types, and controlling the number of button slots displayed.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the layout and behavior of the control buttons using this interface.\u003c/p\u003e\n"],["\u003cp\u003eThe interface works with a \u003ccode\u003eUIMediaController\u003c/code\u003e to bind and manage button actions within the container.\u003c/p\u003e\n"]]],[],null,["# ControlButtonsContainer\n\npublic interface **ControlButtonsContainer** \n\n|---|---|---|\n| Known Indirect Subclasses [ExpandedControllerActivity](/android/reference/com/google/android/gms/cast/framework/media/widget/ExpandedControllerActivity), [MiniControllerFragment](/android/reference/com/google/android/gms/cast/framework/media/widget/MiniControllerFragment) |--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ExpandedControllerActivity](/android/reference/com/google/android/gms/cast/framework/media/widget/ExpandedControllerActivity) | This abstract class provides most of the implementation of an expanded controller, which is an out-of-the-box remote player, used when casting media to a cast device. | | [MiniControllerFragment](/android/reference/com/google/android/gms/cast/framework/media/widget/MiniControllerFragment) | A fragment that provides remote control functionality. | |||\n\nAn interface that defines a container which holds a certain number of slots to show\ncontrol buttons. \n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [ImageView](//developer.android.com/reference/android/widget/ImageView.html) | [getButtonImageViewAt](/android/reference/com/google/android/gms/cast/framework/media/widget/ControlButtonsContainer#getButtonImageViewAt(int))(int slotIndex) Returns the [ImageView](//developer.android.com/reference/android/widget/ImageView.html) of the button at `slotIndex` in this container. |\n| abstract int | [getButtonSlotCount](/android/reference/com/google/android/gms/cast/framework/media/widget/ControlButtonsContainer#getButtonSlotCount())() Returns the number of slots to hold control buttons in this container. |\n| abstract int | [getButtonTypeAt](/android/reference/com/google/android/gms/cast/framework/media/widget/ControlButtonsContainer#getButtonTypeAt(int))(int slotIndex) Returns the type of the button at `slotIndex` in this container. |\n| abstract [UIMediaController](/android/reference/com/google/android/gms/cast/framework/media/uicontroller/UIMediaController) | [getUIMediaController](/android/reference/com/google/android/gms/cast/framework/media/widget/ControlButtonsContainer#getUIMediaController())() Returns the [UIMediaController](/android/reference/com/google/android/gms/cast/framework/media/uicontroller/UIMediaController) used to bind views in this container. |\n\nPublic Methods\n--------------\n\n#### public abstract [ImageView](//developer.android.com/reference/android/widget/ImageView.html)\n**getButtonImageViewAt** (int slotIndex)\n\nReturns the [ImageView](//developer.android.com/reference/android/widget/ImageView.html)\nof the button at `slotIndex` in this container. The [ImageView](//developer.android.com/reference/android/widget/ImageView.html)\nis defined in the layout of the [Activity](//developer.android.com/reference/android/app/Activity.html) which\nimplements this interface. \n\n##### Parameters\n\n| slotIndex | the index of the slot in this container. |\n|-----------|------------------------------------------|\n\n##### Throws\n\n| [IndexOutOfBoundsException](//developer.android.com/reference/java/lang/IndexOutOfBoundsException.html) | if `slotIndex` is either negative or greater or equal to the number of buttons slots. |\n|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n\n#### public abstract int **getButtonSlotCount** ()\n\nReturns the number of slots to hold control buttons in this container. \n\n#### public abstract int **getButtonTypeAt** (int slotIndex)\n\nReturns the type of the button at `slotIndex` in this container.\n\nButton types are defined as one of the ID resources:\n\n- `@id/cast_button_type_empty`: Not placing a button in this slot.\n- `@id/cast_button_type_custom`: A custom button.\n- `@id/cast_button_type_play_pause_toggle`: A button that toggles playback.\n- `@id/cast_button_type_skip_previous`: A button that skips to the previous item in the queue.\n- `@id/cast_button_type_skip_next`: A button that skips to the next item in the queue.\n- `@id/cast_button_type_rewind_30_seconds`: A button that rewinds the playback by 30 seconds.\n- `@id/cast_button_type_forward_30_seconds`: A button that skips forward the playback by 30 seconds.\n- `@id/cast_button_type_mute_toggle`: A button that mutes and unmutes the remote receiver.\n- `@id/cast_button_type_closed_caption`: A button that opens a dialog to select text and audio tracks. \n\n##### Parameters\n\n| slotIndex | the index of the slot in this container. |\n|-----------|------------------------------------------|\n\n##### Throws\n\n| [IndexOutOfBoundsException](//developer.android.com/reference/java/lang/IndexOutOfBoundsException.html) | if `slotIndex` is either negative or greater or equal to the number of buttons slots. |\n|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n\n#### public abstract [UIMediaController](/android/reference/com/google/android/gms/cast/framework/media/uicontroller/UIMediaController) **getUIMediaController** ()\n\nReturns the [UIMediaController](/android/reference/com/google/android/gms/cast/framework/media/uicontroller/UIMediaController) used to bind views in this container."]]