is Layout RTL - Android User Interface

Android examples for User Interface:Layout

Description

is Layout RTL

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.view.View;

public class Main {
    public static boolean isLayoutRTL(Context context) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            Configuration config = context.getResources()
                    .getConfiguration();
            return config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
        } else {//from  w  ww.  ja v  a  2 s  . co  m
            return false;
        }
    }
}

Related Tutorials