fix: video download quality banner visibility
Video download banner is not visible for the first time
on Videos tab and appears on pull to refresh.
fixes:
@@ -139,6 +139,7 @@ public class CourseOutlineFragment extends OfflineSupportBaseFragment
private View loadingIndicator;
private FrameLayout flBulkDownload;
private View videoQualityLayout;
+ private TextView tvVideoDownloadQuality;
private CourseOutlineAdapter.DownloadListener downloadListener;
private Call<CourseUpgradeResponse> getCourseUpgradeStatus;
private CourseUpgradeResponse courseUpgradeData;
@@ -179,6 +180,7 @@ public class CourseOutlineFragment extends OfflineSupportBaseFragment
loadingIndicator = view.findViewById(R.id.loading_indicator);
flBulkDownload = view.findViewById(R.id.fl_bulk_download_container);
videoQualityLayout = view.findViewById(R.id.video_quality_layout);
+ tvVideoDownloadQuality = view.findViewById(R.id.tv_video_download_quality);
swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
@@ -770,7 +772,7 @@ public class CourseOutlineFragment extends OfflineSupportBaseFragment
}
private void setUpVideoQualityHeader(CourseComponent courseComponent) {
- if (isVideoMode && isOnCourseOutline && getView() != null) {
+ if (isVideoMode && isOnCourseOutline) {
videoQualityLayout.setVisibility(View.VISIBLE);
videoQualityLayout.setOnClickListener(v -> {
environment.getAnalyticsRegistry().trackVideoDownloadQualityClicked(Analytics.Events.COURSE_VIDEOS_VIDEO_DOWNLOAD_QUALITY_CLICKED,
@@ -862,7 +864,7 @@ public class CourseOutlineFragment extends OfflineSupportBaseFragment
}
private void setVideoQualityHeaderLabel(VideoQuality videoQuality) {
- ((TextView) getView().findViewById(R.id.tv_video_download_quality)).setText(videoQuality.getTitleResId());
+ tvVideoDownloadQuality.setText(videoQuality.getTitleResId());
}
private void showVideoQualitySelectionModal(CourseComponent courseComponent) {
