LinearLayout getOrientation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for LinearLayout getOrientation method.

This code example shows how to use the following methods:getOrientation, setOrientation
        assertSame(params, linearLayout.getLayoutParams());
    } 
 
    @Test 
    public void canAnswerOrientation() throws Exception { 
        assertThat(linearLayout.getOrientation()).isEqualTo(LinearLayout.HORIZONTAL);
        linearLayout.setOrientation(LinearLayout.VERTICAL);
        assertThat(linearLayout.getOrientation()).isEqualTo(LinearLayout.VERTICAL);
        linearLayout.setOrientation(LinearLayout.HORIZONTAL);
        assertThat(linearLayout.getOrientation()).isEqualTo(LinearLayout.HORIZONTAL);
    } 
 
    @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);
    } 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLayoutParams, getOrientation, setGravity
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related LinearLayout getOrientation Questions & Answers:

getOrientation Method Overview
Returns the current orientation.
See Code Examples for other Android LinearLayout Methods: