Android L - SwipeRefreshLayout颜色方案的材质设计 [英] Android L - Material design on SwipeRefreshLayout color scheme

查看:1863
本文介绍了Android L - SwipeRefreshLayout颜色方案的材质设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在我最新的项目上实施Material Theme,准备推出新的L版本。



我一直在阅读材料设计指南并找到了这一点。


UI颜色应用

选择调色板



通过在
主菜单中选择三种颜色色调,辅助调色板。重音
颜色可能需要或可能不需要后退选项


或多或少它解释了如何在应用程序,包括重音颜色,但当我使用主要颜色在我的应用程序与SwipeRefreshLayout进度栏,感觉不对。





如果它是重音颜色和 android:colorPrimary



有任何想法吗?



提前感谢

解决方案

材料设计规范已更新为:

  mSwipeRefreshLayout.setColorSchemeResources(
R.color.refresh_progress_1,
R.color.refresh_progress_2,
R.color。 refresh_progress_3);

这里是颜色

 code>< color name =refresh_progress_1> @ color / theme_accent_2< / color> 
< color name =refresh_progress_2> @ color / theme_accent_1< / color>
< color name =refresh_progress_3> @ color / theme_primary< / color>

是的,它是主要颜色和重点颜色的混合。


I´m starting to implement the Material Theme on my newest project, preparing it for the launch of the new L version.

I´ve been reading the Material design guidelines and found this.

UI Color Application

Choose your palette

Limit your choice of colors by choosing three color hues in the primary and one accent color in the secondary palette. The accent color may or may not need fall back options

More or less it explains how to implement those hues on the app, including the accent color but when using the main color on my app with the SwipeRefreshLayout progress bar, it doesn't feel right.

Should it be a mix between the accent color and the android:colorPrimary?

Any thoughts about this? Is there any explanation about implementing progress bars on the Material design guideline that I´ve missed?

Thanks in advance

解决方案

The Material design spec has been updated with the new guidelines for the swipe to refresh pattern.

As of revision 21 of the support library, SwipeRefreshLayout now displays a circular indicator.
When you start swiping down, the indicator has an arrow (which suggests refreshing). When you release it, it loses the arrow and starts spinning.

Now we can still set a color scheme and the progress bar will cycle between the colors.

So which colors should we use?

Let's take a look at the Google I/O source code:

mSwipeRefreshLayout.setColorSchemeResources(
                R.color.refresh_progress_1,
                R.color.refresh_progress_2,
                R.color.refresh_progress_3);

And here are the colors:

<color name="refresh_progress_1">@color/theme_accent_2</color>
<color name="refresh_progress_2">@color/theme_accent_1</color>
<color name="refresh_progress_3">@color/theme_primary</color>

So yes, it is a mix between the primary and the accent colors.

这篇关于Android L - SwipeRefreshLayout颜色方案的材质设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆