Synchronize initRealtedVideoStreams*

This commit is contained in:
Coffeemakr 2017-06-27 12:44:20 +02:00
parent ec1ae647b0
commit cea706d14a
2 changed files with 8 additions and 13 deletions

View File

@ -768,7 +768,7 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
if (peek.getInfo() != null) {
final StreamInfo streamInfo = peek.getInfo();
uiHandler.post(new Runnable() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
selectAndHandleInfo(streamInfo);
@ -932,16 +932,11 @@ public class VideoDetailFragment extends BaseFragment implements StreamExtractor
animateView(spinnerToolbar, true, 500);
setupActionBarHandler(info);
initThumbnailViews(info);
uiHandler.post(new Runnable() {
@Override
public void run() {
initRelatedVideos(info);
if (wasRelatedStreamsExpanded) {
toggleExpandRelatedVideos(currentStreamInfo);
wasRelatedStreamsExpanded = false;
}
}
});
initRelatedVideos(info);
if (wasRelatedStreamsExpanded) {
toggleExpandRelatedVideos(currentStreamInfo);
wasRelatedStreamsExpanded = false;
}
setTitleToUrl(info.webpage_url, info.title);
setStreamInfoToUrl(info.webpage_url, info);

View File

@ -55,14 +55,14 @@ public class AnimationUtils {
view.animate().setListener(null).cancel();
view.setVisibility(View.VISIBLE);
view.setAlpha(1f);
if (execOnEnd != null) view.post(execOnEnd);
if (execOnEnd != null) execOnEnd.run();
return;
} else if ((view.getVisibility() == View.GONE || view.getVisibility() == View.INVISIBLE) && !enterOrExit) {
if (DEBUG) Log.d(TAG, "animateView() view was already gone > view = [" + view + "]");
view.animate().setListener(null).cancel();
view.setVisibility(View.GONE);
view.setAlpha(0f);
if (execOnEnd != null) view.post(execOnEnd);
if (execOnEnd != null) execOnEnd.run();
return;
}