Android L - Material design on SwipeRefreshLayout color scheme

后端 未结 2 1613
终归单人心
终归单人心 2021-01-30 16:16

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

2条回答
  •  深忆病人
    2021-01-30 16:57

    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.

    SwipeRefreshLayout

    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/theme_accent_2
    @color/theme_accent_1
    @color/theme_primary
    

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

提交回复
热议问题