From 687ed5f2ffe9536f7451b00468c75a2201f2d04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20S=C3=A1mson?= <13379985+adrns@users.noreply.github.com> Date: Tue, 24 May 2022 19:40:40 +0200 Subject: Open podcast from statistics (#5898) --- ui/statistics/build.gradle | 3 ++- .../ui/statistics/feed/FeedStatisticsDialogFragment.java | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'ui/statistics') diff --git a/ui/statistics/build.gradle b/ui/statistics/build.gradle index cca840989..72b4b807b 100644 --- a/ui/statistics/build.gradle +++ b/ui/statistics/build.gradle @@ -13,8 +13,9 @@ android { dependencies { implementation project(":core") - implementation project(':event') + implementation project(":event") implementation project(":model") + implementation project(":ui:app-start-intent") implementation project(":ui:common") annotationProcessor "androidx.annotation:annotation:$annotationVersion" diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java index 7109bd6a1..f0308e364 100644 --- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java +++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/feed/FeedStatisticsDialogFragment.java @@ -2,10 +2,13 @@ package de.danoeh.antennapod.ui.statistics.feed; import android.app.Dialog; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; + +import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter; import de.danoeh.antennapod.ui.statistics.R; public class FeedStatisticsDialogFragment extends DialogFragment { @@ -26,6 +29,10 @@ public class FeedStatisticsDialogFragment extends DialogFragment { public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { AlertDialog.Builder dialog = new AlertDialog.Builder(getContext()); dialog.setPositiveButton(android.R.string.ok, null); + dialog.setNeutralButton(R.string.open_podcast, (dialogInterface, i) -> { + long feedId = getArguments().getLong(EXTRA_FEED_ID); + new MainActivityStarter(getContext()).withOpenFeed(feedId).withAddToBackStack().start(); + }); dialog.setTitle(getArguments().getString(EXTRA_FEED_TITLE)); dialog.setView(R.layout.feed_statistics_dialog); return dialog.create(); -- cgit v1.2.3