Giter Site home page Giter Site logo

superrecyclerview's Introduction

Maven Central Build Status Android Arsenal

##Description

This is an attempt to make RecyclerView easier to use.

Features built in:

  • ProgressBar while adapter hasn't been set
  • EmptyView if adapter is empty
  • SwipeRefreshLayout (Google's one)
  • Infinite scrolling, when you reach the X last item, load more of them.
  • Swipe To Dismiss or Swipe To Remove
  • Sticky headers (via Eowise, see sample)

##Integration

Just add it to you dependencies

    compile 'com.malinskiy:superrecyclerview:$version'

##Usage

  • Use directly SuperRecyclerView:
   <com.malinskiy.superrecyclerview.SuperRecyclerView
            android:id="@+id/list"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_empty="@layout/emptyview"
            app:layout_moreProgress="@layout/view_more_progress"
            app:mainLayoutId="@layout/layout_recyclerview_verticalscroll"
            app:recyclerClipToPadding="false"
            app:recyclerPadding="16dp"
            app:scrollbarStyle="insideInset"/>
  • Current Attributes supported:
    <attr name="layout_empty" format="reference"/>
    <attr name="layout_moreProgress" format="reference"/>
    <attr name="layout_progress" format="reference"/>
    <attr name="recyclerClipToPadding" format="boolean"/>
    <attr name="recyclerPadding" format="dimension"/>
    <attr name="recyclerPaddingTop" format="dimension"/>
    <attr name="recyclerPaddingBottom" format="dimension"/>
    <attr name="recyclerPaddingLeft" format="dimension"/>
    <attr name="recyclerPaddingRight" format="dimension"/>
    <attr name="scrollbarStyle">
        <flag name="insideOverlay" value="0x0"/>
        <flag name="insideInset" value="0x01000000"/>
        <flag name="outsideOverlay" value="0x02000000"/>
        <flag name="outsideInset" value="0x03000000"/>
    </attr>

    <attr name="mainLayoutId" format="reference"/>

##SuperRecyclerView Java Usage

    recycler.setRefreshListener(new SwipeRefreshLayout.OnRefreshListener {
      @Override
      public void onRefresh() {
          // Do your refresh
      });

    // when there is only 10 items to see in the recycler, this is triggered
    recycler.setupMoreListener(new OnMoreListener() {
      @Override
      public void onMoreAsked(int numberOfItems, int numberBeforeMore, int currentItemPos) {
        // Fetch more from Api or DB
      }}, 10);

    recycler.setupSwipeToDismiss(new SwipeDismissListViewTouchListener.DismissCallbacks() {
      @Override
      public boolean canDismiss(int position) {
        return true
      }

      @Override
      public void onDismiss(RecyclerView recyclerView, int[] reverseSortedPositions) {
        // Do your stuff like call an Api or update your db
      }});

##Scrollbars RecyclerView currently doesn't support setting scrollbars from code that's why I can't parse custom attributes. You have to use appropriate mainLayoutId attribute to have scrollbars visible.

Vertical scrollbars

<com.malinskiy.superrecyclerview.SuperRecyclerView
     app:mainLayoutId="@layout/layout_recyclerview_verticalscroll"
     app:scrollbarStyle="insideInset"
     .../>

Horizontal scrollbars

<com.malinskiy.superrecyclerview.SuperRecyclerView
     app:mainLayoutId="@layout/layout_recyclerview_horizontalscroll"
     app:scrollbarStyle="insideInset"
     .../>

##Swipe layout

  1. You should always assign android:id to @id/recyclerview_swipe. Note that it's a reference to an already defined id, so don't use @+id

  2. The SwipeLayout can only have 2 children that are instances of ViewGroup, e.g. LinearLayout, RelativeLayout, GridLayout

  3. The first child is the bottom view, the second child is the top view

  4. Your adapter should extend BaseSwipeAdapter class

  5. Do not setup swipe to dismiss and use swipe layout at the same time. If you do - a kitten will cry somewhere.

Item example:

<com.malinskiy.superrecyclerview.swipe.SwipeLayout
    android:id="@id/recyclerview_swipe"
    xmlns:swipe="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    swipe:horizontalSwipeOffset="16dp">

    <LinearLayout
        ...
    </LinearLayout>

    <LinearLayout
        ...
    </LinearLayout>

</com.malinskiy.superrecyclerview.swipe.SwipeLayout>

Custom attributes supported:

    <attr name="drag_edge" format="enum">
        <enum name="left" value="0"/>
        <enum name="right" value="1"/>
        <enum name="top" value="2"/>
        <enum name="bottom" value="3"/>
    </attr>
    <attr name="horizontalSwipeOffset" format="dimension"/>
    <attr name="verticalSwipeOffset" format="dimension"/>
    <attr name="show_mode" format="enum">
        <enum name="lay_down" value="0"/>
        <enum name="pull_out" value="1"/>
    </attr>

####Sample java

Proguard

-dontwarn com.malinskiy.superrecyclerview.SwipeDismissRecyclerViewTouchListener*

##Thanks Jake Warthon for implementation of SwipeToDismiss via NineOldAndroids

Eowise for implementation of sticky headers

Quentin Dommerc for inspiration

代码家 for swipe layout implementation

##License

Copyright (c) 2016 Anton Malinskiy

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.
Come on, don't tell me you read that.

superrecyclerview's People

Contributors

ayman-abdelghany avatar daimajia avatar donglua avatar kamiox avatar malinskiy avatar zaream avatar zeliret 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  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

superrecyclerview's Issues

horizontal scroll in the top most position

Hi,
I have an issue with horizontal scrolling inside item when RecyclerView is in the top most position. It starts PullToRefresh gesture when user moves finger not horizontally but slightly down. What i figured out is that it is mostly caught by SwipeRefreshLayout which doe not respect requestDisallowInterceptTouchEvent(boolean b)` method.

    @Override
    public void requestDisallowInterceptTouchEvent(boolean b) {
        // Nope.
    }

See this http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.1_r1/android/support/v4/widget/SwipeRefreshLayout.java#SwipeRefreshLayout.requestDisallowInterceptTouchEvent%28boolean%29

Is it possible to use custom one ? For instance extended from regular SwipeRefreshLayout with the only overridden method that calls ViewGroup's implementation ?

Thanks.

Adding Header

Is there any advised way to add a header (not a sticky header that scrolls down, but a header that minimizes on scroll down, that also doesn't kill the pull to refresh)

OnClickListener

When I scroll the list and select one item the position passed is wrong. You know why this happens??

OnScrollListener - RecyclerView Boundries

I am using the OnScrollListener to hide the Toolbar when scrolling.. This functions correctly with the stock RecyclerView, however when using SRV component, the RecyclerView doesn't translate upwards with the Toolbar, instead it just crops the content.

Any ideas as to how to resolve this? TIA.

Here's how it looks..
Actual Result

Here's how it should look..
Desired Effect

No method to stop refresh.

I add "SwipeRefreshLayout.OnRefreshListener" can add refresh function,but i can't stop fresh process.Please fix it,Thanks!

Swipe to dismiss on SuperRecyclerView in fragment

Hi, I am trying to use the swipe to dismiss feature in a SuperRecyclerView within a ViewPager Fragment. Now, according to the readme : "Do not setup swipe to dismiss and use swipe layout at the same time", so I have included only the SuperRecyclerView in the layout, and then try to add the swipe to dismiss feature by java as in BaseActivity.java :

  • I extend the Fragment by
implements SwipeDismissRecyclerViewTouchListener.DismissCallbacks
  • I setup the set to dismiss bindings :
mRecyclerView.setupSwipeToDismiss(this);
mSparseAnimator = new SparseItemRemoveAnimator();
mRecyclerView.getRecyclerView().setItemAnimator(mSparseAnimator);
  • and then I implement the methods :
   @Override
    public boolean canDismiss(int i) {
        return true;
    }

    @Override
    public void onDismiss(RecyclerView recyclerView, int[] reverseSortedPositions) {
        Log.i(Constants.TAG_NAME,"within onDismiss");
        for (int position : reverseSortedPositions) {
            mSparseAnimator.setSkipNext(true);
            mAdapter.remove(position);
        }
    }

Yet, I am unable to get my recyclerview list to dismiss on swipe. My recyclerview item implementation is exactly like item_string.xml.
Am I missing something?

SwipeToDismiss with undo layout ?

Hi,
First of all I want to thank you guys for grate library.

I am playing around with SwipeToDismiss functionality and I'm just wondering if there is a way to sat a layout for item after it is swiped out in order to place undo button or show progress while performing network request ?

Thanks.

Ripple touch effect

Hi!

How I can add a touch feedback event to list?
I'm trying to add the event to SuperRecyclerView but nothing is working.

height: wrap_content not working

I am trying to get the SuperRecyclerView to wrap its content, this is the result:

But when I use the normal RecyclerView it does work:

How can I fix this?

Event conflict

It's conflicted between SwipeDismissRecyclerViewTouchListener and OnClickListener of the item view.

Attributes setters

Hi,

I was wondering if it would be possible to configure the SuperRecyclerView programmatically with setters, it would be nice to change the SuperRecyclerView dynamically.

By the way, thanks for adding the getter on the empty view !

Thanks !

Christophe

Infinite more loading

Hi, I can't figure out how to specify when to load more items to the list. And how to stop this process. It starts loading more after short up swipe and never stops.

ItemAnimation has no effect

I'm trying to add ItemAnimations and there seem to be no effect.
I tried .getRecyclerView.addItemAnimator()
Even the default ItemAnimator has no effect

Disable refresh.

Hi,

I'm using refresh feature only when failed to retrieve data from a network source and disabling it when data has been received. Calling setRefreshListener(null) should disable the listener instead of enabling it.

Retrieve the EmptyView layout

Is it possible to retrieve the empty view via a getter?
It would be nice to change the content of the view dynamically and reuse the empty layout for other SuperRecyclerView.

Thanks !

Deferred Item Delete and Undo Dismiss on failure

Hi, first of all thanks for the brilliant functionality as part of your library, I have a recyclerview where if a user does swipe to delete, the item has to be deleted from a cloud storage service, if the deletion is successful , the swipe to delete actually works, if not, I need to bring that item back in to indicate failure, how can it be achieved, thanks for your reply in advance

How to remove circular progress bar at bottom of recyclerview

I am using recycler view inside fragment after loading data the circular progress bar is still visible at bottom . I want after loading data the circular progress bar hides
this is my fragment layout please help me

  <?xml version="1.0" encoding="utf-8"?>
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
    android:layout_height="match_parent">

<com.malinskiy.superrecyclerview.SuperRecyclerView
  android:id="@+id/list"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  app:recyclerClipToPadding="false"
  app:recyclerPadding="16dp"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
/>
</RelativeLayout>

ClickListeners on different views in SuperRecyclerView item/row not working

@Malinskiy I have used this SuperRecyclerView and its really SUPER,

but m facing one issue, I am able to do action on onListItemClick() call when user tap on SuperRecyclerView item/row. But I am not able to listen to clickListeners on different views on same item/row.

For e.g There is one List item and that contains one favorite button, but when I click favorite button both onListItemClick() and my onViewClickListener() gets called at a time. In this case only the view's clickListener should work

Is there any setting I am not doing?

Adapter's notifyItemRange* methods do not update layout

There is no reaction on notifyItemRangeChanged (for example) method invocation.
You have an "update" method but I cant see where it is actually updates main layout.

 private void update() {
  mProgress.setVisibility(View.GONE);
  isLoadingMore = false;
  mPtrLayout.setRefreshing(false);
  if (mRecycler.getAdapter().getItemCount() == 0 && mEmptyId != 0) {
    mEmpty.setVisibility(View.VISIBLE);
  } else if (mEmptyId != 0) {
    mEmpty.setVisibility(View.GONE);
  }
}

layout_recyclerSelector vs recyclerPadding

layout_recyclerSelector needs to be set for recyclerPadding to work. It is unclear why this is or should be - I just want some padding. Also layout_recyclerSelector doesn't actually seem to do anything either way.

Item selector

How can I use an item selector with SuperRecyclerView?
I tried to set a background of my item view to '?android:activatedBackgroundIndicator' but nothing happens =(

What about drag and drop?

I was curious if you were planning on adding in drag and drop for easy reordering.
I have a project that consists of a few headers and some list items but I would love to be able to drag one list cell up or down and put it about or below a header if needed.

custom progressbar

I want to show custom Progressbar.How can i override the existing one?

empty layout and progress layout don't show when SuperRecyclerView is in a fragment

I have a fragment where the recyclerView works fine but the progress layout and the empty layouts don't show when its in progress or empty. Is there any reason for this?

Here is my onCreateView function

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_list, container, false);

    ButterKnife.inject(this, view);

    initRecyclerView();

    return view;
}

setOnItemClickListener

recycleview.setOnItemClickListener(new OnItemClickListener() { @OverRide
public void onItemClick(AdapterView<?> parent,View view, int position, long id) {
});
}

Is there any method like this ?
so we can access it in out Activity ?

Header adapter example refresh NullPointerException

Process: com.malinskiy.superrecyclerview.sample, PID: 15174
java.lang.NullPointerException
at com.eowise.recyclerview.stickyheaders.HeaderStore.wasHeader(HeaderStore.java:98)
at com.eowise.recyclerview.stickyheaders.StickyHeadersItemDecoration.getItemOffsets(StickyHeadersItemDecoration.java:89)
at android.support.v7.widget.RecyclerView.getItemDecorInsetsForChild(RecyclerView.java:2744)
at android.support.v7.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:5543)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1332)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1269)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:523)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:1942)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2237)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:543)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1694)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1548)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1457)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14884)
at android.view.ViewGroup.layout(ViewGroup.java:4651)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2050)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1807)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1044)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5818)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:768)
at android.view.Choreographer.doCallbacks(Choreographer.java:581)
at android.view.Choreographer.doFrame(Choreographer.java:551)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:754)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:711)
at dalvik.system.NativeStart.main(Native Method)

set progress bar

Hi,
is there a way to set a custom progress bar for the library?

I wanted to use com.pnikosis.materialishprogress.ProgressWheel with SuperRecyclerView but didn't figure out how?

Thanks

NullPointerExecption in RecyclerView when calling stopScroll() method

Hi,

So me and the team have been using this library for our project and after a while we runned into the situation stated in this StackOverflow Question: http://stackoverflow.com/a/26908738
Our app started crashing randomly giving this error:

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView$LayoutManager.stopSmoothScroller()' on a null object reference

Then we noticed it was happening mainly when returning back to a SuperRecyclerView that was empty but know needed to display some content. But the issue happen on other situations that required the initialization of the SuperRecyclerView.

We solved it by applying the solution given in the SA Question in a forked version of this library, ending up replacing the RecyclerView variable for HotFixRecyclerView in the SuperRecyclerView class and layouts.
Can you introduce this error handling in the library? Or do you have other suggestion on how to bypass this issue?

Thanks, and great work with the library!

Bug on the list sample: animation for swipe-to-remove and empty row for swipe-to-refresh

On Nexus 4 with Lollipop, I have 2 issues for the list example:

  1. when performing swipe-to-remove, the item is removed, the items below go up, but then the same items reappear with animations (animating from top to bottom).
  2. when performing swipe-to-refresh, I get an empty item as the first row, then one is added to the bottom, and then one is shown at the top (without animation).

Multiselect

Does SuperRecyclerView support multiselect?

In the new version is unusable

In version recyclerview 22.2.0, onScrolled method was called when setAdapter ,onMoreAsked method was called and load more view is visible.

RecyclerView revision 22

Couple of days ago, google released new recyclerview update - com.android.support:recyclerview-v7:22.0.0

no scrollbars

Just converting from a basic RecyclerView to SuperRecyclerView, using only the dismiss functionality as an extra. Just noticed scrollbars are gone:

<com.malinskiy.superrecyclerview.SuperRecyclerView
        android:id="@+id/recycler_view"
        android:scrollbars="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:scrollbarStyle="outsideOverlay"
        app:recyclerClipToPadding="false"
        app:recyclerPaddingTop="8dp"
        app:recyclerPaddingBottom="8dp"
        app:layout_recyclerSelector="?android:attr/selectableItemBackground" />

Tried various changes to bring them back, but to no avail.

How to set recyclerClipToPadding and recyclerPaddingTop programically

While I can set these details in xml

<com.malinskiy.superrecyclerview.SuperRecyclerView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_empty="@layout/recycler_empty"
            app:layout_progress="@layout/recycler_progress"
            app:layout_moreProgress="@layout/recycler_more_progress"
            app:mainLayoutId="@layout/layout_recyclerview_verticalscroll"
            app:scrollbarStyle="insideInset"
-->         app:recyclerClipToPadding="false"
-->         app:recyclerPaddingTop="100dp"/>

I cant set them with the standard methods of:

mRecycler.setPadding(0, 0, 0, 0);
mRecycler.setClipToPadding(false);

because this just affects

android:ClipToPadding="false"
android:PaddingTop="100dp"

And the clip to padding doesn't work. How can I access:

app:recyclerClipToPadding="false"
app:recyclerPaddingTop="100dp"

in code?

Customize touch callback on EmptyView

Hey guy,

I have a question about customize click event on empty view, because I put several button in empty view, but it's no way to set callback listener on each button. is it any suggestion for this requirement?

BTW, this is my current solution for requirement.
cardinalblue@724b5e0

Proguard setup

I have minifyEnabled on my project and I get:

Warning:com.malinskiy.superrecyclerview.SwipeDismissRecyclerViewTouchListener$1: can't find referenced class com.malinskiy.superrecyclerview.SwipeDismissRecyclerViewTouchListener
Warning:com.malinskiy.superrecyclerview.SwipeDismissRecyclerViewTouchListener$DismissCallbacks: can't find referenced class com.malinskiy.superrecyclerview.SwipeDismissRecyclerViewTouchListener

Can you show me a proguard setup to use this library?

OnMoreAsked not being called

Hello. I'm making API calls to get more items as the user reaches the end of the page. That api call gives me 10 at a time. The problem is when the user reaches the end of the page the OnMoreAsked method is not being called. And I believe the problem is with the max number.

Currently I have the following:

<com.malinskiy.superrecyclerview.SuperRecyclerView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/feed_item_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_empty="@layout/emptyview"
app:layout_moreProgress="@layout/layout_progress"/>

mSuperRecyclerView.setupMoreListener(new OnMoreListener()
{
@OverRide
public void onMoreAsked(int numberOfItems, int numberBeforeMore, int currentItemPos)
{
Toast.makeText(getActivity(), "Older items", Toast.LENGTH_SHORT).show();
}
}, 10);

I have tried with different numbers but it is never being triggered. Note: My list can have more than 10 items in it, it just fetches from the backend 10 at a time.

How to properly use swipe-to-dismiss?

I have a SuperRecyclerView instance and I setup a swipe-to-dismiss callback to it. The canDismiss method returns true. But it does not work.
Probably I do something wrong.

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.