Check if this is the right fragment
This commit is contained in:
parent
51aba83ae2
commit
419e449b6f
|
@ -198,7 +198,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
|
|||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
int pos = position;
|
||||
position = -1; // reset
|
||||
return pos;
|
||||
}
|
||||
|
||||
private class CoverTarget extends GlideDrawableImageViewTarget {
|
||||
|
|
|
@ -96,12 +96,6 @@ public class AllEpisodesFragment extends Fragment {
|
|||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
loadItems();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
@ -116,10 +110,18 @@ public class AllEpisodesFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
loadItems();
|
||||
registerForContextMenu(recyclerView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
saveScrollPosition();
|
||||
unregisterForContextMenu(recyclerView);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -269,6 +271,9 @@ public class AllEpisodesFragment extends Fragment {
|
|||
return false;
|
||||
}
|
||||
int pos = listAdapter.getPosition();
|
||||
if(pos < 0) {
|
||||
return false;
|
||||
}
|
||||
FeedItem selectedItem = itemAccess.getItem(pos);
|
||||
|
||||
if (selectedItem == null) {
|
||||
|
@ -305,7 +310,6 @@ public class AllEpisodesFragment extends Fragment {
|
|||
recyclerView.setHasFixedSize(true);
|
||||
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), null);
|
||||
recyclerView.addItemDecoration(itemDecoration);
|
||||
registerForContextMenu(recyclerView);
|
||||
|
||||
progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
|
||||
|
||||
|
|
Loading…
Reference in New Issue