Example usage for android.content.res Configuration UI_MODE_TYPE_DESK

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

Introduction

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

Prototype

int UI_MODE_TYPE_DESK

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

Click Source Link

Document

Constant for #uiMode : a #UI_MODE_TYPE_MASK value that corresponds to the desk resource qualifier.

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";
    }/*w ww . j ava 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   w  w w . j a  va 2 s. co m*/

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