\n");
}
// add the logs
- for (int i = 0; i < errorList.length; i++) {
+ for (int i = 0; i < errorInfo.getStackTraces().length; i++) {
htmlErrorReport.append(" \n")
- .append("\n```\n").append(errorList[i]).append("\n```\n")
+ .append("\n```\n").append(errorInfo.getStackTraces()[i]).append("\n```\n")
.append("Crash log ");
- if (errorList.length > 1) {
+ if (errorInfo.getStackTraces().length > 1) {
htmlErrorReport.append(i + 1);
}
htmlErrorReport.append("")
.append("
@@ -82,6 +81,10 @@ public class KioskFragment extends BaseListInfoFragment> flowable = historyRecordManager
.getRelatedSearches(query, 3, 25);
@@ -763,8 +749,8 @@ public class SearchFragment extends BaseListFragment
disposables.add(deleteReactor
.observeOn(AndroidSchedulers.mainThread())
- .subscribe(ignored -> { /*Do nothing on success*/ }, this::onError))
- )
+ .subscribe(ignored -> { /*Do nothing on success*/ }, throwable ->
+ showError(new ErrorInfo(throwable,
+ UserAction.REQUESTED_BOOKMARK,
+ "Deleting playlist")))))
.setNegativeButton(R.string.cancel, null)
.show();
}
@@ -314,7 +307,10 @@ public final class BookmarkFragment extends BaseLocalListFragment
{ /*Do nothing on success*/ }, this::onError);
+ .subscribe(longs -> { /*Do nothing on success*/ }, throwable -> showError(
+ new ErrorInfo(throwable,
+ UserAction.REQUESTED_BOOKMARK,
+ "Changing playlist name")));
disposables.add(disposable);
}
}
diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
index 04090abc6..33bed7d7e 100644
--- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
+++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
@@ -38,17 +38,18 @@ import icepick.State
import org.schabi.newpipe.R
import org.schabi.newpipe.database.feed.model.FeedGroupEntity
import org.schabi.newpipe.databinding.FragmentFeedBinding
+import org.schabi.newpipe.error.ErrorInfo
+import org.schabi.newpipe.error.UserAction
import org.schabi.newpipe.fragments.list.BaseListFragment
import org.schabi.newpipe.ktx.animate
+import org.schabi.newpipe.ktx.animateHideRecyclerViewAllowingScrolling
import org.schabi.newpipe.local.feed.service.FeedLoadService
-import org.schabi.newpipe.report.UserAction
import org.schabi.newpipe.util.Localization
import java.util.Calendar
class FeedFragment : BaseListFragment
removeWatchedStreams(false))
- .setNeutralButton(
- R.string.remove_watched_popup_yes_and_partially_watched_videos,
- (DialogInterface d, int id) -> removeWatchedStreams(true))
- .setNegativeButton(R.string.cancel,
- (DialogInterface d, int id) -> d.cancel())
- .create()
- .show();
- }
- break;
- default:
- return super.onOptionsItemSelected(item);
+ if (item.getItemId() == R.id.menu_item_remove_watched) {
+ if (!isRemovingWatched) {
+ new AlertDialog.Builder(requireContext())
+ .setMessage(R.string.remove_watched_popup_warning)
+ .setTitle(R.string.remove_watched_popup_title)
+ .setPositiveButton(R.string.yes,
+ (DialogInterface d, int id) -> removeWatchedStreams(false))
+ .setNeutralButton(
+ R.string.remove_watched_popup_yes_and_partially_watched_videos,
+ (DialogInterface d, int id) -> removeWatchedStreams(true))
+ .setNegativeButton(R.string.cancel,
+ (DialogInterface d, int id) -> d.cancel())
+ .create()
+ .show();
+ }
+ } else {
+ return super.onOptionsItemSelected(item);
}
return true;
}
@@ -455,7 +455,8 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
showError(new ErrorInfo(throwable, UserAction.REQUESTED_BOOKMARK,
+ "Removing watched videos, partially watched=" + removePartiallyWatched))));
}
@Override
@@ -511,17 +512,6 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
{ /*Do nothing on success*/ }, this::onError);
+ .subscribe(longs -> { /*Do nothing on success*/ }, throwable ->
+ showError(new ErrorInfo(throwable, UserAction.REQUESTED_BOOKMARK,
+ "Renaming playlist")));
disposables.add(disposable);
}
@@ -583,7 +575,9 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
successToast.show(), this::onError);
+ .subscribe(ignore -> successToast.show(), throwable ->
+ showError(new ErrorInfo(throwable, UserAction.REQUESTED_BOOKMARK,
+ "Changing playlist thumbnail")));
disposables.add(disposable);
}
@@ -632,7 +626,9 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
saveImmediate(), this::onError);
+ .subscribe(ignored -> saveImmediate(), throwable ->
+ showError(new ErrorInfo(throwable, UserAction.SOMETHING_ELSE,
+ "Debounced saver")));
}
private void saveImmediate() {
@@ -669,7 +665,8 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
showError(new ErrorInfo(throwable,
+ UserAction.REQUESTED_BOOKMARK, "Saving playlist"))
);
disposables.add(disposable);
}
@@ -683,7 +680,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment
() {
binding.itemsList.adapter = groupAdapter
viewModel = ViewModelProvider(this).get(SubscriptionViewModel::class.java)
- viewModel.stateLiveData.observe(viewLifecycleOwner, { it?.let(this::handleResult) })
- viewModel.feedGroupsLiveData.observe(viewLifecycleOwner, { it?.let(this::handleFeedGroups) })
+ viewModel.stateLiveData.observe(viewLifecycleOwner) { it?.let(this::handleResult) }
+ viewModel.feedGroupsLiveData.observe(viewLifecycleOwner) { it?.let(this::handleFeedGroups) }
}
private fun showLongTapDialog(selectedItem: ChannelInfoItem) {
@@ -381,7 +382,9 @@ class SubscriptionFragment : BaseStateFragment
> getSubscriptionObserver() {
return new Observer
>() {
@Override
- public void onSubscribe(final Disposable d) { }
+ public void onSubscribe(@NonNull final Disposable disposable) { }
@Override
- public void onNext(final List