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


Java ActivityInfo.SCREEN_ORIENTATION_BEHIND屬性代碼示例

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


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

示例1: attachPie

private static void attachPie() {
    if (isPieEnabled(mContext, mPieMode, mExpandedDesktopMode)) {

        // Create our container, if it does not exist already
        if (mPieContainer == null) {
            mPieContainer = new PieLayout(mContext, mGbContext, mPieTriggerSlots, mPieSize);
            WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
                    WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
                    | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                    | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                    | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
                    PixelFormat.TRANSLUCENT);
            // This title is for debugging only. See: dumpsys window
            lp.setTitle("PieControlPanel");
            lp.windowAnimations = android.R.style.Animation;
            lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_BEHIND;

            mWindowManager.addView(mPieContainer, lp);
            mPieController.attachTo(mPieContainer);
        }

        // add or update pie triggers
        if (DEBUG) log("AttachPie with trigger position flags: " + mPieTriggerSlots);

        refreshPieTriggers();

    } else {
        for (int i = 0; i < mPieTrigger.length; i++) {
            if (mPieTrigger[i] != null) {
                mWindowManager.removeView(mPieTrigger[i]);
                mPieTrigger[i] = null;
            }
        }
    }
}
 
開發者ID:WrBug,項目名稱:GravityBox,代碼行數:39,代碼來源:ModPieControls.java

示例2: unspecified

/**
 * The requested screen orientation. Commonly used values are
    unspecified (-1), landscape (0), portrait (1), sensor (4), and user (2).  " +
    "See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
    "complete list of possible settings.
 *
 * ScreenOrientation property getter method.
 *
 * @return  screen orientation
 */
@SimpleProperty(category = PropertyCategory.APPEARANCE,
    description = "The requested screen orientation, specified as a text value.  " +
    "Commonly used values are " +
    "landscape, portrait, sensor, user and unspecified.  " +
    "See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
    "complete list of possible settings.")
public String ScreenOrientation() {
  switch (getRequestedOrientation()) {
    case ActivityInfo.SCREEN_ORIENTATION_BEHIND:
      return "behind";
    case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
      return "landscape";
    case ActivityInfo.SCREEN_ORIENTATION_NOSENSOR:
      return "nosensor";
    case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
      return "portrait";
    case ActivityInfo.SCREEN_ORIENTATION_SENSOR:
      return "sensor";
    case ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED:
      return "unspecified";
    case ActivityInfo.SCREEN_ORIENTATION_USER:
      return "user";
    case 10: // ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
      return "fullSensor";
    case 8: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
      return "reverseLandscape";
    case 9: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT
      return "reversePortrait";
    case 6: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
      return "sensorLandscape";
    case 7: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
      return "sensorPortrait";
  }

  return "unspecified";
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:46,代碼來源:Form.java


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