当前位置: 首页>>代码示例>>Java>>正文


Java Configuration.KEYBOARD_NOKEYS属性代码示例

本文整理汇总了Java中android.content.res.Configuration.KEYBOARD_NOKEYS属性的典型用法代码示例。如果您正苦于以下问题:Java Configuration.KEYBOARD_NOKEYS属性的具体用法?Java Configuration.KEYBOARD_NOKEYS怎么用?Java Configuration.KEYBOARD_NOKEYS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.res.Configuration的用法示例。


在下文中一共展示了Configuration.KEYBOARD_NOKEYS属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureOrientation

/**
 *
 */
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;
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:ConsoleActivity.java

示例2: checkDisplaySize

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();
    }
}
 
开发者ID:chengzichen,项目名称:KrGallery,代码行数:21,代码来源:AndroidUtilities.java

示例3: readHasHardwareKeyboard

public static boolean readHasHardwareKeyboard(final Configuration conf) {
    // The standard way of finding out whether we have a hardware keyboard. This code is taken
    // from InputMethodService#onEvaluateInputShown, which canonically determines this.
    // In a nutshell, we have a keyboard if the configuration says the type of hardware keyboard
    // is NOKEYS and if it's not hidden (e.g. folded inside the device).
    return conf.keyboard != Configuration.KEYBOARD_NOKEYS
            && conf.hardKeyboardHidden != Configuration.HARDKEYBOARDHIDDEN_YES;
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:8,代码来源:Settings.java

示例4: startNewSession

/**
 * Starts a new session for logging.
 * @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads.
 * If null, UmaSessionStats does not record page loads and tab counts.
 */
public void startNewSession(TabModelSelector tabModelSelector) {
    ensureNativeInitialized();

    mTabModelSelector = tabModelSelector;
    if (mTabModelSelector != null) {
        mComponentCallbacks = new ComponentCallbacks() {
            @Override
            public void onLowMemory() {
                // Not required
            }

            @Override
            public void onConfigurationChanged(Configuration newConfig) {
                mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS;
            }
        };
        mContext.registerComponentCallbacks(mComponentCallbacks);
        mKeyboardConnected = mContext.getResources().getConfiguration()
                .keyboard != Configuration.KEYBOARD_NOKEYS;
        mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) {
            @Override
            public void onPageLoadFinished(Tab tab) {
                recordPageLoadStats(tab);
            }
        };
    }

    nativeUmaResumeSession(sNativeUmaSessionStats);
    updatePreferences();
    updateMetricsServiceState();
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:36,代码来源:UmaSessionStats.java

示例5: setShortcutsVisibleInner

private void setShortcutsVisibleInner(boolean shortcutsVisible) {
    mShortcutsVisible = shortcutsVisible
            && mResources.getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS
            && mResources.getBoolean(
                    R.bool.abs__config_showMenuShortcutsWhenKeyboardPresent);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:6,代码来源:MenuBuilder.java

示例6: isHardwareKeyboardAvailable

/**
 * Procedure checks whether the hard keyboard is available
 */
public static boolean isHardwareKeyboardAvailable(Context context)
{
    return context.getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:7,代码来源:ViewUtils.java


注:本文中的android.content.res.Configuration.KEYBOARD_NOKEYS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。