Giter VIP home page Giter VIP logo

waveswiperefreshlayout's Introduction

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.

waveswiperefreshlayout's People

Contributors

23code avatar amyu avatar exlsunshine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

waveswiperefreshlayout's Issues

Change size of drop down

According to the screen size the size of refresh is changed. If change the screen in landscape mode the drop down and refresh progress size is increased. how can I fix the size?

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,

Enable/Disable not working correctly

I'm trying to enable and disable the swipe refresh layout like following:

 srl.post(() -> srl.setEnabled(false));

This works 100% reliable, if I use a default swipe refresh layout but fails very often, if I use the WaveSwiperefreshLayout (fails means, the layout is still enabled after calling the function).

Any ideas how to solve that?

The problem is, that you use setEnabled internally as well to temporarily disable the view...

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

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,

Can I get the polka dot?

Hi, thanks for giving this pretty library first.

I wanna get a polka dot you made and give a click listener.

Can you make getCircleView method in public?

Please~~

Thanks!

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?

Some minor improvements

I am using your library and I found something not working perfectly for me so I made some improvements.

The most annoying thing is that if I pull down the list so that it is in DROPPING state, but my finger is still touching the screen and moving, the state will keep transitioning between EXPANDING and DROPPING.

  • Enhancement: Support RecyclerView as ListView is deprecated
  • Fix: @IdRes should be @ColorRes in some places
  • Fix: Weird behavior when event state is DROPPING and touch state is moving

it's not an issue

Can i change the refreshing from the top to the botton? (instead up/down refreshing down/up)

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();
}

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.

Changing the colors

I couldn't find a way to change the color of the background and the arrow, can you help me out with it?

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>

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?

refresh from bottom?

thanks for this beautiful library :)
is it possible to refresh a list from bottom of it?

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>

Bug after fragment restoration

I have another problem. I use the view in a fragment and show the loading circle from code sometimes. This works fine until I rotate the device. Then the circle is not showing if i manually enable the refreshing (although the isRefreshing function returns true). But if I shortly pull down the wave view, then the loading circle is working again and I can enable refreshing from code again without issues.

So basically, after recreating the fragment I can't use the manual refreshing from code until I at least once pulled down the wave view...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.