Commit f11d8027 authored by Varun Patil's avatar Varun Patil

Hide add button on scroll down in feed

parent 39d54b3e
...@@ -154,6 +154,15 @@ public class FeedFragment extends BaseFragment { ...@@ -154,6 +154,15 @@ public class FeedFragment extends BaseFragment {
feedRecyclerView = getActivity().findViewById(R.id.feed_recycler_view); feedRecyclerView = getActivity().findViewById(R.id.feed_recycler_view);
feedRecyclerView.setAdapter(feedAdapter); feedRecyclerView.setAdapter(feedAdapter);
feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
feedRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener(){
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy){
if (dy > 0) fab.hide();
else if (dy < 0) fab.show();
}
});
} catch (NullPointerException e) { } catch (NullPointerException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment