1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 11:02:35 +01:00

Add comments and annotations

This commit is contained in:
TobiGr 2023-09-20 15:41:21 +02:00
parent 6859f73c54
commit 748c2babe9
2 changed files with 12 additions and 2 deletions

View File

@ -167,6 +167,10 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
/*////////////////////////////////////////////////////////////////////////*/ /*////////////////////////////////////////////////////////////////////////*/
/**
* TextWatcher to remove rich-text formatting on the search EditText when pasting content
* from the clipboard.
*/
private TextWatcher textWatcher; private TextWatcher textWatcher;
public static SearchFragment getInstance(final int serviceId, final String searchString) { public static SearchFragment getInstance(final int serviceId, final String searchString) {
@ -583,11 +587,13 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
@Override @Override
public void beforeTextChanged(final CharSequence s, final int start, public void beforeTextChanged(final CharSequence s, final int start,
final int count, final int after) { final int count, final int after) {
// Do nothing, old text is already clean
} }
@Override @Override
public void onTextChanged(final CharSequence s, final int start, public void onTextChanged(final CharSequence s, final int start,
final int before, final int count) { final int before, final int count) {
// Changes are handled in afterTextChanged; CharSequence cannot be changed here.
} }
@Override @Override

View File

@ -1,5 +1,7 @@
package org.schabi.newpipe.player.playqueue; package org.schabi.newpipe.player.playqueue;
import androidx.annotation.NonNull;
import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
@ -20,11 +22,11 @@ public final class SinglePlayQueue extends PlayQueue {
getItem().setRecoveryPosition(startPosition); getItem().setRecoveryPosition(startPosition);
} }
public SinglePlayQueue(final List<StreamInfoItem> items, final int index) { public SinglePlayQueue(@NonNull final List<StreamInfoItem> items, final int index) {
super(index, playQueueItemsOf(items)); super(index, playQueueItemsOf(items));
} }
private static List<PlayQueueItem> playQueueItemsOf(final List<StreamInfoItem> items) { private static List<PlayQueueItem> playQueueItemsOf(@NonNull final List<StreamInfoItem> items) {
final List<PlayQueueItem> playQueueItems = new ArrayList<>(items.size()); final List<PlayQueueItem> playQueueItems = new ArrayList<>(items.size());
for (final StreamInfoItem item : items) { for (final StreamInfoItem item : items) {
playQueueItems.add(new PlayQueueItem(item)); playQueueItems.add(new PlayQueueItem(item));
@ -39,5 +41,7 @@ public final class SinglePlayQueue extends PlayQueue {
@Override @Override
public void fetch() { public void fetch() {
// Item was already passed in constructor.
// No further items need to be fetched as this is a PlayQueue with only one item
} }
} }