From cd4bfa728331f92706b676365c3467a58c4eeb54 Mon Sep 17 00:00:00 2001 From: Weizhou He Date: Mon, 27 Jul 2015 03:59:43 -0400 Subject: [PATCH] Added more callback functions --- demo/demo.iml | 6 ++++++ .../java/com/captainhwz/demo/content/ListFragment.java | 10 ++++++++++ .../com/captainhwz/demo/content/NoScrollFragment.java | 10 ++++++++++ .../com/captainhwz/demo/content/ScrollFragment.java | 10 ++++++++++ .../demo/content/ViewPagerContentLayout.java | 10 ++++++++++ 5 files changed, 46 insertions(+) diff --git a/demo/demo.iml b/demo/demo.iml index d52c983..72e5d72 100644 --- a/demo/demo.iml +++ b/demo/demo.iml @@ -69,6 +69,8 @@ + + @@ -82,10 +84,14 @@ + + + + \ No newline at end of file diff --git a/demo/src/main/java/com/captainhwz/demo/content/ListFragment.java b/demo/src/main/java/com/captainhwz/demo/content/ListFragment.java index b92c33c..6b4a182 100644 --- a/demo/src/main/java/com/captainhwz/demo/content/ListFragment.java +++ b/demo/src/main/java/com/captainhwz/demo/content/ListFragment.java @@ -26,4 +26,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public boolean checkCanDoRefresh(MaterialHeaderLayout frame, View content, View header) { return DefaultContentHandler.checkContentCanBePulledDown(frame, listView, header); } + + @Override + public void onChange(float ratio, float offsetY) { + + } + + @Override + public void onOffsetCalculated(int totalOffset) { + + } } diff --git a/demo/src/main/java/com/captainhwz/demo/content/NoScrollFragment.java b/demo/src/main/java/com/captainhwz/demo/content/NoScrollFragment.java index 316a910..917e0ad 100644 --- a/demo/src/main/java/com/captainhwz/demo/content/NoScrollFragment.java +++ b/demo/src/main/java/com/captainhwz/demo/content/NoScrollFragment.java @@ -23,4 +23,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public boolean checkCanDoRefresh(MaterialHeaderLayout frame, View content, View header) { return DefaultContentHandler.checkContentCanBePulledDown(frame, view, header); } + + @Override + public void onChange(float ratio, float offsetY) { + + } + + @Override + public void onOffsetCalculated(int totalOffset) { + + } } diff --git a/demo/src/main/java/com/captainhwz/demo/content/ScrollFragment.java b/demo/src/main/java/com/captainhwz/demo/content/ScrollFragment.java index 80f6c59..ce997b4 100644 --- a/demo/src/main/java/com/captainhwz/demo/content/ScrollFragment.java +++ b/demo/src/main/java/com/captainhwz/demo/content/ScrollFragment.java @@ -25,4 +25,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public boolean checkCanDoRefresh(MaterialHeaderLayout frame, View content, View header) { return DefaultContentHandler.checkContentCanBePulledDown(frame, scrollView, header); } + + @Override + public void onChange(float ratio, float offsetY) { + + } + + @Override + public void onOffsetCalculated(int totalOffset) { + + } } diff --git a/demo/src/main/java/com/captainhwz/demo/content/ViewPagerContentLayout.java b/demo/src/main/java/com/captainhwz/demo/content/ViewPagerContentLayout.java index 4b83749..7999992 100644 --- a/demo/src/main/java/com/captainhwz/demo/content/ViewPagerContentLayout.java +++ b/demo/src/main/java/com/captainhwz/demo/content/ViewPagerContentLayout.java @@ -80,6 +80,16 @@ public boolean checkCanDoRefresh(MaterialHeaderLayout frame, View content, View return adapter.getItem(viewPager.getCurrentItem()).checkCanDoRefresh(frame, content, header); } + @Override + public void onChange(float ratio, float offsetY) { + + } + + @Override + public void onOffsetCalculated(int totalOffset) { + + } + static class MyViewPagerAdapter extends FragmentStatePagerAdapter { List mFragmentList;