recruit-lifestyle / WaveSwipeRefreshLayout

http://engineer.recruit-lifestyle.co.jp/techblog/2015-08-03-swipe-refresh-layout/
Apache License 2.0
1.92k stars 379 forks source link

Transparent color not working #19

Closed MFlisar closed 8 years ago

MFlisar commented 8 years ago

It seems like the view has it's own background... When using a transparent color for the wave, I can't see what's behind the wave but it looks like seeing the default background behind it...

I have a "workaround" for now, just using a solid color and make the WaveView transparent itself works.

int transparency = 200;
Color cSolid = Color.rgb(255, 0, 0);
Color c = Color.argb(transparancy, 255, 0, 0);

Not working

srl.setWaveColor(c);

Working

srl.setWaveColor(cSolid);

try
{
    Field field = WaveSwipeRefreshLayout.class.getDeclaredField("mWaveView");
    field.setAccessible(true);
    View view = (View)field.get(srl);
    view.setAlpha((float)transparency/255f);
} 
catch (NoSuchFieldException e)
{
    e.printStackTrace();
}
catch (IllegalAccessException e)
{
    e.printStackTrace();
}
amyu commented 8 years ago

Thanks @MFlisar !

Please wait a minute. I will check it!!!!!

amyu commented 8 years ago

@MFlisar

Thank you!

dependencies {
  compile 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6'
}

I have fixed a bug that sets the alpha value! Please contact us if there is a bug ლ(´ڡ`ლ)