diff options
Diffstat (limited to 'src/com/android/tv/menu/MenuRowFactory.java')
-rw-r--r-- | src/com/android/tv/menu/MenuRowFactory.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/com/android/tv/menu/MenuRowFactory.java b/src/com/android/tv/menu/MenuRowFactory.java index 2d5453fe..c67a0e04 100644 --- a/src/com/android/tv/menu/MenuRowFactory.java +++ b/src/com/android/tv/menu/MenuRowFactory.java @@ -67,6 +67,8 @@ public class MenuRowFactory { } else if (TvOptionsRow.class.equals(key)) { return new TvOptionsRow(mMainActivity, menu, mTvCustomizationManager .getCustomActions(TvCustomizationManager.ID_OPTIONS_ROW)); + } else if (PipOptionsRow.class.equals(key)) { + return new PipOptionsRow(mMainActivity, menu); } return null; } @@ -75,9 +77,6 @@ public class MenuRowFactory { * A menu row which represents the TV options row. */ public static class TvOptionsRow extends ItemListRow { - /** The ID of the row. */ - public static final String ID = TvOptionsRow.class.getName(); - private TvOptionsRow(Context context, Menu menu, List<CustomAction> customActions) { super(context, menu, R.string.menu_title_options, R.dimen.action_card_height, new TvOptionsRowAdapter(context, customActions)); @@ -92,6 +91,25 @@ public class MenuRowFactory { } /** + * A menu row which represents the PIP options row. + */ + public static class PipOptionsRow extends ItemListRow { + private final MainActivity mMainActivity; + + private PipOptionsRow(Context context, Menu menu) { + super(context, menu, R.string.menu_title_pip_options, R.dimen.action_card_height, + new PipOptionsRowAdapter(context)); + mMainActivity = (MainActivity) context; + } + + @Override + public boolean isVisible() { + // TODO: Remove the dependency on MainActivity. + return super.isVisible() && mMainActivity.isPipEnabled(); + } + } + + /** * A menu row which represents the partner row. */ public static class PartnerRow extends ItemListRow { |