當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。