Show details dialog on download stats page as well
This commit is contained in:
parent
4f2ba0b58e
commit
87d0055cf7
|
@ -41,7 +41,7 @@ public class DownloadStatisticsFragment extends Fragment {
|
|||
View root = inflater.inflate(R.layout.statistics_fragment, container, false);
|
||||
downloadStatisticsList = root.findViewById(R.id.statistics_list);
|
||||
progressBar = root.findViewById(R.id.progressBar);
|
||||
listAdapter = new DownloadStatisticsListAdapter(getContext());
|
||||
listAdapter = new DownloadStatisticsListAdapter(getContext(), this);
|
||||
downloadStatisticsList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
downloadStatisticsList.setAdapter(listAdapter);
|
||||
return root;
|
||||
|
|
|
@ -2,10 +2,12 @@ package de.danoeh.antennapod.ui.statistics.downloads;
|
|||
|
||||
import android.content.Context;
|
||||
import android.text.format.Formatter;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import de.danoeh.antennapod.core.storage.StatisticsItem;
|
||||
import de.danoeh.antennapod.ui.statistics.PieChartView;
|
||||
import de.danoeh.antennapod.ui.statistics.R;
|
||||
import de.danoeh.antennapod.ui.statistics.StatisticsListAdapter;
|
||||
import de.danoeh.antennapod.ui.statistics.feed.FeedStatisticsDialogFragment;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -14,9 +16,11 @@ import java.util.Locale;
|
|||
* Adapter for the download statistics list.
|
||||
*/
|
||||
public class DownloadStatisticsListAdapter extends StatisticsListAdapter {
|
||||
private final Fragment fragment;
|
||||
|
||||
public DownloadStatisticsListAdapter(Context context) {
|
||||
public DownloadStatisticsListAdapter(Context context, Fragment fragment) {
|
||||
super(context);
|
||||
this.fragment = fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,6 +49,12 @@ public class DownloadStatisticsListAdapter extends StatisticsListAdapter {
|
|||
+ " • "
|
||||
+ String.format(Locale.getDefault(), "%d%s",
|
||||
item.episodesDownloadCount, context.getString(R.string.episodes_suffix)));
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
FeedStatisticsDialogFragment yourDialogFragment = FeedStatisticsDialogFragment.newInstance(
|
||||
item.feed.getId(), item.feed.getTitle());
|
||||
yourDialogFragment.show(fragment.getChildFragmentManager().beginTransaction(), "DialogFragment");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue