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
|
@Override
|
||||||
protected void onStartLoading() {
|
protected void onStartLoading() {
|
||||||
|
super.onStartLoading();
|
||||||
if (this.mData != null) {
|
if (this.mData != null) {
|
||||||
deliverResult(this.mData);
|
deliverResult(this.mData);
|
||||||
} else if (takeContentChanged() || this.mData == null) {
|
} else if (takeContentChanged() || this.mData == null) {
|
||||||
|
|
@ -53,6 +54,7 @@ public abstract class WrappedAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onStopLoading() {
|
protected void onStopLoading() {
|
||||||
|
super.onStopLoading();
|
||||||
// Attempt to cancel the current load task if possible
|
// Attempt to cancel the current load task if possible
|
||||||
cancelLoad();
|
cancelLoad();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,6 @@ public abstract class AbsLibraryPagerRecyclerViewFragment<A extends RecyclerView
|
||||||
private A adapter;
|
private A adapter;
|
||||||
private LM layoutManager;
|
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
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(getLayoutRes(), container, false);
|
View view = inflater.inflate(getLayoutRes(), container, false);
|
||||||
|
|
@ -59,6 +52,8 @@ public abstract class AbsLibraryPagerRecyclerViewFragment<A extends RecyclerView
|
||||||
|
|
||||||
getLibraryFragment().addOnAppBarOffsetChangedListener(this);
|
getLibraryFragment().addOnAppBarOffsetChangedListener(this);
|
||||||
|
|
||||||
|
initLayoutManager();
|
||||||
|
initAdapter();
|
||||||
setUpRecyclerView();
|
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