Skip to content

Commit a563c33

Browse files
committed
1:修改下拉刷新标志的颜色。
1 parent 5f996ea commit a563c33

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

module_girls/src/main/java/com/guiying/girls/main/GirlsView.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.guiying.girls.main;
22

33
import android.content.Context;
4+
import android.support.v4.content.ContextCompat;
45
import android.support.v4.widget.SwipeRefreshLayout;
56
import android.support.v7.widget.StaggeredGridLayoutManager;
67
import android.util.AttributeSet;
@@ -52,14 +53,16 @@ private void initView() {
5253
inflate(getContext(), R.layout.view_girls_content, this);
5354
mNetworkErrorLayout = (ViewStub) findViewById(R.id.network_error_layout);
5455
mGirlsRecyclerView = (EasyRecyclerView) findViewById(R.id.girls_recycler_view);
55-
56-
mData = new ArrayList<>();
5756
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
5857
mGirlsRecyclerView.setLayoutManager(staggeredGridLayoutManager);
5958
mAdapter = new GirlsAdapter(getContext());
6059

6160
mGirlsRecyclerView.setAdapterWithProgress(mAdapter);
62-
61+
mGirlsRecyclerView.setRefreshingColor(
62+
ContextCompat.getColor(getContext(), R.color.colorPrimary),
63+
ContextCompat.getColor(getContext(), android.R.color.holo_blue_light),
64+
ContextCompat.getColor(getContext(), android.R.color.holo_green_light)
65+
);
6366
mAdapter.setMore(R.layout.layout_load_more, this);
6467
mAdapter.setNoMore(R.layout.layout_load_no_more);
6568
mAdapter.setError(R.layout.layout_load_error);
@@ -72,6 +75,7 @@ public void onItemClick(int position, BaseViewHolder holder) {
7275

7376
mGirlsRecyclerView.setRefreshListener(this);
7477

78+
mData = new ArrayList<>();
7579
mActive = true;
7680
}
7781

module_news/src/main/java/com/guiying/news/main/NewsListView.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.guiying.news.main;
22

33
import android.content.Context;
4+
import android.support.v4.content.ContextCompat;
45
import android.support.v4.widget.SwipeRefreshLayout;
56
import android.support.v7.widget.LinearLayoutManager;
67
import android.util.AttributeSet;
@@ -36,6 +37,11 @@ public NewsListView(Context context, AttributeSet attrs) {
3637
}
3738

3839
private void initView() {
40+
setRefreshingColor(
41+
ContextCompat.getColor(getContext(), R.color.colorPrimary),
42+
ContextCompat.getColor(getContext(), android.R.color.holo_blue_light),
43+
ContextCompat.getColor(getContext(), android.R.color.holo_green_light)
44+
);
3945
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
4046
setLayoutManager(layoutManager);
4147
DividerDecoration dividerDecoration = new DividerDecoration(getResources().getColor(R.color.gray_e0), 20, 20, 0);

0 commit comments

Comments
 (0)