Skip to content

Commit 748c2ba

Browse files
committed
Add comments and annotations
1 parent 6859f73 commit 748c2ba

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
167167

168168
/*////////////////////////////////////////////////////////////////////////*/
169169

170+
/**
171+
* TextWatcher to remove rich-text formatting on the search EditText when pasting content
172+
* from the clipboard.
173+
*/
170174
private TextWatcher textWatcher;
171175

172176
public static SearchFragment getInstance(final int serviceId, final String searchString) {
@@ -583,11 +587,13 @@ public void onSuggestionItemLongClick(final SuggestionItem item) {
583587
@Override
584588
public void beforeTextChanged(final CharSequence s, final int start,
585589
final int count, final int after) {
590+
// Do nothing, old text is already clean
586591
}
587592

588593
@Override
589594
public void onTextChanged(final CharSequence s, final int start,
590595
final int before, final int count) {
596+
// Changes are handled in afterTextChanged; CharSequence cannot be changed here.
591597
}
592598

593599
@Override

app/src/main/java/org/schabi/newpipe/player/playqueue/SinglePlayQueue.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.schabi.newpipe.player.playqueue;
22

3+
import androidx.annotation.NonNull;
4+
35
import org.schabi.newpipe.extractor.stream.StreamInfo;
46
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
57

@@ -20,11 +22,11 @@ public SinglePlayQueue(final StreamInfo info, final long startPosition) {
2022
getItem().setRecoveryPosition(startPosition);
2123
}
2224

23-
public SinglePlayQueue(final List<StreamInfoItem> items, final int index) {
25+
public SinglePlayQueue(@NonNull final List<StreamInfoItem> items, final int index) {
2426
super(index, playQueueItemsOf(items));
2527
}
2628

27-
private static List<PlayQueueItem> playQueueItemsOf(final List<StreamInfoItem> items) {
29+
private static List<PlayQueueItem> playQueueItemsOf(@NonNull final List<StreamInfoItem> items) {
2830
final List<PlayQueueItem> playQueueItems = new ArrayList<>(items.size());
2931
for (final StreamInfoItem item : items) {
3032
playQueueItems.add(new PlayQueueItem(item));
@@ -39,5 +41,7 @@ public boolean isComplete() {
3941

4042
@Override
4143
public void fetch() {
44+
// Item was already passed in constructor.
45+
// No further items need to be fetched as this is a PlayQueue with only one item
4246
}
4347
}

0 commit comments

Comments
 (0)