Example usage for android.content.res Configuration KEYBOARD_NOKEYS

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

Introduction

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

Prototype

int KEYBOARD_NOKEYS

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

Click Source Link

Document

Constant for #keyboard , value corresponding to the nokeys resource qualifier.

Usage

From source file:com.actionbarsherlock.internal.view.menu.MenuBuilder.java

private void setShortcutsVisibleInner(boolean shortcutsVisible) {
    mShortcutsVisible = shortcutsVisible
            && mResources.getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
}

From source file:org.connectbot.ConsoleActivity.java

/**
 *
 *//* w w  w  .jav a 2 s . c  o  m*/
private void configureOrientation() {
    String rotateDefault;
    if (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_NOKEYS)
        rotateDefault = PreferenceConstants.ROTATION_PORTRAIT;
    else
        rotateDefault = PreferenceConstants.ROTATION_LANDSCAPE;

    String rotate = prefs.getString(PreferenceConstants.ROTATION, rotateDefault);
    if (PreferenceConstants.ROTATION_DEFAULT.equals(rotate))
        rotate = rotateDefault;

    // request a forced orientation if requested by user
    if (PreferenceConstants.ROTATION_LANDSCAPE.equals(rotate)) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        forcedOrientation = true;
    } else if (PreferenceConstants.ROTATION_PORTRAIT.equals(rotate)) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        forcedOrientation = true;
    } else {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
        forcedOrientation = false;
    }
}

From source file:es.javocsoft.android.lib.toolbox.ToolBox.java

/**
 * Return TRUE if there is a hardware keyboard present.
 * //from  w  w  w .j  a  v  a2s. co m
 * @param context
 * @return
 */
public static boolean device_isHardwareKeyboard(Context context) {
    //You can also get some of the features which are not testable by the PackageManager via the Configuration, e.g. the DPAD.
    Configuration c = context.getResources().getConfiguration();
    if (c.keyboard != Configuration.KEYBOARD_NOKEYS) {
        return true;
    } else {
        return false;
    }
}

From source file:com.yek.keyboard.anysoftkeyboard.AnySoftKeyboard.java

/**
 * Override this to control when the soft input area should be shown to the
 * user. The default implementation only shows the input view when there is
 * no hard keyboard or the keyboard is hidden. If you change what this
 * returns, you will need to call {@link #updateInputViewShown()} yourself
 * whenever the returned value may have changed to have it re-evalauted and
 * applied. This needs to be re-coded for Issue 620
 *///from   www  .  j av  a 2 s  .c  o  m
@SuppressLint("MissingSuperCall")
@Override
public boolean onEvaluateInputViewShown() {
    Configuration config = getResources().getConfiguration();
    return config.keyboard == Configuration.KEYBOARD_NOKEYS
            || config.hardKeyboardHidden == Configuration.KEYBOARDHIDDEN_YES;
}