remove comments and related

This commit is contained in:
flasker 2023-12-17 16:10:09 +03:00
parent 5c1e431d5e
commit 8205c1fe67
3 changed files with 21 additions and 41 deletions

View File

@ -849,6 +849,7 @@ public final class VideoDetailFragment
getString(R.string.show_age_restricted_content), false)) {
hideAgeRestrictedContent();
} else {
Log.d("Filter", "Video Url that is playing");
handleResult(result);
showContent();
if (addToBackStack) {
@ -881,19 +882,6 @@ public final class VideoDetailFragment
tabIcons.clear();
tabContentDescriptions.clear();
if (shouldShowComments()) {
pageAdapter.addFragment(
CommentsFragment.getInstance(serviceId, url, title), COMMENTS_TAB_TAG);
tabIcons.add(R.drawable.ic_comment);
tabContentDescriptions.add(R.string.comments_tab_description);
}
if (showRelatedItems && binding.relatedItemsLayout == null) {
// temp empty fragment. will be updated in handleResult
pageAdapter.addFragment(EmptyFragment.newInstance(false), RELATED_TAB_TAG);
tabIcons.add(R.drawable.ic_art_track);
tabContentDescriptions.add(R.string.related_items_tab_description);
}
if (showDescription) {
// temp empty fragment. will be updated in handleResult
@ -935,16 +923,7 @@ public final class VideoDetailFragment
}
private void updateTabs(@NonNull final StreamInfo info) {
if (showRelatedItems) {
if (binding.relatedItemsLayout == null) { // phone
pageAdapter.updateItem(RELATED_TAB_TAG, RelatedItemsFragment.getInstance(info));
} else { // tablet + TV
getChildFragmentManager().beginTransaction()
.replace(R.id.relatedItemsLayout, RelatedItemsFragment.getInstance(info))
.commitAllowingStateLoss();
binding.relatedItemsLayout.setVisibility(isFullscreen() ? View.GONE : View.VISIBLE);
}
}
if (showDescription) {
pageAdapter.updateItem(DESCRIPTION_TAB_TAG, new DescriptionFragment(info));

View File

@ -75,7 +75,7 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfoItem, Com
@Override
protected Single<CommentsInfo> loadResult(final boolean forceLoad) {
return ExtractorHelper.getCommentsInfo(serviceId, url, forceLoad);
return null;
}
/*//////////////////////////////////////////////////////////////////////////

View File

@ -69,22 +69,23 @@ public class RelatedItemsFragment extends BaseListInfoFragment<InfoItem, Related
@Override
protected Supplier<View> getListHeaderSupplier() {
if (relatedItemInfo == null || relatedItemInfo.getRelatedItems() == null) {
return null;
}
headerBinding = RelatedItemsHeaderBinding
.inflate(activity.getLayoutInflater(), itemsList, false);
final SharedPreferences pref = PreferenceManager
.getDefaultSharedPreferences(requireContext());
final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
headerBinding.autoplaySwitch.setChecked(autoplay);
headerBinding.autoplaySwitch.setOnCheckedChangeListener((compoundButton, b) ->
PreferenceManager.getDefaultSharedPreferences(requireContext()).edit()
.putBoolean(getString(R.string.auto_queue_key), b).apply());
return headerBinding::getRoot;
return null;
// if (relatedItemInfo == null || relatedItemInfo.getRelatedItems() == null) {
// return null;
// }
//
// headerBinding = RelatedItemsHeaderBinding
// .inflate(activity.getLayoutInflater(), itemsList, false);
//
// final SharedPreferences pref = PreferenceManager
// .getDefaultSharedPreferences(requireContext());
// final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
// headerBinding.autoplaySwitch.setChecked(autoplay);
// headerBinding.autoplaySwitch.setOnCheckedChangeListener((compoundButton, b) ->
// PreferenceManager.getDefaultSharedPreferences(requireContext()).edit()
// .putBoolean(getString(R.string.auto_queue_key), b).apply());
//
// return headerBinding::getRoot;
}
@Override
@ -98,7 +99,7 @@ public class RelatedItemsFragment extends BaseListInfoFragment<InfoItem, Related
@Override
protected Single<RelatedItemInfo> loadResult(final boolean forceLoad) {
return Single.fromCallable(() -> relatedItemInfo);
return Single.never();
}
@Override