diff options
Diffstat (limited to 'RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java')
-rw-r--r-- | RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java | 14 |
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 048686e..0e417b4 100644 --- a/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java +++ b/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryMenu.java @@ -38,6 +38,7 @@ public class RotaryMenu extends Fragment { private Fragment mNotificationFragment = null; private Fragment mScrollFragment = null; private Fragment mWebViewFragment = null; + private Fragment mCustomFocusAreasFragment = null; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @@ -86,6 +87,12 @@ public class RotaryMenu extends Fragment { showWebViewFragment(); }); + Button customFocusAreasButton = view.findViewById(R.id.custom_focus_areas); + customFocusAreasButton.setOnClickListener(v -> { + selectTab(v); + showCustomFocusAreasFragment(); + }); + return view; } @@ -148,6 +155,13 @@ public class RotaryMenu extends Fragment { showFragment(mWebViewFragment); } + private void showCustomFocusAreasFragment() { + if (mCustomFocusAreasFragment == null) { + mCustomFocusAreasFragment = new CustomFocusAreasFragment(); + } + showFragment(mCustomFocusAreasFragment); + } + private void showFragment(Fragment fragment) { getFragmentManager().beginTransaction() .replace(R.id.rotary_content, fragment) |