Merge pull request #1707 from mfietz/issue/1706-coverfragment-iae

Audio player fragments: Do not refresh when not attached
This commit is contained in:
Tom Hennen 2016-02-25 06:41:49 -05:00
commit 1ccbdfab49
2 changed files with 2 additions and 9 deletions

View File

@ -63,12 +63,7 @@ public class CoverFragment extends Fragment implements AudioplayerContentFragmen
}
private void loadMediaInfo() {
if(imgvCover == null) {
return;
}
if (media != null) {
Log.d(TAG, "feed title: " + media.getFeedTitle());
Log.d(TAG, "episode title: " + media.getEpisodeTitle());
txtvPodcastTitle.setText(media.getFeedTitle());
txtvEpisodeTitle.setText(media.getEpisodeTitle());
Glide.with(this)
@ -103,7 +98,7 @@ public class CoverFragment extends Fragment implements AudioplayerContentFragmen
@Override
public void onMediaChanged(Playable media) {
if(this.media == media) {
if(!isAdded() || this.media == media) {
return;
}
this.media = media;

View File

@ -62,7 +62,6 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont
private static final String ARG_HIGHLIGHT_TIMECODES = "arg.highlightTimecodes";
private WebView webvDescription;
private String webvData;
private ShownotesProvider shownotesProvider;
private Playable media;
@ -309,7 +308,6 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(data -> {
webvData = data;
webvDescription.loadDataWithBaseURL(null, data, "text/html",
"utf-8", "about:blank");
Log.d(TAG, "Webview loaded");
@ -384,7 +382,7 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont
@Override
public void onMediaChanged(Playable media) {
if(this.media == media) {
if(this.media == media || webvDescription == null) {
return;
}
this.media = media;