Merge pull request #1707 from mfietz/issue/1706-coverfragment-iae
Audio player fragments: Do not refresh when not attached
This commit is contained in:
commit
1ccbdfab49
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue