Skip to content

Fixes #3705 (Crash when viewing pic I just uploaded) #3782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ public void fetchMediaUriFor(Contribution contribution) {
Timber.d("Fetching thumbnail for %s", contribution.filename);
contributionsPresenter.fetchMediaDetails(contribution);
}

@Override
public void onContributionsUpdated() {
//If the contributions are updated, let the pager fragment know
if (null != mediaDetailPagerFragment) {
mediaDetailPagerFragment.notifyDataSetChanged();
}
}
});

if(null==mediaDetailPagerFragment){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ public interface Callback {
Contribution getContributionForPosition(int position);

void fetchMediaUriFor(Contribution contribution);

void onContributionsUpdated();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public void setContributions(List<Contribution> contributionList) {
this.contributions.clear();
this.contributions.addAll(contributionList);
adapter.setContributions(contributions);
callback.onContributionsUpdated();
}

public interface SourceRefresher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ public void showImage(int i) {
* The method notify the viewpager that number of items have changed.
*/
public void notifyDataSetChanged(){
adapter.notifyDataSetChanged();
if (null != adapter) {
adapter.notifyDataSetChanged();
}
}

@Override
Expand Down