android - ActivityInfo 的横幅有什么用?

标签 android icons android-manifest graphical-logo android-banner

背景

我知道已经有 Logo 和图标(解释了差异 here )。

问题

从 API 20(“L”?或者 Android wear?)开始,现在有一个新的,称为“banner”。以下是文档中关于它的内容:

A drawable resource identifier (in the package's resources) of this component's banner. From the "banner" attribute or, if not set, 0.

所以这并没有提供太多关于它是什么的线索......

问题是我不知道它是什么,也找不到任何相关信息。

我尝试过的

我曾尝试在 Internet 上查找有关此内容的信息,但由于“横幅”是一个通用名称,我没有找到任何有趣的内容...

当然,我也尝试在 Activity 文档(herehere)上搜索这个,但没有找到任何东西......

问题

  1. 它的用途是什么?

  2. 它适用于 Android“L”还是 Android wear?或者两者兼而有之?

  3. 为什么 Google 决定这样做?

  4. 我在哪里可以阅读它?

  5. 有什么指导方针吗?

  6. 取决于答案,您认为它会以某种方式成为支持库的一部分吗?

最佳答案

适用于 Android TV。

来自l developer preview reference docs :

A Drawable resource providing an extended graphical banner for its associated item. Use with the application tag (to supply a default banner for all application activities), or with the activity, tag to supply a banner for a specific activity.

The given banner will be used to display to the user a graphical representation of an activity in the Leanback application launcher. Since banners are displayed only in the Leanback launcher, they should only be used with activities (and applications) that support Leanback mode. These are activities that handle Intents of category Intent.CATEGORY_LEANBACK_LAUNCHER.

This must be a reference to a Drawable resource containing the image definition.

Must be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

This corresponds to the global attribute resource symbol banner.

您还可以阅读更多相关信息 here .

本质上,横幅只是 Leanback 启动器的启动器图标。例如,如果您的应用与手机/平板电脑和 android tv 都兼容,则指定横幅将使您在 android tv 上拥有用于 leanback 启动器的备用(矩形)图标。

在此图像中,我将横幅指定为可绘制的红色形状。默认情况下,这将是您的应用程序启动器图标。

Banner Example

我认为它不会成为任何支持库的一部分,因为它特定于电视上的 Android L。但是要使用它,您需要以 L 为目标。

关于android - ActivityInfo 的横幅有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25596587/

相关文章:

android - Adapter和Activity如何通信

android - 如何在离线时存储数据mqtt并在在线时发送它们

android - AppCompat 工具栏不显示菜单 XML 中的图标集

html - Knockout JS + Bootstrap + 图标 + html 绑定(bind)

Android Studio - 在 Gradle 中为 ManifestPlaceholders 分配多个值

android - 尝试将我自己的 Logo 添加到 Android 应用程序时 list 合并失败 - Android Studio

java - 无法通过 KSOAP Android 登录到 Web 服务

macos - JavaFX native bundle 图标 OS X

android - 如何获取在android主屏幕启动器中找到的所有已安装快捷方式的列表

android - 为什么需要将 Activity/服务显式添加到 Android list 中?