Skip to content

Commit a9af1df

Browse files
Applied code review changes.
1 parent fc46233 commit a9af1df

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/notification/NotificationConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public static List<Integer> getCompactSlotsFromPreferences(
180180

181181
if (compactSlot == Integer.MAX_VALUE) {
182182
// settings not yet populated, return default values
183-
return SLOT_COMPACT_DEFAULTS;
183+
return new ArrayList<>(SLOT_COMPACT_DEFAULTS);
184184
}
185185

186186
// a negative value (-1) is set when the user does not want a particular compact slot

app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private synchronized NotificationCompat.Builder createNotification() {
9999
// build the compact slot indices array (need code to convert from Integer... because Java)
100100
final List<Integer> compactSlotList = NotificationConstants.getCompactSlotsFromPreferences(
101101
player.getContext(), player.getPrefs(), nonNothingSlotCount);
102-
final int[] compactSlots = compactSlotList.stream().mapToInt(i -> i).toArray();
102+
final int[] compactSlots = compactSlotList.stream().mapToInt(Integer::intValue).toArray();
103103

104104
builder.setStyle(new androidx.media.app.NotificationCompat.MediaStyle()
105105
.setMediaSession(player.getMediaSessionManager().getSessionToken())

app/src/main/java/org/schabi/newpipe/settings/custom/NotificationActionsPreference.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.schabi.newpipe.util.ThemeHelper;
3535
import org.schabi.newpipe.views.FocusOverlayView;
3636

37-
import java.util.ArrayList;
3837
import java.util.List;
3938
import java.util.stream.IntStream;
4039

@@ -76,9 +75,10 @@ public void onDetached() {
7675
////////////////////////////////////////////////////////////////////////////
7776

7877
private void setupActions(@NonNull final View view) {
79-
compactSlots = new ArrayList<>(NotificationConstants
80-
.getCompactSlotsFromPreferences(getContext(), getSharedPreferences(), 5));
81-
notificationSlots = IntStream.range(0, 5).mapToObj(i -> new NotificationSlot(i, view))
78+
compactSlots = NotificationConstants.getCompactSlotsFromPreferences(getContext(),
79+
getSharedPreferences(), 5);
80+
notificationSlots = IntStream.range(0, 5)
81+
.mapToObj(i -> new NotificationSlot(i, view))
8282
.toArray(NotificationSlot[]::new);
8383
}
8484

0 commit comments

Comments
 (0)