Clean ups.
This commit is contained in:
parent
31265f660b
commit
6749661b0b
3 changed files with 4 additions and 11 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue