get View Layout Direction - Android User Interface

Android examples for User Interface:Layout

Description

get View Layout Direction

Demo Code


//package com.java2s;

import android.os.Build;
import android.view.View;

public class Main {
    @SuppressWarnings("")
    public static int getLayoutDirection(View v) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            return v.getLayoutDirection();
        }/*w ww .j ava  2 s .c  om*/

        return View.LAYOUT_DIRECTION_LTR;
    }
}

Related Tutorials