diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-06 17:46:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 17:46:05 +0100 |
commit | 68ec4e2527bd495bd35386d102325308a5f36d85 (patch) | |
tree | ca7697214e5d199cf8aac1448032b8e6cf6ba847 /app/src | |
parent | 5e8960f4bcf1bfa98f1fe8adc824cbf6a5a5fbc4 (diff) | |
parent | 522288260cc613f400488168b9ca27f29da42ebd (diff) | |
download | AntennaPod-68ec4e2527bd495bd35386d102325308a5f36d85.zip |
Merge pull request #6958 from TacoTheDank/bumpSpotBugs
Update and fix SpotBugs
Diffstat (limited to 'app/src')
5 files changed, 13 insertions, 13 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 34aaaa39b..b4d45b262 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -291,7 +291,7 @@ public class MainActivity extends CastEnabledActivity { @Override protected void onDestroy() { super.onDestroy(); - if (drawerLayout != null) { + if (drawerLayout != null && drawerToggle != null) { drawerLayout.removeDrawerListener(drawerToggle); } } @@ -552,7 +552,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/dialog/TimeRangeDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java index 85913043e..1d84c7c22 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/TimeRangeDialog.java @@ -139,8 +139,8 @@ public class TimeRangeDialog extends MaterialAlertDialogBuilder { } protected Point radToPoint(float angle, float radius) { - return new Point((int) (getWidth() / 2 + radius * Math.sin(-angle * Math.PI / 180 + Math.PI)), - (int) (getHeight() / 2 + radius * Math.cos(-angle * Math.PI / 180 + Math.PI))); + return new Point((int) (getWidth() / 2.0 + radius * Math.sin(-angle * Math.PI / 180.0 + Math.PI)), + (int) (getHeight() / 2.0 + radius * Math.cos(-angle * Math.PI / 180.0 + Math.PI))); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java index 291de2a50..34712d428 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java @@ -86,9 +86,9 @@ public class DownloadLogFragment extends BottomSheetDialogFragment @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - Object item = adapter.getItem(position); - if (item instanceof DownloadResult) { - new DownloadLogDetailsDialog(getContext(), (DownloadResult) item).show(); + final DownloadResult item = adapter.getItem(position); + if (item != null) { + new DownloadLogDetailsDialog(getContext(), item).show(); } } 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)); } } |