diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-29 08:55:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-29 08:55:13 +0100 |
commit | 13a985ca1e6fae65682c97ee523dec96b2fdeedf (patch) | |
tree | 2c17b528c52e63298d499a44b82c3c0aff08ae25 /ui/statistics | |
parent | 1dbda2fb8a070fb30b4314feca839525cfc701eb (diff) | |
download | AntennaPod-13a985ca1e6fae65682c97ee523dec96b2fdeedf.zip |
Restructure Echo to be more flexible (#7035)
Each screen is its own file, which makes it easier to add interactive elements.
Diffstat (limited to 'ui/statistics')
-rw-r--r-- | ui/statistics/build.gradle | 1 | ||||
-rw-r--r-- | ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java | 7 | ||||
-rw-r--r-- | ui/statistics/src/main/res/menu/statistics.xml | 9 |
3 files changed, 15 insertions, 2 deletions
diff --git a/ui/statistics/build.gradle b/ui/statistics/build.gradle index e5e00d32d..1e33a0f0a 100644 --- a/ui/statistics/build.gradle +++ b/ui/statistics/build.gradle @@ -15,6 +15,7 @@ dependencies { implementation project(':storage:database') implementation project(":ui:app-start-intent") implementation project(":ui:common") + implementation project(":ui:echo") annotationProcessor "androidx.annotation:annotation:$annotationVersion" implementation "androidx.appcompat:appcompat:$appcompatVersion" diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java index 6dfdc4e8a..1c35b159b 100644 --- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java +++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/StatisticsFragment.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.ui.statistics; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MenuItem; @@ -21,6 +22,7 @@ import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.event.StatisticsEvent; import de.danoeh.antennapod.ui.common.PagedToolbarFragment; +import de.danoeh.antennapod.ui.echo.EchoActivity; import de.danoeh.antennapod.ui.statistics.downloads.DownloadStatisticsFragment; import de.danoeh.antennapod.ui.statistics.subscriptions.SubscriptionStatisticsFragment; import de.danoeh.antennapod.ui.statistics.years.YearsStatisticsFragment; @@ -61,6 +63,9 @@ public class StatisticsFragment extends PagedToolbarFragment { toolbar = rootView.findViewById(R.id.toolbar); toolbar.setTitle(getString(R.string.statistics_label)); toolbar.inflateMenu(R.menu.statistics); + if (BuildConfig.DEBUG) { + toolbar.getMenu().findItem(R.id.debug_echo).setVisible(true); + } toolbar.setNavigationOnClickListener(v -> getParentFragmentManager().popBackStack()); viewPager.setAdapter(new StatisticsPagerAdapter(this)); // Give the TabLayout the ViewPager @@ -89,6 +94,8 @@ public class StatisticsFragment extends PagedToolbarFragment { if (item.getItemId() == R.id.statistics_reset) { confirmResetStatistics(); return true; + } else if (item.getItemId() == R.id.debug_echo) { + startActivity(new Intent(getContext(), EchoActivity.class)); } return super.onOptionsItemSelected(item); } diff --git a/ui/statistics/src/main/res/menu/statistics.xml b/ui/statistics/src/main/res/menu/statistics.xml index 4610a7726..9720e6880 100644 --- a/ui/statistics/src/main/res/menu/statistics.xml +++ b/ui/statistics/src/main/res/menu/statistics.xml @@ -11,7 +11,12 @@ android:id="@+id/statistics_filter" android:icon="@drawable/ic_filter" android:title="@string/filter" - custom:showAsAction="ifRoom"> - </item> + custom:showAsAction="ifRoom" /> + + <item + android:id="@+id/debug_echo" + android:title="@string/debug_echo" + custom:showAsAction="never" + android:visible="false" /> </menu> |