How can you change a Swipe refresh layout's color for each rotation?

前端 未结 5 2078
野的像风
野的像风 2021-02-03 19:19

Has anyone noticed the SwipeRefreshLayout in gmail. It changes color for every rotation in a single load iteration. Does anyone have any idea how to achieve it?

5条回答
  •  一生所求
    2021-02-03 20:15

    Here is how you can get the colors from the colors.xml resource and set them as SwipRefreshLayout's color scheme.

    int c1 = getResources().getColor(R.color.refresh_progress_1);
    int c2 = getResources().getColor(R.color.refresh_progress_2);
    int c3 = getResources().getColor(R.color.refresh_progress_3);
    
    mySwipeRefreshLayout.setColorSchemeColors(c1, c2, c3);
    

提交回复
热议问题