From 5802fad9048739347b188fcd6468b680af8a9e2f Mon Sep 17 00:00:00 2001 From: amyu Date: Sun, 9 Aug 2015 14:55:16 +0900 Subject: [PATCH] Fixed : #2 Custom color - instead of blue --- .../android/widget/WaveSwipeRefreshLayout.java | 4 ++++ .../jp/co/recruit_lifestyle/android/widget/WaveView.java | 5 +++++ .../java/jp/co/recruit_lifestyle/sample/MainActivity.java | 2 +- sample/src/main/res/layout/activity_main.xml | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveSwipeRefreshLayout.java b/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveSwipeRefreshLayout.java index 84fdf60..cba8e65 100644 --- a/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveSwipeRefreshLayout.java +++ b/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveSwipeRefreshLayout.java @@ -646,6 +646,10 @@ public void setShadowRadius(int radius) { mWaveView.setShadowRadius(radius); } + public void setWaveColor(int color){ + mWaveView.setWaveColor(color); + } + private static int makeMeasureSpecExactly(int length) { return MeasureSpec.makeMeasureSpec(length, MeasureSpec.EXACTLY); } diff --git a/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveView.java b/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveView.java index 1e0cadd..b9e6978 100644 --- a/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveView.java +++ b/library/src/main/java/jp/co/recruit_lifestyle/android/widget/WaveView.java @@ -630,4 +630,9 @@ public boolean isDisappearCircleAnimatorRunning() { public void setShadowRadius(int radius) { mShadowPaint.setShadowLayer(radius, 0.0f, 2.0f, SHADOW_COLOR); } + + public void setWaveColor(int color) { + mPaint.setColor(color); + invalidate(); + } } diff --git a/sample/src/main/java/jp/co/recruit_lifestyle/sample/MainActivity.java b/sample/src/main/java/jp/co/recruit_lifestyle/sample/MainActivity.java index 40336eb..0d9eb9a 100644 --- a/sample/src/main/java/jp/co/recruit_lifestyle/sample/MainActivity.java +++ b/sample/src/main/java/jp/co/recruit_lifestyle/sample/MainActivity.java @@ -13,7 +13,6 @@ import java.util.ArrayList; import jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout; - public class MainActivity extends AppCompatActivity implements WaveSwipeRefreshLayout.OnRefreshListener { private ListView mListview; @@ -35,6 +34,7 @@ private void initView() { mWaveSwipeRefreshLayout = (WaveSwipeRefreshLayout) findViewById(R.id.main_swipe); mWaveSwipeRefreshLayout.setColorSchemeColors(Color.WHITE, Color.WHITE); mWaveSwipeRefreshLayout.setOnRefreshListener(this); + mWaveSwipeRefreshLayout.setWaveColor(0x00000000); //mWaveSwipeRefreshLayout.setMaxDropHeight(1500); mListview = (ListView) findViewById(R.id.main_list); diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index bdfbc69..d1ff3e8 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -16,11 +16,11 @@ -