Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwipeRefreshLayout Without Progress Spinner

Is it possible to perform SwipeRefreshLayout functionality without showing progress spinner all together. Right now its working perfectly fine with its default behavior of pull to refresh shows Progress spinner and onRefresh() I hide It. But I want to hide it all together just want to use the pull to refresh functionality but without progress spinner.

like image 690
Usman Kurd Avatar asked Aug 10 '17 18:08

Usman Kurd


2 Answers

After Done some RnD found a solution that may help others who want to achieve such functionality

 try {
        Field f = mSwipeRefreshLayout.getClass().getDeclaredField("mCircleView");
        f.setAccessible(true);
        ImageView img = (ImageView)f.get(mSwipeRefreshLayout);
        img.setAlpha(0.0f);
    } catch (NoSuchFieldException | IllegalAccessException e) {
        e.printStackTrace();
    }
like image 136
Usman Kurd Avatar answered Sep 29 '22 19:09

Usman Kurd


swipeRefreshLayout.setProgressViewEndTarget(false, 0)

like image 43
Atakan Akar Avatar answered Sep 29 '22 19:09

Atakan Akar