HARDKEYBOARDHIDDEN_NO源码实例Demo

android.content.res.Configuration#HARDKEYBOARDHIDDEN_NO源码实例Demo

下面列出了android.content.res.Configuration#HARDKEYBOARDHIDDEN_NO 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: KrGallery   文件: AndroidUtilities.java
public static void checkDisplaySize() {
    try {
        Configuration configuration = applicationContext.getResources()
                .getConfiguration();
        usingHardwareInput = configuration.keyboard != Configuration.KEYBOARD_NOKEYS
                && configuration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
        WindowManager manager = (WindowManager) applicationContext
                .getSystemService(Context.WINDOW_SERVICE);
        if (manager != null) {
            Display display = manager.getDefaultDisplay();
            if (display != null) {
                display.getMetrics(displayMetrics);
                display.getSize(displaySize);
                Log.d("tmessages", "display size = " + displaySize.x + " " + displaySize.y + " "
                        + displayMetrics.xdpi + "x" + displayMetrics.ydpi);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码2 项目: CreditCardView   文件: CardEditActivity.java
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    // Checks whether a hardware keyboard is available
    if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {

        RelativeLayout parent = (RelativeLayout) findViewById(R.id.parent);
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) parent.getLayoutParams();
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, 0);
        parent.setLayoutParams(layoutParams);

    }
}
 
源代码3 项目: talkback   文件: KeyboardUtils.java
/**
 * Returns true if either soft or hard keyboard is active.
 *
 * @param service Accessibility Service that is currently trying to get keyboard state.
 * @return {@code true} if either soft or hard keyborad is active, else {@code false}.
 */
// TODO: Move the logic of updating keyboard state into WindowTracker.
public static boolean isKeyboardActive(AccessibilityService service) {
  if (service == null) {
    return false;
  }
  Configuration config = service.getResources().getConfiguration();
  WindowManager windowManager = new WindowManager(service);

  boolean isSoftKeyboardActive = windowManager.isInputWindowOnScreen();
  boolean isHardKeyboardActive =
      (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO);

  return isSoftKeyboardActive || isHardKeyboardActive;
}
 
源代码4 项目: mini2Dx   文件: AndroidMini2DxGame.java
@Override
public void onConfigurationChanged(Configuration config) {
	super.onConfigurationChanged(config);
	boolean keyboardAvailable = false;
	if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)
		keyboardAvailable = true;
	input.keyboardAvailable = keyboardAvailable;
}
 
源代码5 项目: Ansole   文件: Term.java
private boolean checkHaveFullHwKeyboard(Configuration c) {
    return (c.keyboard == Configuration.KEYBOARD_QWERTY)
            && (c.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO);
}