Clean ups.

This commit is contained in:
Karim Abou Zeid 2016-03-25 20:48:18 +01:00
commit 6749661b0b
3 changed files with 4 additions and 11 deletions

View file

@ -41,6 +41,7 @@ public abstract class WrappedAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
*/
@Override
protected void onStartLoading() {
super.onStartLoading();
if (this.mData != null) {
deliverResult(this.mData);
} else if (takeContentChanged() || this.mData == null) {
@ -53,6 +54,7 @@ public abstract class WrappedAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
*/
@Override
protected void onStopLoading() {
super.onStopLoading();
// Attempt to cancel the current load task if possible
cancelLoad();
}

View file

@ -39,13 +39,6 @@ public abstract class AbsLibraryPagerRecyclerViewFragment<A extends RecyclerView
private A adapter;
private LM layoutManager;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initLayoutManager();
initAdapter(); // makes sure the adapter is not null when the loader finishes loading
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(getLayoutRes(), container, false);
@ -59,6 +52,8 @@ public abstract class AbsLibraryPagerRecyclerViewFragment<A extends RecyclerView
getLibraryFragment().addOnAppBarOffsetChangedListener(this);
initLayoutManager();
initAdapter();
setUpRecyclerView();
}

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>