Commit 6f80442b authored by Varun Patil's avatar Varun Patil

Restore refreshing

parent 92fcee4a
...@@ -141,14 +141,14 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa ...@@ -141,14 +141,14 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa
updateBody(); updateBody();
/*bodySwipeRefreshLayout = getActivity().findViewById(R.id.body_swipe_refresh_layout); bodySwipeRefreshLayout = getActivity().findViewById(R.id.body_swipe_refresh_layout);
bodySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { bodySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override @Override
public void onRefresh() { public void onRefresh() {
bodyDisplayed = false; bodyDisplayed = false;
updateBody(); updateBody();
} }
});*/ });
Toolbar toolbar = getActivity().findViewById(R.id.toolbar); Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
toolbar.setTitle(min_body.getBodyName()); toolbar.setTitle(min_body.getBodyName());
...@@ -171,15 +171,13 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa ...@@ -171,15 +171,13 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa
body = bodyResponse; body = bodyResponse;
displayBody(); displayBody();
} }
/*if (bodySwipeRefreshLayout.isRefreshing()) bodySwipeRefreshLayout.setRefreshing(false);
bodySwipeRefreshLayout.setRefreshing(false);*/
} }
} }
@Override @Override
public void onFailure(Call<Body> call, Throwable t) { public void onFailure(Call<Body> call, Throwable t) {
/*bodySwipeRefreshLayout.setRefreshing(false);*/ bodySwipeRefreshLayout.setRefreshing(false);
// Network Error
} }
}); });
} }
......
...@@ -42,11 +42,18 @@ ...@@ -42,11 +42,18 @@
</android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/body_recycler_view" android:id="@+id/body_swipe_refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.RecyclerView
android:id="@+id/body_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
<RelativeLayout <RelativeLayout
......
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