Code example for FrameLayout

Methods: addViewremoveViewAt

0
    } 
 
    @Test 
    public void removeViewAt_shouldRequestLayout() throws Exception { 
        View view = new View(context);
        ViewGroup viewGroup = new FrameLayout(context);
        viewGroup.addView(view);
        shadowOf(viewGroup).setDidRequestLayout(false);
 
        viewGroup.removeViewAt(0);
        assertThat(shadowOf(viewGroup).didRequestLayout()).isTrue();
    } 
 
    @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();