GridLayout setAlignmentMode - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:setLayoutDirection, addView, setAlignmentMode, setRowOrderPreserved, setUseDefaultMargins
        super.onViewCreated(view, savedInstanceState);
        currentView.addView(create(currentView.getContext()));
    } 
 
    public static View create(Context context) {
        GridLayout layout = new GridLayout(context);
        layout.setUseDefaultMargins(true);
        layout.setAlignmentMode(ALIGN_BOUNDS);
        layout.setRowOrderPreserved(false);
        layout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
 
        Spec row1 = spec(0);
        Spec row2 = spec(1);
        Spec row3 = spec(2, BASELINE);
        Spec row4 = spec(3, BASELINE);
        Spec row5 = spec(2, 3, FILL); // allow the last two rows to overlap the middle two
        Spec row6 = spec(5);
        Spec row7 = spec(6);
 
        Spec col1a = spec(0, 4, CENTER);

8
CodeRank
This code example shows how to use the following methods:setLayoutDirection, addView, setAlignmentMode, setRowOrderPreserved, setUseDefaultMargins
        super.onViewCreated(view, savedInstanceState);
        currentView.addView(create(currentView.getContext()));
    } 
 
    public static View create(Context context) {
        GridLayout layout = new GridLayout(context);
        layout.setUseDefaultMargins(true);
        layout.setAlignmentMode(ALIGN_BOUNDS);
        layout.setRowOrderPreserved(false);
        layout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
 
        Spec row1 = spec(0);
        Spec row2 = spec(1);
        Spec row3 = spec(2, BASELINE);
        Spec row4 = spec(3, BASELINE);
        Spec row5 = spec(2, 3, FILL); // allow the last two rows to overlap the middle two
        Spec row6 = spec(5);
        Spec row7 = spec(6);
 
        Spec col1a = spec(0, 4, CENTER);

8
CodeRank
This code example shows how to use the following methods:setLayoutDirection, addView, setAlignmentMode, setRowOrderPreserved, setUseDefaultMargins
        super.onViewCreated(view, savedInstanceState);
        currentView.addView(create(currentView.getContext()));
    } 
 
    public static View create(Context context) {
        GridLayout layout = new GridLayout(context);
        layout.setUseDefaultMargins(true);
        layout.setAlignmentMode(ALIGN_BOUNDS);
        layout.setRowOrderPreserved(false);
        layout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
 
        Spec row1 = spec(0);
        Spec row2 = spec(1);
        Spec row3 = spec(2, BASELINE);
        Spec row4 = spec(3, BASELINE);
        Spec row5 = spec(2, 3, FILL); // allow the last two rows to overlap the middle two
        Spec row6 = spec(5);
        Spec row7 = spec(6);
 
        Spec col1a = spec(0, 4, CENTER);

6
CodeRank
This code example shows how to use the following methods:setLayoutDirection, addView, setAlignmentMode, setRowOrderPreserved, setUseDefaultMargins
        super.onViewCreated(view, savedInstanceState);
        currentView.addView(create(currentView.getContext()));
    } 
 
    public static View create(Context context) {
        GridLayout layout = new GridLayout(context);
        layout.setUseDefaultMargins(true);
        layout.setAlignmentMode(ALIGN_BOUNDS);
        layout.setRowOrderPreserved(false);
        layout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
 
        Spec row1 = spec(0);
        Spec row2 = spec(1);
        Spec row3 = spec(2, BASELINE);
        Spec row4 = spec(3, BASELINE);
        Spec row5 = spec(2, 3, FILL); // allow the last two rows to overlap the middle two
        Spec row6 = spec(5);
        Spec row7 = spec(6);
 
        Spec col1a = spec(0, 4, CENTER);

6
CodeRank
setAlignmentMode Method Overview
Sets the alignment mode to be used for all of the alignments between the children of this container.
See Code Examples for other Android GridLayout Methods: