summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/NavDrawerFragment.java10
-rw-r--r--config/spotbugs/exclude.xml33
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java12
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/FastBlurTransformation.java2
6 files changed, 18 insertions, 43 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
index 369489bf8..46c62b9f4 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
@@ -551,7 +551,7 @@ public class MainActivity extends CastEnabledActivity {
@Override
public void onBackPressed() {
- if (isDrawerOpen()) {
+ if (isDrawerOpen() && drawerLayout != null) {
drawerLayout.closeDrawer(navDrawer);
} else if (sheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
sheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
index a304ead3c..176828308 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
@@ -341,7 +341,7 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
if (context == null) {
return;
}
- if (tag.isOpen) {
+ if (tag.isOpen()) {
holder.count.setVisibility(View.GONE);
}
Glide.with(context).clear(holder.image);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NavDrawerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NavDrawerFragment.java
index 636c0245b..4c3647669 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/NavDrawerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/NavDrawerFragment.java
@@ -359,10 +359,10 @@ public class NavDrawerFragment extends Fragment implements SharedPreferences.OnS
.setState(BottomSheetBehavior.STATE_COLLAPSED);
} else {
NavDrawerData.TagDrawerItem folder = ((NavDrawerData.TagDrawerItem) clickedItem);
- if (openFolders.contains(folder.name)) {
- openFolders.remove(folder.name);
+ if (openFolders.contains(folder.getTitle())) {
+ openFolders.remove(folder.getTitle());
} else {
- openFolders.add(folder.name);
+ openFolders.add(folder.getTitle());
}
getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE)
@@ -438,8 +438,8 @@ public class NavDrawerFragment extends Fragment implements SharedPreferences.OnS
flatItems.add(item);
if (item.type == NavDrawerData.DrawerItem.Type.TAG) {
NavDrawerData.TagDrawerItem folder = ((NavDrawerData.TagDrawerItem) item);
- folder.isOpen = openFolders.contains(folder.name);
- if (folder.isOpen) {
+ folder.setOpen(openFolders.contains(folder.getTitle()));
+ if (folder.isOpen()) {
flatItems.addAll(makeFlatDrawerData(((NavDrawerData.TagDrawerItem) item).children, layer + 1));
}
}
diff --git a/config/spotbugs/exclude.xml b/config/spotbugs/exclude.xml
index 7802c7c74..b80c0550c 100644
--- a/config/spotbugs/exclude.xml
+++ b/config/spotbugs/exclude.xml
@@ -5,10 +5,6 @@
<Class name="de.danoeh.antennapod.adapter.NavListAdapter"/>
</Match>
<Match>
- <Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
- <Class name="de.danoeh.antennapod.net.ssl.NoV1SslSocketFactory"/>
- </Match>
- <Match>
<Bug pattern="DLS_DEAD_LOCAL_STORE"/>
<Class name="de.danoeh.antennapod.ui.statistics.StatisticsFragment"/>
</Match>
@@ -41,10 +37,6 @@
<Class name="de.danoeh.antennapod.fragment.NavDrawerFragment"/>
</Match>
<Match>
- <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
- <Class name="de.danoeh.antennapod.menuhandler.MenuItemUtils"/>
- </Match>
- <Match>
<Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
<Class name="de.danoeh.antennapod.activity.MainActivity"/>
</Match>
@@ -57,10 +49,6 @@
<Class name="de.danoeh.antennapod.model.feed.FeedMedia"/>
</Match>
<Match>
- <Bug pattern="NP_NULL_PARAM_DEREF"/>
- <Class name="de.danoeh.antennapod.model.feed.FeedMedia"/>
- </Match>
- <Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
<Class name="de.danoeh.antennapod.core.service.download.DownloadRequestCreator"/>
</Match>
@@ -70,18 +58,6 @@
</Match>
<Match>
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
- <Class name="de.danoeh.antennapod.PodcastApp"/>
- </Match>
- <Match>
- <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
- <Class name="de.danoeh.antennapod.core.service.download.DownloadService"/>
- </Match>
- <Match>
- <Bug pattern="MS_CANNOT_BE_FINAL"/>
- <Class name="de.danoeh.antennapod.core.service.download.DownloadService"/>
- </Match>
- <Match>
- <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
<Class name="de.danoeh.antennapod.core.service.playback.PlaybackService"/>
</Match>
<Match>
@@ -100,18 +76,9 @@
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
<Class name="de.danoeh.antennapod.playback.base.PlaybackServiceMediaPlayer$PSMPInfo"/>
</Match>
- <Match>
- <Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD"/>
- <Class name="de.danoeh.antennapod.core.storage.NavDrawerData$TagDrawerItem"/>
- </Match>
- <Match>
- <Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
- <Class name="de.danoeh.antennapod.core.cast.CastButtonVisibilityManager"/>
- </Match>
<Match><Class name="de.danoeh.antennapod.core.ClientConfig"/></Match>
- <Match><Package name="de.danoeh.antennapod.core.glide"/></Match>
<Match><Package name="de.danoeh.antennapod.databinding"/></Match>
<Match><Package name="de.danoeh.antennapod.core.databinding"/></Match>
<Match><Package name="de.danoeh.antennapod.ui.common.databinding"/></Match>
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java b/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java
index af02a7733..024c5d357 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java
@@ -57,8 +57,8 @@ public class NavDrawerData {
public static class TagDrawerItem extends DrawerItem {
public final List<DrawerItem> children = new ArrayList<>();
- public final String name;
- public boolean isOpen;
+ private final String name;
+ private boolean isOpen;
public TagDrawerItem(String name) {
// Keep IDs >0 but make room for many feeds
@@ -70,6 +70,14 @@ public class NavDrawerData {
return name;
}
+ public boolean isOpen() {
+ return isOpen;
+ }
+
+ public void setOpen(final boolean open) {
+ isOpen = open;
+ }
+
public int getCounter() {
int sum = 0;
for (DrawerItem item : children) {
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/FastBlurTransformation.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/FastBlurTransformation.java
index a19611100..54040e4b4 100644
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/FastBlurTransformation.java
+++ b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/FastBlurTransformation.java
@@ -12,7 +12,7 @@ import java.nio.charset.Charset;
import java.security.MessageDigest;
public class FastBlurTransformation extends BitmapTransformation {
- private static final String ID = "de.danoeh.antennapod.core.glide.FastBlurTransformation";
+ private static final String ID = "de.danoeh.antennapod.ui.glide.FastBlurTransformation";
private static final String TAG = FastBlurTransformation.class.getSimpleName();