Example usage for android.content.res Configuration SCREENLAYOUT_LAYOUTDIR_RTL

List of usage examples for android.content.res Configuration SCREENLAYOUT_LAYOUTDIR_RTL

Introduction

In this page you can find the example usage for android.content.res Configuration SCREENLAYOUT_LAYOUTDIR_RTL.

Prototype

int SCREENLAYOUT_LAYOUTDIR_RTL

To view the source code for android.content.res Configuration SCREENLAYOUT_LAYOUTDIR_RTL.

Click Source Link

Document

Constant for #screenLayout : a #SCREENLAYOUT_LAYOUTDIR_MASK value indicating that a layout dir has been set to RTL.

Usage

From source file:com.android.screenspeak.controller.GestureControllerApp.java

private boolean isScreenLayoutRTL() {
    Configuration config = mService.getResources().getConfiguration();
    if (config == null) {
        return false;
    }/*w  w  w .  java 2  s  . c o m*/
    return (config.screenLayout
            & Configuration.SCREENLAYOUT_LAYOUTDIR_MASK) == Configuration.SCREENLAYOUT_LAYOUTDIR_RTL;
}

From source file:io.lqd.sdk.Liquid.java

@SuppressLint("NewApi")
private boolean isApplicationInBackground(Activity activity) {
    boolean configurationChanged;
    if (Build.VERSION.SDK_INT < 11) {
        int changingConfigs = activity.getChangingConfigurations();
        configurationChanged = (changingConfigs == Configuration.SCREENLAYOUT_LAYOUTDIR_RTL
                || changingConfigs == Configuration.SCREENLAYOUT_LAYOUTDIR_LTR);
    } else {//from   w  w  w  . j a  v a 2s  .  c om
        configurationChanged = activity.isChangingConfigurations();
    }
    return mAttachedActivities.size() == 0 && !configurationChanged;
}