From bd2dbda7752e713141288bd898ac5a883bc5a740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88ller?= Date: Wed, 9 Jan 2019 18:13:42 +0100 Subject: [PATCH] Wip --- .../peertube/fragment/VideoMenuQualityFragment.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java index 06cc612..45420d9 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoMenuQualityFragment.java @@ -81,7 +81,7 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment { LinearLayout menuRow = (LinearLayout) inflater.inflate(R.layout.row_popup_menu, null); TextView iconView = menuRow.findViewById(R.id.video_quality_icon); - iconView.setId(file.getId()); + iconView.setId(file.getResolution().getId()); TextView textView = menuRow.findViewById(R.id.video_quality_text); Log.v(TAG, file.getResolution().getLabel()); @@ -93,16 +93,23 @@ public class VideoMenuQualityFragment extends BottomSheetDialogFragment { editor.putInt("pref_quality", file.getResolution().getId()); editor.apply(); - // TODO: unset icon on non selected items + for (File fileV : mFiles) { + TextView iconViewV = view.findViewById(fileV.getResolution().getId()); + iconViewV.setText(""); + } iconView.setText(R.string.video_quality_active_icon); new Iconics.IconicsBuilder().ctx(getContext()).on(iconView).build(); + + //TODO: set new video quality on running video + }); // Add to menu LinearLayout menuHolder = view.findViewById(R.id.video_quality_menu); menuHolder.addView(menuRow); + // Set current if (videoQuality.equals(file.getResolution().getId())) { iconView.setText(R.string.video_quality_active_icon); new Iconics.IconicsBuilder().ctx(getContext()).on(iconView).build();