@Test public void displayPages() throws Exception { View pageView1 = mock(View.class, withSettings().extraInterfaces(PageView.class)); View pageView2 = mock(View.class, withSettings().extraInterfaces(PageView.class)); List<Page> pages = ImmutableList.of( new Page("page1", R.drawable.ic_share, "page1", (context, overlayCallback) -> pageView1), new Page("page2", R.drawable.ic_share, "page2", (context, overlayCallback) -> pageView2) ); Page selectedPage = pages.get(0); view.displayPages(pages, selectedPage, false); ViewGroup iconHolder = view.findViewById(R.id.tab_icons_holder); assertEquals(pages.size() + 1, iconHolder.getChildCount()); for (int i = 0; i < iconHolder.getChildCount(); i++) { View child = iconHolder.getChildAt(i); assertTrue(child.isSelected() == ObjectUtil.equals(child.getTag(), selectedPage.getId())); } ViewGroup container = view.findViewById(R.id.content); assertEquals(1, container.getChildCount()); assertEquals(View.VISIBLE, view.getVisibility()); }
public void displayPages(List<Page> pages, Page selected, boolean animated) { setVisibility(VISIBLE); setupIcons(pages, selected, animated); setupPage(selected); title.setText(selected.getTitle()); }
ExpandedView extends FrameLayout { public void displayPages(List<Page> pages, Page selected, boolean animated) { setVisibility(VISIBLE); setupIcons(pages, selected, animated); setupPage(selected); title.setText(selected.getTitle()); } }
ExpandedView extends FrameLayout { public void displayPages(List<Page> pages, Page selected, boolean animated) { setVisibility(VISIBLE); setupIcons(pages, selected, animated); setupPage(selected); title.setText(selected.getTitle()); } ExpandedView(@NonNull Context context);  ExpandedView(@NonNull Context context, ExpandedViewCallback callback);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr); }
ExpandedView extends FrameLayout { public void displayPages(List<Page> pages, Page selected, boolean animated) { setVisibility(VISIBLE); setupIcons(pages, selected, animated); setupPage(selected); title.setText(selected.getTitle()); } ExpandedView(@NonNull Context context);  ExpandedView(@NonNull Context context, ExpandedViewCallback callback);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr); void displayPages(List<Page> pages, Page selected, boolean animated); void setSelected(Page selected); void setCallback(ExpandedViewCallback callback); void destroyContentAnimated(@Nullable Runnable runnable); void destroyContent(); @Override boolean dispatchKeyEvent(KeyEvent event); }
ExpandedView extends FrameLayout { public void displayPages(List<Page> pages, Page selected, boolean animated) { setVisibility(VISIBLE); setupIcons(pages, selected, animated); setupPage(selected); title.setText(selected.getTitle()); } ExpandedView(@NonNull Context context);  ExpandedView(@NonNull Context context, ExpandedViewCallback callback);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs);  ExpandedView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr); void displayPages(List<Page> pages, Page selected, boolean animated); void setSelected(Page selected); void setCallback(ExpandedViewCallback callback); void destroyContentAnimated(@Nullable Runnable runnable); void destroyContent(); @Override boolean dispatchKeyEvent(KeyEvent event); static final int BACGROUND_TRANSPARENT_COLOR_RES; }