android.app.Activity.isInPictureInPictureMode()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中android.app.Activity.isInPictureInPictureMode()方法的一些代码示例,展示了Activity.isInPictureInPictureMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.isInPictureInPictureMode()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:isInPictureInPictureMode

Activity.isInPictureInPictureMode介绍

暂无

代码示例

代码示例来源:origin: iqiyi/Neptune

@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public boolean isInPictureInPictureMode() {
  return mOriginActivity.isInPictureInPictureMode();
}

代码示例来源:origin: milosmns/silly-android

/**
 * Checks whether the given activity is in PIP mode (picture-in-picture).
 */
public static boolean isInPictureInPictureMode(@Nullable final Activity activity) {
  return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && activity != null && activity.isInPictureInPictureMode();
}

代码示例来源:origin: cemrich/zapp

/**
 * This function can be used with any API level and will return
 * false if the multi window feature is not supported.
 *
 * @param activity to get access to multi window api
 * @return true if activity is currently displayed in multi window mode
 */
@TargetApi(24)
public static boolean isInsideMultiWindow(Activity activity) {
  return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&
    (activity.isInMultiWindowMode() || activity.isInPictureInPictureMode());
}

代码示例来源:origin: zendesk/belvedere

@Override
public boolean shouldShowFullScreen() {
  // Show full screen image stream if the app is in multi window or picture in picture mode
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    if (activity.isInMultiWindowMode() || activity.isInPictureInPictureMode()) {
      return true;
    }
  }
  // If there's a hardware keyboard attached show the picker in full screen mode
  final boolean hasHardwareKeyboard =
      activity.getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
  if (hasHardwareKeyboard) {
    return true;
  }
  // If there's an accessibility service enabled, show in full screen mode
  // Exclude AccessibilityServiceInfo.FEEDBACK_GENRICE this is used by password mangers.
  final AccessibilityManager manager = (AccessibilityManager) activity.getSystemService(Context.ACCESSIBILITY_SERVICE);
  if (manager != null) {
    int flags = AccessibilityServiceInfo.FEEDBACK_AUDIBLE | AccessibilityServiceInfo.FEEDBACK_SPOKEN
        | AccessibilityServiceInfo.FEEDBACK_VISUAL | AccessibilityServiceInfo.FEEDBACK_BRAILLE
        | AccessibilityServiceInfo.FEEDBACK_HAPTIC;
    final List<AccessibilityServiceInfo> enabledAccessibilityServiceList = manager.getEnabledAccessibilityServiceList(flags);
    if (enabledAccessibilityServiceList != null && enabledAccessibilityServiceList.size() > 0) {
      return true;
    }
  }
  return false;
}

相关文章

Activity类方法