當前位置: 首頁>>代碼示例>>Java>>正文


Java Configuration.HARDKEYBOARDHIDDEN_YES屬性代碼示例

本文整理匯總了Java中android.content.res.Configuration.HARDKEYBOARDHIDDEN_YES屬性的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.HARDKEYBOARDHIDDEN_YES屬性的具體用法?Java Configuration.HARDKEYBOARDHIDDEN_YES怎麽用?Java Configuration.HARDKEYBOARDHIDDEN_YES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.res.Configuration的用法示例。


在下文中一共展示了Configuration.HARDKEYBOARDHIDDEN_YES屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onConfigurationChanged

@Override
public void onConfigurationChanged(Configuration newConfig) {
	super.onConfigurationChanged(newConfig);

	Log.d(TAG, String.format("onConfigurationChanged; requestedOrientation=%d, newConfig.orientation=%d", getRequestedOrientation(), newConfig.orientation));
	if (bound != null) {
		if (forcedOrientation &&
				(newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE &&
						getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) ||
				(newConfig.orientation != Configuration.ORIENTATION_PORTRAIT &&
						getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT))
			bound.setResizeAllowed(false);
		else
			bound.setResizeAllowed(true);

		bound.hardKeyboardHidden = (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES);

		mKeyboardButton.setVisibility(bound.hardKeyboardHidden ? View.VISIBLE : View.GONE);
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:20,代碼來源:ConsoleActivity.java

示例2: 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

示例3: onCreate

@Override
public void onCreate() {
	Log.i(TAG, "Starting service");

	prefs = PreferenceManager.getDefaultSharedPreferences(this);
	prefs.registerOnSharedPreferenceChangeListener(this);

	res = getResources();

	pubkeyTimer = new Timer("pubkeyTimer", true);

	hostdb = HostDatabase.get(this);
	colordb = HostDatabase.get(this);
	pubkeydb = PubkeyDatabase.get(this);

	// load all marked pubkeys into memory
	updateSavingKeys();
	List<PubkeyBean> pubkeys = pubkeydb.getAllStartPubkeys();

	for (PubkeyBean pubkey : pubkeys) {
		try {
			KeyPair pair = PubkeyUtils.convertToKeyPair(pubkey, null);
			addKey(pubkey, pair);
		} catch (Exception e) {
			Log.d(TAG, String.format("Problem adding key '%s' to in-memory cache", pubkey.getNickname()), e);
		}
	}

	vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
	wantKeyVibration = prefs.getBoolean(PreferenceConstants.BUMPY_ARROWS, true);

	wantBellVibration = prefs.getBoolean(PreferenceConstants.BELL_VIBRATE, true);
	enableMediaPlayer();

	hardKeyboardHidden = (res.getConfiguration().hardKeyboardHidden ==
		Configuration.HARDKEYBOARDHIDDEN_YES);

	final boolean lockingWifi = prefs.getBoolean(PreferenceConstants.WIFI_LOCK, true);

	connectivityManager = new ConnectivityReceiver(this, lockingWifi);

	ProviderLoader.load(this, this);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:43,代碼來源:TerminalManager.java


注:本文中的android.content.res.Configuration.HARDKEYBOARDHIDDEN_YES屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。