From 248212588dfe6ad14814a92f8e17516a427635cc Mon Sep 17 00:00:00 2001 From: Stypox Date: Sun, 28 Jun 2020 22:55:18 +0200 Subject: [PATCH] Fix style issues --- .../org/schabi/newpipe/settings/tabs/Tab.java | 17 ++++++----------- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java index 85de8462d..b0511cd11 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java @@ -577,20 +577,15 @@ public abstract class Tab { @Override public boolean equals(final Object obj) { - final boolean baseEquals = super.equals(obj) + if (!(super.equals(obj) && Objects.equals(playlistType, ((PlaylistTab) obj).playlistType) - && Objects.equals(playlistName, ((PlaylistTab) obj).playlistName); - - if (!baseEquals) { - return false; + && Objects.equals(playlistName, ((PlaylistTab) obj).playlistName))) { + return false; // base objects are different } - final boolean localPlaylistEquals = playlistId == ((PlaylistTab) obj).playlistId; - final boolean remotePlaylistEquals = - playlistServiceId == ((PlaylistTab) obj).playlistServiceId - && Objects.equals(playlistUrl, ((PlaylistTab) obj).playlistUrl); - - return localPlaylistEquals || remotePlaylistEquals; + return (playlistId == ((PlaylistTab) obj).playlistId) // local + || (playlistServiceId == ((PlaylistTab) obj).playlistServiceId // remote + && Objects.equals(playlistUrl, ((PlaylistTab) obj).playlistUrl)); } public int getPlaylistServiceId() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 79b86d2ad..79624032b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -653,5 +653,5 @@ Channel\'s avatar thumbnail Created by %s By %s - Playlist Page + Playlist page