Polishing Your Android Overview Screen Entry:抛光您的Android概述屏幕输入

Looking for a way to further polish your Android app on Lollipop? One option a lot of developers overlook is the Overview Screen.

As the developer docs state:

The overview screen (also referred to as the recents screen, recent task list, or recent apps) is a system-level UI that lists recently accessed activities and tasks. The user can navigate through the list and select a task to resume, or the user can remove a task from the list by swiping it away.

Before Lollipop, the Overview Screen was not configurable. Entries included the application label, launcher icon and a screen shot of what the user was last doing in the app.


寻找一种方式,以进一步擦亮你的棒棒糖上的Android应用程序?一个选项很多开发商忽视的是概述屏幕。

作为开发文档的状态:

    总览屏幕(也称为最近通话屏幕,最近任务列表或最近的应用程序)是一个系统级的UI,该目录最近访问的活动和任务。用户可以通过列表浏览,选择一个任务恢复,或者用户可以通过刷卡穿帮从列表中删除的任务。

棒棒堂之前,概述屏幕是不可配置。参赛作品包括应用程序标签,启动图标和屏幕截图什么样的用户在应用程序最后做的事情。

Side-by-side Comparison: KitKat vs. Lollipop

With Lollipop, a more sleekly styled Overview Screen was introduced. More importantly, the new API enables you to customize the icon, title and top bar color of your application’s Overview Screen “card”:

棒棒糖,更浑厚的风格概览屏幕进行了介绍。更重要的是,新的API,可以自定义图标,标题和应用程序的概述屏幕“一卡通”顶栏的颜色:

Screen “card”:

Side-by-side Comparison: KitKat vs. Lollipop

With a little effort, you can ensure that your Overview Screen card shines amongst the rest.

Default Overview Card Styling and XML

Let’s first explore what happens if you rely on the built-in default Lollipop behavior for styling.

The system will pull values for the Overview card’s icon, label and top bar from your manifest:

  • Icon - android:icon
  • Label text - android:label
  • Top Bar Color - colorPrimary value of android:theme

These values will be pulled from the manifest entry for the activity at the base of the activity stack.1 In most cases, this means the values will be based on your launcher/main activity. If there is no value specified on the activity itself, the system will use the application level value.

An interesting thing to note is that the color of the label text is not configurable directly. Instead, the system automatically selects the text color based on the color used for the top bar. If the top bar is dark, the text will be light. Otherwise, the text will be dark.

Backwards Compatibility and colorPrimary

The colorPrimary attribute was introduced in Lollipop. However, the attribute is available in the v7 appcompat library. If you have not already, you should make sure your app’s theme is Lollipop-compatible. An easy way to do this is include the v7 appcompat library and then base your theme on one of the Appcompat.Theme values, such as Theme.AppCompat.Light.

随着一点点的努力,可以确保您的概述屏幕卡闪耀之间的休息。
默认概观卡片造型和XML

让我们先来探讨,如果你依靠的造型内置的默认棒棒糖行为会发生什么。

该系统将拉动概述卡的图标,标签和从你的清单上栏数值:

    图标 - 安卓图标
    标签文本 - 机器人:标签
    顶栏颜色 - 安卓的colorPrimary值:主题

这些值将被从用于在活动stack.1在大多数情况下的基地活动的清单项拉升,这意味着这些值将根据你的发射/主要活动。如果没有对活动本身指定值,则系统将使用该应用程序的电平值。

一个有趣的事情要注意的是标签文本的颜色不直接配置。相反,系统自动选择基于用于顶栏的颜色的文本颜色。如果最上面一栏是黑暗的,文字会发光。否则,该文本将是黑暗的。
向后兼容性和colorPrimary

该colorPrimary属性中引入了棒棒糖。然而,该属性是在第7版appcompat库中提供。如果你还没有,你应该确保你的应用程序的主题是棒棒糖兼容。一个简单的方法来做到这一点是包括V7 appcompat库,然后基于你的主题上Appcompat.Theme值,如Theme.AppCompat.Light之一。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值