SponsorBlock: Merge branch 'dev' into sponsorblock

This commit is contained in:
polymorphicshade 2020-08-04 01:04:40 -06:00
commit ed831376ff
10 changed files with 31 additions and 54 deletions

View file

@ -6,8 +6,6 @@ assignees: ''
--- ---
# We have fixed the decrpytion exception and a new release is on its wait. Please do not report the bug, that no videos can be played.
If you are about to report something else, please remove this and the above line. Thank you :)
<!-- <!--
Oh no, a bug! It happens. Thanks for reporting an issue with NewPipe. If this is your first bug report, read the following information before proceeding: Oh no, a bug! It happens. Thanks for reporting an issue with NewPipe. If this is your first bug report, read the following information before proceeding:

View file

@ -148,10 +148,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_search: case R.id.action_search:
try { try {
NavigationHelper.openSearchFragment( NavigationHelper.openSearchFragment(getFM(),
getFragmentManager(), ServiceHelper.getSelectedServiceId(activity), "");
ServiceHelper.getSelectedServiceId(activity),
"");
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e); ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
} }

View file

@ -112,7 +112,6 @@ import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import icepick.State; import icepick.State;
@ -505,7 +504,7 @@ public class VideoDetailFragment
case ReCaptchaActivity.RECAPTCHA_REQUEST: case ReCaptchaActivity.RECAPTCHA_REQUEST:
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
NavigationHelper NavigationHelper
.openVideoDetailFragment(getFragmentManager(), serviceId, url, name); .openVideoDetailFragment(getFM(), serviceId, url, name);
} else { } else {
Log.e(TAG, "ReCaptcha failed"); Log.e(TAG, "ReCaptcha failed");
} }
@ -579,9 +578,9 @@ public class VideoDetailFragment
openPopupPlayer(false); openPopupPlayer(false);
break; break;
case R.id.detail_controls_playlist_append: case R.id.detail_controls_playlist_append:
if (getFragmentManager() != null && currentInfo != null) { if (getFM() != null && currentInfo != null) {
PlaylistAppendDialog.fromStreamInfo(currentInfo) PlaylistAppendDialog.fromStreamInfo(currentInfo)
.show(getFragmentManager(), TAG); .show(getFM(), TAG);
} }
break; break;
case R.id.detail_controls_download: case R.id.detail_controls_download:
@ -634,11 +633,8 @@ public class VideoDetailFragment
private void openChannel(final String subChannelUrl, final String subChannelName) { private void openChannel(final String subChannelUrl, final String subChannelName) {
try { try {
NavigationHelper.openChannelFragment( NavigationHelper.openChannelFragment(getFM(), currentInfo.getServiceId(),
getFragmentManager(), subChannelUrl, subChannelName);
currentInfo.getServiceId(),
subChannelUrl,
subChannelName);
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e); ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
} }
@ -1177,7 +1173,7 @@ public class VideoDetailFragment
// Video view can have elements visible from popup, // Video view can have elements visible from popup,
// We hide it here but once it ready the view will be shown in handleIntent() // We hide it here but once it ready the view will be shown in handleIntent()
Objects.requireNonNull(playerService.getView()).setVisibility(View.GONE); playerService.getView().setVisibility(View.GONE);
addVideoPlayerView(); addVideoPlayerView();
final Intent playerIntent = NavigationHelper final Intent playerIntent = NavigationHelper
@ -1351,7 +1347,7 @@ public class VideoDetailFragment
final int height; final int height;
if (player != null && player.isFullscreen()) { if (player != null && player.isFullscreen()) {
height = isInMultiWindow() height = isInMultiWindow()
? Objects.requireNonNull(getView()).getHeight() ? requireView().getHeight()
: activity.getWindow().getDecorView().getHeight(); : activity.getWindow().getDecorView().getHeight();
} else { } else {
height = isPortrait height = isPortrait

View file

@ -426,8 +426,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
case R.id.sub_channel_title_view: case R.id.sub_channel_title_view:
if (!TextUtils.isEmpty(currentInfo.getParentChannelUrl())) { if (!TextUtils.isEmpty(currentInfo.getParentChannelUrl())) {
try { try {
NavigationHelper.openChannelFragment(getFragmentManager(), NavigationHelper.openChannelFragment(getFM(), currentInfo.getServiceId(),
currentInfo.getServiceId(), currentInfo.getParentChannelUrl(), currentInfo.getParentChannelUrl(),
currentInfo.getParentChannelName()); currentInfo.getParentChannelName());
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e); ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);

View file

@ -286,10 +286,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
if (!TextUtils.isEmpty(result.getUploaderUrl())) { if (!TextUtils.isEmpty(result.getUploaderUrl())) {
headerUploaderLayout.setOnClickListener(v -> { headerUploaderLayout.setOnClickListener(v -> {
try { try {
NavigationHelper.openChannelFragment(getFragmentManager(), NavigationHelper.openChannelFragment(getFM(), result.getServiceId(),
result.getServiceId(), result.getUploaderUrl(), result.getUploaderName());
result.getUploaderUrl(),
result.getUploaderName());
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e); ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
} }

View file

@ -505,7 +505,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
Log.d(TAG, "onClick() called with: v = [" + v + "]"); Log.d(TAG, "onClick() called with: v = [" + v + "]");
} }
if (TextUtils.isEmpty(searchEditText.getText())) { if (TextUtils.isEmpty(searchEditText.getText())) {
NavigationHelper.gotoMainFragment(getFragmentManager()); NavigationHelper.gotoMainFragment(getFM());
return; return;
} }
@ -807,7 +807,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(intent -> { .subscribe(intent -> {
getFragmentManager().popBackStackImmediate(); getFM().popBackStackImmediate();
activity.startActivity(intent); activity.startActivity(intent);
}, throwable -> }, throwable ->
showError(getString(R.string.url_not_supported_toast), false))); showError(getString(R.string.url_not_supported_toast), false)));

View file

@ -177,7 +177,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
public void selected(final LocalItem selectedItem) { public void selected(final LocalItem selectedItem) {
if (selectedItem instanceof PlaylistStreamEntry) { if (selectedItem instanceof PlaylistStreamEntry) {
final PlaylistStreamEntry item = (PlaylistStreamEntry) selectedItem; final PlaylistStreamEntry item = (PlaylistStreamEntry) selectedItem;
NavigationHelper.openVideoDetailFragment(getFragmentManager(), NavigationHelper.openVideoDetailFragment(getFM(),
item.getStreamEntity().getServiceId(), item.getStreamEntity().getUrl(), item.getStreamEntity().getServiceId(), item.getStreamEntity().getUrl(),
item.getStreamEntity().getTitle()); item.getStreamEntity().getTitle());
} }

View file

@ -1,34 +1,26 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="6dp"
android:background="?attr/contrast_background_color"> android:background="?attr/contrast_background_color">
<TextView <TextView
android:id="@+id/playlist_title_view" android:id="@+id/playlist_title_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="6dp" android:paddingHorizontal="@dimen/video_item_search_padding"
android:layout_marginRight="6dp" android:paddingTop="@dimen/video_item_search_padding"
android:padding="6dp" android:paddingBottom="6dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:ellipsize="marquee" android:ellipsize="end"
android:fadingEdge="horizontal" android:maxLines="2"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/playlist_detail_title_text_size" android:textSize="@dimen/playlist_detail_title_text_size"
tools:text="Mix musics #23 title Lorem ipsum dolor sit amet, consectetur..."/> tools:text="Mix musics #23 title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum"/>
<TextView <TextView
android:id="@+id/playlist_stream_count" android:id="@+id/playlist_stream_count"
@ -36,8 +28,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/playlist_title_view" android:layout_below="@id/playlist_title_view"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:paddingLeft="12dp" android:paddingHorizontal="@dimen/video_item_search_padding"
android:paddingRight="12dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:maxLines="1" android:maxLines="1"

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
@ -12,9 +11,8 @@
android:id="@+id/playlist_title_view" android:id="@+id/playlist_title_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:paddingHorizontal="@dimen/video_item_search_padding"
android:layout_marginRight="8dp" android:paddingTop="@dimen/video_item_search_padding"
android:layout_marginTop="6dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
@ -25,19 +23,17 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/playlist_title_view" android:layout_below="@+id/playlist_title_view"
android:paddingHorizontal="@dimen/video_item_search_padding"
android:paddingTop="6dp"
android:id="@+id/playlist_meta"> android:id="@+id/playlist_meta">
<RelativeLayout <RelativeLayout
android:id="@+id/uploader_layout" android:id="@+id/uploader_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/playlist_detail_uploader_layout_height" android:layout_height="@dimen/playlist_detail_uploader_layout_height"
android:layout_marginLeft="4dp"
android:layout_marginRight="6dp"
android:layout_marginTop="6dp"
android:layout_toLeftOf="@+id/playlist_stream_count" android:layout_toLeftOf="@+id/playlist_stream_count"
android:layout_toStartOf="@+id/playlist_stream_count" android:layout_toStartOf="@+id/playlist_stream_count"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:gravity="left|center_vertical" android:gravity="left|center_vertical"
android:padding="2dp"
android:visibility="gone" android:visibility="gone"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:visibility="visible"> tools:visibility="visible">
@ -46,8 +42,8 @@
android:id="@+id/uploader_avatar_view" android:id="@+id/uploader_avatar_view"
android:layout_width="@dimen/playlist_detail_uploader_image_size" android:layout_width="@dimen/playlist_detail_uploader_image_size"
android:layout_height="@dimen/playlist_detail_uploader_image_size" android:layout_height="@dimen/playlist_detail_uploader_image_size"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_margin="1dp"
android:src="@drawable/buddy" android:src="@drawable/buddy"
app:civ_border_color="#ffffff" app:civ_border_color="#ffffff"
app:civ_border_width="1dp"/> app:civ_border_width="1dp"/>
@ -56,7 +52,7 @@
android:id="@+id/uploader_name" android:id="@+id/uploader_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="4dp" android:paddingHorizontal="6dp"
android:layout_toRightOf="@+id/uploader_avatar_view" android:layout_toRightOf="@+id/uploader_avatar_view"
android:ellipsize="end" android:ellipsize="end"
android:gravity="left|center_vertical" android:gravity="left|center_vertical"
@ -73,7 +69,7 @@
android:layout_alignBottom="@+id/uploader_layout" android:layout_alignBottom="@+id/uploader_layout"
android:layout_alignTop="@+id/uploader_layout" android:layout_alignTop="@+id/uploader_layout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="6dp" android:layout_marginLeft="6dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:maxLines="1" android:maxLines="1"

View file

@ -1091,7 +1091,7 @@
<item>Italiano</item> <item>Italiano</item>
<item>日本語</item> <item>日本語</item>
<item>ꦧꦱꦗꦮ</item> <item>ꦧꦱꦗꦮ</item>
<item>Tamaziɣt Taqbaylit</item> <item>Taqbaylit</item>
<item>한국어</item> <item>한국어</item>
<item>کوردی</item> <item>کوردی</item>
<item>Lietuvių kalba</item> <item>Lietuvių kalba</item>