Example usage for android.content.res Configuration UI_MODE_TYPE_NORMAL

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

Introduction

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

Prototype

int UI_MODE_TYPE_NORMAL

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

Click Source Link

Document

Constant for #uiMode : a #UI_MODE_TYPE_MASK value that corresponds to no UI mode resource qualifier specified.

Usage

From source file:com.greatnowhere.radar.MainRadarActivity.java

private String getCurrentUIModeString(int mode) {
    switch (mode) {
    case Configuration.UI_MODE_TYPE_APPLIANCE:
        return "Appliance";
    case Configuration.UI_MODE_TYPE_CAR:
        return "Car";
    case Configuration.UI_MODE_TYPE_DESK:
        return "Desk";
    case Configuration.UI_MODE_TYPE_TELEVISION:
        return "TV";
    case Configuration.UI_MODE_TYPE_NORMAL:
        return "Normal";
    }/*from w  w w  .  j  a v a 2s. c om*/
    return "Unknown";
}

From source file:org.gluu.com.ox_push2.u2f.v2.SoftwareDevice.java

private String getDeviceType() {
    UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);

    int modeType = uiModeManager.getCurrentModeType();
    switch (modeType) {
    case Configuration.UI_MODE_TYPE_NORMAL:
        return "normal";
    case Configuration.UI_MODE_TYPE_DESK:
        return "desk";
    case Configuration.UI_MODE_TYPE_CAR:
        return "car";
    case Configuration.UI_MODE_TYPE_TELEVISION:
        return "television";
    case Configuration.UI_MODE_TYPE_APPLIANCE:
        return "appliance";
    case Configuration.UI_MODE_TYPE_WATCH:
        return "watch";
    }/*from  www  .j  a  v  a 2  s  .  c om*/

    // Cover unknown UI types
    return Integer.toString(modeType);
}