aboutsummaryrefslogtreecommitdiff
path: root/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java
diff options
context:
space:
mode:
Diffstat (limited to 'RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java')
-rw-r--r--RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java b/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java
index 4b8844d..f1ffe86 100644
--- a/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java
+++ b/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java
@@ -39,6 +39,7 @@ public class RotaryMenu extends Fragment {
private Fragment mScrollFragment;
private Fragment mWebViewFragment;
private Fragment mCustomFocusAreasFragment;
+ private Fragment mPopupWindowFragment;
private Fragment mSurfaceViewFragment;
@Override
@@ -94,6 +95,12 @@ public class RotaryMenu extends Fragment {
showCustomFocusAreasFragment();
});
+ Button popupWindowButton = view.findViewById(R.id.popup_window);
+ popupWindowButton.setOnClickListener(v -> {
+ selectTab(v);
+ showPopupWindowFragment();
+ });
+
Button surfaceViewButton = view.findViewById(R.id.surface_view);
surfaceViewButton.setOnClickListener(v -> {
selectTab(v);
@@ -169,6 +176,13 @@ public class RotaryMenu extends Fragment {
showFragment(mCustomFocusAreasFragment);
}
+ private void showPopupWindowFragment() {
+ if (mPopupWindowFragment == null) {
+ mPopupWindowFragment = new PopupWindowFragment();
+ }
+ showFragment(mPopupWindowFragment);
+ }
+
private void showSurfaceViewFragment() {
if (mSurfaceViewFragment == null) {
mSurfaceViewFragment = new SurfaceViewFragment();