Code example for FrameLayout

Methods: addViewremoveAllViews

0
    } 
 
    @Test 
    public void removeAllViews_shouldRequestLayout() throws Exception { 
        View view = new View(context);
        ViewGroup viewGroup = new FrameLayout(context);
        viewGroup.addView(view);
        shadowOf(viewGroup).setDidRequestLayout(false);
 
        viewGroup.removeAllViews();
        assertThat(shadowOf(viewGroup).didRequestLayout()).isTrue();
    } 
 
    @Test 
    public void addView_shouldRequestLayout() throws Exception { 
        View view = new View(context);
        ViewGroup viewGroup = new FrameLayout(context);
        viewGroup.addView(view);
 
        assertThat(shadowOf(viewGroup).didRequestLayout()).isTrue();
    }