Code example for LinearLayout

Methods: setGravity

0
    } 
 
    @Test 
    public void canAnswerGravity() throws Exception { 
        assertThat(shadowOf(linearLayout).getGravity()).isEqualTo(Gravity.TOP | Gravity.START);
        linearLayout.setGravity(Gravity.CENTER_VERTICAL);
        assertThat(shadowOf(linearLayout).getGravity()).isEqualTo(Gravity.CENTER_VERTICAL);
    } 
}