user6038288
user6038288

Reputation:

Swipe to Refresher remove Circle indicator

Hello I have a specific situation. My client requested to remove a circle indicator from swipe to refresher library because i added a default android toast that is telling user that data is loading when he scroll bottom to load more data. I'm currently using this library for layout: https://github.com/OrangeGangsters/SwipyRefreshLayout

Does anyone have idea how can i remove that circle that is spinning when I'm pulling fingers from bottom of the screen. I manage to do it partially with setrefreshing(false). It won't load on middle of the screen while loading but it's still visible when user is pulling from bottom.

This is the circle that I'm talking about:

img

Upvotes: 2

Views: 2672

Answers (2)

Shabbir Dhangot
Shabbir Dhangot

Reputation: 9141

I suggest you not to use third party SwipeRefreshLayout. Android already provided it in support v4.

you can use it like

<android.support.v4.widget.SwipeRefreshLayout 
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.swiperefreshlayouttest.MainActivity"
>

<!-- Other Views-->

</android.support.v4.widget.SwipeRefreshLayout>

and when you user swipe from top it will visible.

Code for Java

mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.container);
mSwipeRefreshLayout.setOnRefreshListener(this);

override method for that

@Override
public void onRefresh() {
    Toast.makeText(this, "Refresh", Toast.LENGTH_SHORT).show();
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            mSwipeRefreshLayout.setRefreshing(false);
        }
    }, 2000);
}

This all you want.

Upvotes: 3

Jared Burrows
Jared Burrows

Reputation: 55555

  1. Use the SwipRefreshLayout from the design support lib

  2. Use setRefreshing(false) to hide the indicator

Upvotes: 1

Related Questions