imallan/JellyRefreshLayout

Perform refreshing scenario

Closed this issue · 3 comments

Hi,
how to perform refresh programmatically ?
Advice please .
Thanks !

Will add in version 2.0. Stay tuned.

2.0 released. closed.

@allan1st
Greate Thanks !
I just used MotionEvent for this functionality and waiting the update 2.0 to update the solution 👍

private void ShowRefreshLayout() {
        ViewTreeObserver vto = jellyLayout.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if (!layoutBuilt) {
                    MotionEvent event = MotionEvent.obtain(50, 50, MotionEvent.ACTION_MOVE, 0, 1000, MotionEvent.ACTION_CANCEL);
                    jellyLayout.onTouchEvent(event);

                    MotionEvent event2 = MotionEvent.obtain(50, 50, MotionEvent.ACTION_CANCEL, 0, 1000, MotionEvent.ACTION_CANCEL);
                    jellyLayout.onTouchEvent(event2);
                }
            }
        });
    }