android9深色模式_从appcompat到将深色主题应用于android part 1的材料组件

android9深色模式

The Material Design library came with a big update which includes new UI elements(components), guidelines and a lot more. Today, I will show you how you can follow the newest Material Design update into your current apps and add support for a dark theme as well.

Material Design库进行了重大更新,其中包括新的UI元素(组件),指南等。 今天,我将向您展示如何将最新的Material Design更新引入当前的应用程序,以及如何添加对深色主题的支持。

Before we learn how to implement a dark theme in our apps, we need to understand why there is a need to use new material design components.

在学习如何在应用程序中实现深色主题之前,我们需要了解为什么需要使用新的材料设计组件。

为什么要使用新的材料设计库? (Why a new Material Design library?)

Well, the original Material Design was good enough to create beautiful apps/websites. But it was not enough to create a brand that could stand out of the crowd. For eg- If we compare the old Gmail and Microsoft’s Outlook email app which follows the Material Design guidelines, they will look nearly the same. Mostly, the changes will be in brand color or fonts. But it will still look similar to other email apps. Thus, Google created a new library to let brands express their own identity.

好吧,原始的Material Design足以创建漂亮的应用程序/网站。 但这还不足以创建一个可以脱颖而出的品牌。 例如-如果我们比较遵循材料设计指南的旧版Gmail和Microsoft的Outlook电子邮件应用程序,它们的外观几乎相同。 通常,更改将采用品牌颜色或字体。 但是它看起来仍然类似于其他电子邮件应用程序。 因此,谷歌创建了一个新的图书馆,让品牌表达自己的身份。

新的材料设计库中有哪些更改? (What are the changes in the new Material Design library?)

The new Material Design library is built on the top of the original Material Design Support library i.e. they are based on the original concept of paper and ink that represents the real world. Thus material can have motion or change its shape according to its surroundings. The new changes include:

新的材料设计库建立在原始材料设计支持库的顶部,即它们基于代表现实世界的纸张和墨水的原始概念。 因此,材料可以根据其周围环境运动或改变其形状。 新的更改包括:

  1. Color

    颜色
  2. Typography

    版式
  3. Shape

    形状

To implement the above changes, we need to follow Material theming. Material theming is an ability to customize Material Design so that our brand looks unique. It provides a way to easily customize any future changes. As a developer, we would like to change the things at once place and see it changed at every other place. Material theming is a way of achieving this.

要实现上述更改,我们需要遵循Material theming主题 。 材料主题是自定义材料设计的能力,以便我们的品牌看起来独一无二。 它提供了一种轻松自定义未来更改的方法。 作为开发人员,我们希望一次更改所有内容,然后在其他所有位置更改它。 物质主题是实现这一目标的一种方式。

Steps on how to apply dark theme into your apps:

有关如何将深色主题应用于应用程序的步骤:

  1. Use material theming i.e. use color, typography, shape design systems. This will be covered in Part 1, Part2, and Part 3.

    使用材料主题,即使用颜色,版式,形状设计系统。 这将在第1部分,第2部分和第3部分中介绍。
  2. Extend material theming to add dark theme support. This will be covered in Part4.

    扩展材质主题以添加深色主题支持。 这将在第4部分中介绍。
  3. (Optional) Give a user the option to change the theme(light/dark). This too will be covered in Part4.

    (可选)为用户提供更改主题的选项(亮/暗)。 这也将在第4部分中介绍。

I will try to give the best guidelines while implementing dark themes.

在实施深色主题时,我将尝试提供最佳指导。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值