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:

View file

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

View file

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

View file

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

View file

@ -286,10 +286,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
if (!TextUtils.isEmpty(result.getUploaderUrl())) {
headerUploaderLayout.setOnClickListener(v -> {
try {
NavigationHelper.openChannelFragment(getFragmentManager(),
result.getServiceId(),
result.getUploaderUrl(),
result.getUploaderName());
NavigationHelper.openChannelFragment(getFM(), result.getServiceId(),
result.getUploaderUrl(), result.getUploaderName());
} catch (Exception 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 + "]");
}
if (TextUtils.isEmpty(searchEditText.getText())) {
NavigationHelper.gotoMainFragment(getFragmentManager());
NavigationHelper.gotoMainFragment(getFM());
return;
}
@ -807,7 +807,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(intent -> {
getFragmentManager().popBackStackImmediate();
getFM().popBackStackImmediate();
activity.startActivity(intent);
}, throwable ->
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) {
if (selectedItem instanceof PlaylistStreamEntry) {
final PlaylistStreamEntry item = (PlaylistStreamEntry) selectedItem;
NavigationHelper.openVideoDetailFragment(getFragmentManager(),
NavigationHelper.openVideoDetailFragment(getFM(),
item.getStreamEntity().getServiceId(), item.getStreamEntity().getUrl(),
item.getStreamEntity().getTitle());
}

View file

@ -1,34 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:background="?attr/contrast_background_color">
<TextView
android:id="@+id/playlist_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:padding="6dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:paddingHorizontal="@dimen/video_item_search_padding"
android:paddingTop="@dimen/video_item_search_padding"
android:paddingBottom="6dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:ellipsize="end"
android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge"
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
android:id="@+id/playlist_stream_count"
@ -36,8 +28,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/playlist_title_view"
android:layout_alignParentLeft="true"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingHorizontal="@dimen/video_item_search_padding"
android:ellipsize="end"
android:gravity="right|center_vertical"
android:maxLines="1"

View file

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

View file

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