Add stop casting button for output switch

This CL add a customize button to stop casting when media
is transferred to info device.

This CL include following change:
- Add new methods to PanelContent.java. Let panels to
  customize "see more button".
- MediaOutputPanel will check which device is used to
  transfer media currently. The customize button will
  shown on when transfer device is info device.
  Then user can use this button to stop casting.
- Add test case.

Bug: 147856563
Test: make -j42 RunSettingsRoboTests
Change-Id: I8b201a10339f39f1d938d99b5659a82014e5bb89
This commit is contained in:
hughchen
2020-01-17 15:19:04 +08:00
parent 14b758f1c8
commit 201b48b885
6 changed files with 245 additions and 8 deletions

View File

@@ -74,4 +74,31 @@ public interface PanelContent extends Instrumentable {
default Intent getHeaderIconIntent() {
return null;
}
/**
* @return {@code true} to enable custom button to replace see more button,
* {@code false} otherwise.
*/
default boolean isCustomizedButtonUsed() {
return false;
}
/**
* @return a string for the title of the custom button.
*/
default CharSequence getCustomButtonTitle() {
return null;
}
/**
* Implement the click event for custom button.
*/
default void onClickCustomizedButton() {}
/**
* Register to start receiving callbacks for custom button events.
*
* @param callback the callback to add.
*/
default void registerCallback(PanelCustomizedButtonCallback callback) {}
}