WaveSwipeRefreshLayout

Overview

WaveSwipeRefreshLayout

Android Arsenal ![Release](https://img.shields.io/github/release/recruit-lifestyle/WaveSwipeRefreshLayout.svg?label=maven version) License

This project aims to provide a reusable WaveSwipe to Refresh widget for Android.
Even if this works fine with API.13 or less, we support only for API.14 or more.

##Screenshots Watch YouTube video here.

Requirements

Target Sdk Version : 21
Min Sdk Version : 14

##How to use

  1. Add this to your build.gradle.
repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
  compile 'com.github.recruit-lifestyle:WaveSwipeRefreshLayout:1.6'
}
  1. Add java jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout , which has at least one AbsListView, to your layout XML file.
<jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/main_swipe">

      <ListView
          android:id="@+id/main_list"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/>

</jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout>
  1. Add the function so that the your application knows when a user has completed a 'WaveSwipeRefresh'.
mWaveSwipeRefreshLayout = (WaveSwipeRefreshLayout) findViewById(R.id.main_swipe);
mWaveSwipeRefreshLayout.setOnRefreshListener(new WaveSwipeRefreshLayout.OnRefreshListener() {
  @Override public void onRefresh() {
    // Do work to refresh the list here.
    new Task().execute();
  }
});

private class Task extends AsyncTask<Void, Void, String[]> {
  ...
  @Override protected void onPostExecute(String[] result) {
    // Call setRefreshing(false) when the list has been refreshed.
    mWaveSwipeRefreshLayout.setRefreshing(false);
    super.onPostExecute(result);
  }
}

Credits

WaveSwipeRefresh is owned and maintained by RECRUIT LIFESTYLE CO., LTD.

WaveSwipeRefresh was originally created by
Yuki Mima
Jumpei Matsuda

##License

Copyright 2015 RECRUIT LIFESTYLE CO., LTD.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Set top offset for wave animation

    Set top offset for wave animation

    I want to use the layout in fullscreen mode with transparent toolbar and statusbar, where the content is visible underneath the toolbar and statusbar. So I would need the SwipeResfreshLayout to fill the screen (because it's scrollable content fills the screen as well and is visible underneath the toolbar and statusbar), but the wave animation should start underneath the toolbar.

    Is this somehow possible?

    opened by MFlisar 5
  • Activate WaveView#setMaxDropHeight

    Activate WaveView#setMaxDropHeight

    Current implementation of WaveView#setMaxDropHeight ignores the changed parameter. I fixed it and added the UI component which is related with this feature.

    I couldn't notice it, sorry.

    Relates with #10

    opened by jmatsu 4
  • Change position of the WaveView

    Change position of the WaveView

    I love this library thank you! One thing though, how would I go about changing the position of the refresh indicator (the ball as shown below, the position doesn't change)?

    screenshot 2015-10-29 21 18 29
    swipeRefreshLayout.setMaxDropHeight(10);
    

    I tried setMaxDropHeight but it doesn't work, is it the problem with newer versions?

    opened by TPeterW 4
  • hi sorry WaveswiperefreshLayout container recyclerview problem fix please help me

    hi sorry WaveswiperefreshLayout container recyclerview problem fix please help me

    Scroll when refreshing why <mn.slide.ubinfo.view.pulltorefresh.WaveSwipeRefreshLayout android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent">

        <com.marshalchen.ultimaterecyclerview.UltimateRecyclerView
            android:id="@+id/listView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical" />
    </mn.slide.ubinfo.view.pulltorefresh.WaveSwipeRefreshLayout>
    
    opened by xesun 3
  • drop disappears on changing orientation

    drop disappears on changing orientation

    Hello there

    When you change the orientation of the phone - from landscape to portrait or vice versa while the drop is loading, it disappears. Shouldn't it rotate with the screen?

    Regards,

    enhancement 
    opened by iSimar 3
  • The drop goes under the screen

    The drop goes under the screen

    In my screen I have a recyclerview and the recyclerview is placed in the middle of the screen. That's why while I am pulling for refresh the drop goes under the screen that is not visible to user. I want to show the drop in the visible screen.

    Any help will be appreciated.

    opened by reversecoder 2
  • Transparent color not working

    Transparent color not working

    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();
    }
    
    opened by MFlisar 2
  • Improve ways to change the color of WaveView

    Improve ways to change the color of WaveView

    This PR improves the userability and the readability of this library.

    • Added a setRGBColor method for WaveView to WaveViewSwipeRefreshLayout
    • Added the button for changing the color of WaveView when running the sample module

    This is a suggestion

    opened by jmatsu 2
  • Hello WaveSwipeRefreshLayout include Recyclerview problem scroll up when always refreshing

    Hello WaveSwipeRefreshLayout include Recyclerview problem scroll up when always refreshing

    <jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout
        android:id="@+id/main_swipe"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <com.marshalchen.ultimaterecyclerview.UltimateRecyclerView
            android:id="@+id/listView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:recyclerviewScrollbars="vertical" />
    </jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout>
    
    opened by xesun 2
  • Bug fix

    Bug fix

    Hi there, I run your project in my Eclipse, and the animation it's amazing!!! But I found a minor bug, I don't know if it will occur in Android Studio, but I fixed it in this way:

    1. Bug description

    1. Scroll to the top, and then pull to refresh the listview. 2. Repeat step 1, then I found that the drop animation was no long wright after the first pull refresh operation. I stepped into your code, then I found: mDropCircleAnimator, mDropVertexAnimator, mDropBounceVerticalAnimator, mDropBounceHorizontalAnimator were all good, but mDisappearCircleAnimator. I think there are some problems in mDisappearCircleAnimator animation, ofFloat() function is especially suspicious.

    2. Solution

    I set the mDisappearCircleAnimator "visible" using ValueAnimator.ofFloat(1.f, 1.f) with duration 1 miliseconds at the begining of startDropAnimation() function.

    Then problem solved. And again, I don't know if this will occur in Android Studio, if it does, then I hope this will work for you.

    opened by Exlsunshine 1
  • Could not find swiperefreshlayout-1.0.0.aar

    Could not find swiperefreshlayout-1.0.0.aar

    > Could not find swiperefreshlayout-1.0.0.aar (androidx.swiperefreshlayout:swiperefreshlayout:1.0.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/androidx/swiperefreshlayout/swiperefreshlayout/1.0.0/swiperefreshlayout-1.0.0.aar

    opened by Mohammad2416 1
  • Wiki page needed

    Wiki page needed

    The library is very cool but I think it needs a small Wiki page or more documentation to know what customization we can do with it, for example changing the wave color, setting the drop height etc,

    opened by bryan-ibrahim 0
  • Can i change the sensitivity of the pull to request

    Can i change the sensitivity of the pull to request

    Even during horizontal scroll we cannot expect the user to scroll at the perfect horizontal direction and even minute distortion in the swiping angles causes the layout to reload.

    opened by gopalawasthi123 0
Owner
Recruit Lifestyle Co. Ltd.
Recruit Lifestyle Co. Ltd.
Recruit Lifestyle Co. Ltd.