diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index cbb658025..9522446af 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -460,9 +460,6 @@ public class VideoDetailFragment extends BaseStateFragment implement public void selected(StreamInfoItem selectedItem) { selectAndLoadVideo(selectedItem.service_id, selectedItem.url, selectedItem.name); } - - @Override - public void dropdownClicked(StreamInfoItem selectedItem, PopupMenu menu) {} }); videoTitleRoot.setOnClickListener(this); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java index e3a94a5e2..a780c5160 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java @@ -140,9 +140,6 @@ public abstract class BaseListFragment extends BaseStateFragment implem useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(), selectedItem.service_id, selectedItem.url, selectedItem.name); } - - @Override - public void dropdownClicked(StreamInfoItem selectedItem, PopupMenu menu) {} }); infoListAdapter.setOnChannelSelectedListener(new InfoItemBuilder.OnInfoItemSelectedListener() { @@ -153,9 +150,6 @@ public abstract class BaseListFragment extends BaseStateFragment implem useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(), selectedItem.service_id, selectedItem.url, selectedItem.name); } - - @Override - public void dropdownClicked(ChannelInfoItem selectedItem, PopupMenu menu) {} }); infoListAdapter.setOnPlaylistSelectedListener(new InfoItemBuilder.OnInfoItemSelectedListener() { @@ -166,9 +160,6 @@ public abstract class BaseListFragment extends BaseStateFragment implem useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(), selectedItem.service_id, selectedItem.url, selectedItem.name); } - - @Override - public void dropdownClicked(PlaylistInfoItem selectedItem, PopupMenu menu) {} }); itemsList.clearOnScrollListeners(); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java index c3afa9620..4e60ef0d0 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java @@ -10,7 +10,6 @@ import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.PopupMenu; import org.schabi.newpipe.R; import org.schabi.newpipe.database.subscription.SubscriptionEntity; @@ -20,8 +19,6 @@ import org.schabi.newpipe.fragments.BaseStateFragment; import org.schabi.newpipe.info_list.InfoItemBuilder; import org.schabi.newpipe.info_list.InfoListAdapter; import org.schabi.newpipe.report.UserAction; -import org.schabi.newpipe.util.KioskTranslator; -import org.schabi.newpipe.report.ErrorActivity; import org.schabi.newpipe.util.NavigationHelper; import java.util.ArrayList; @@ -135,9 +132,6 @@ public class SubscriptionFragment extends BaseStateFragment { void selected(T selectedItem); - void dropdownClicked(T selectedItem, PopupMenu menu); } private final Context context; diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/ChannelMiniInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/ChannelMiniInfoItemHolder.java index 30dc3d8bc..9aef6dbd2 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/ChannelMiniInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/ChannelMiniInfoItemHolder.java @@ -1,11 +1,7 @@ package org.schabi.newpipe.info_list.holder; -import android.content.Context; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageButton; -import android.widget.PopupMenu; import android.widget.TextView; import com.nostra13.universalimageloader.core.DisplayImageOptions; @@ -14,9 +10,7 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.channel.ChannelInfoItem; import org.schabi.newpipe.info_list.InfoItemBuilder; -import org.schabi.newpipe.playlist.ChannelPlayQueue; import org.schabi.newpipe.util.Localization; -import org.schabi.newpipe.util.NavigationHelper; import de.hdodenhof.circleimageview.CircleImageView; @@ -24,7 +18,6 @@ public class ChannelMiniInfoItemHolder extends InfoItemHolder { public final CircleImageView itemThumbnailView; public final TextView itemTitleView; public final TextView itemAdditionalDetailView; - public final ImageButton itemActionDropdown; ChannelMiniInfoItemHolder(InfoItemBuilder infoItemBuilder, int layoutId, ViewGroup parent) { super(infoItemBuilder, layoutId, parent); @@ -32,7 +25,6 @@ public class ChannelMiniInfoItemHolder extends InfoItemHolder { itemThumbnailView = itemView.findViewById(R.id.itemThumbnailView); itemTitleView = itemView.findViewById(R.id.itemTitleView); itemAdditionalDetailView = itemView.findViewById(R.id.itemAdditionalDetails); - itemActionDropdown = itemView.findViewById(R.id.itemActionDropdown); } public ChannelMiniInfoItemHolder(InfoItemBuilder infoItemBuilder, ViewGroup parent) { @@ -58,55 +50,6 @@ public class ChannelMiniInfoItemHolder extends InfoItemHolder { } } }); - - enableActionDropdown(item); - } - - private void enableActionDropdown(final ChannelInfoItem item) { - itemActionDropdown.setVisibility(View.VISIBLE); - itemActionDropdown.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - final PopupMenu actionMenu = getStreamDropdown(itemBuilder.getContext(), itemActionDropdown, item); - if (itemBuilder.getOnChannelSelectedListener() != null) { - itemBuilder.getOnChannelSelectedListener().dropdownClicked(item, actionMenu); - } - actionMenu.show(); - } - }); - } - - private PopupMenu getStreamDropdown(final Context context, final View anchor, final ChannelInfoItem infoItem) { - PopupMenu actionMenu = new PopupMenu(context, anchor); - - final MenuItem mainPlay = actionMenu.getMenu().add(R.string.play_all); - mainPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnMainPlayer(context, new ChannelPlayQueue(infoItem)); - return true; - } - }); - - final MenuItem popupPlay = actionMenu.getMenu().add(R.string.controls_popup_title); - popupPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnPopupPlayer(context, new ChannelPlayQueue(infoItem)); - return true; - } - }); - - final MenuItem backgroundPlay = actionMenu.getMenu().add(R.string.controls_background_title); - backgroundPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnBackgroundPlayer(context, new ChannelPlayQueue(infoItem)); - return true; - } - }); - - return actionMenu; } protected String getDetailLine(final ChannelInfoItem item) { diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/PlaylistInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/PlaylistInfoItemHolder.java index 5e0f44939..3c29a4b76 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/PlaylistInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/PlaylistInfoItemHolder.java @@ -1,12 +1,8 @@ package org.schabi.newpipe.info_list.holder; -import android.content.Context; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageButton; import android.widget.ImageView; -import android.widget.PopupMenu; import android.widget.TextView; import com.nostra13.universalimageloader.core.DisplayImageOptions; @@ -15,15 +11,12 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; import org.schabi.newpipe.info_list.InfoItemBuilder; -import org.schabi.newpipe.playlist.PlaylistPlayQueue; -import org.schabi.newpipe.util.NavigationHelper; public class PlaylistInfoItemHolder extends InfoItemHolder { public final ImageView itemThumbnailView; public final TextView itemStreamCountView; public final TextView itemTitleView; public final TextView itemUploaderView; - public final ImageButton itemActionDropdown; public PlaylistInfoItemHolder(InfoItemBuilder infoItemBuilder, ViewGroup parent) { super(infoItemBuilder, R.layout.list_playlist_item, parent); @@ -32,7 +25,6 @@ public class PlaylistInfoItemHolder extends InfoItemHolder { itemTitleView = itemView.findViewById(R.id.itemTitleView); itemStreamCountView = itemView.findViewById(R.id.itemStreamCountView); itemUploaderView = itemView.findViewById(R.id.itemUploaderView); - itemActionDropdown = itemView.findViewById(R.id.itemActionDropdown); } @Override @@ -55,56 +47,8 @@ public class PlaylistInfoItemHolder extends InfoItemHolder { } } }); - - enableActionDropdown(item); } - private void enableActionDropdown(final PlaylistInfoItem item) { - itemActionDropdown.setVisibility(View.VISIBLE); - itemActionDropdown.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - final PopupMenu actionMenu = getStreamDropdown(itemBuilder.getContext(), itemActionDropdown, item); - if (itemBuilder.getOnPlaylistSelectedListener() != null) { - itemBuilder.getOnPlaylistSelectedListener().dropdownClicked(item, actionMenu); - } - actionMenu.show(); - } - }); - } - - private PopupMenu getStreamDropdown(final Context context, final View anchor, final PlaylistInfoItem infoItem) { - PopupMenu actionMenu = new PopupMenu(context, anchor); - - final MenuItem mainPlay = actionMenu.getMenu().add(R.string.play_all); - mainPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnMainPlayer(context, new PlaylistPlayQueue(infoItem)); - return true; - } - }); - - final MenuItem popupPlay = actionMenu.getMenu().add(R.string.controls_popup_title); - popupPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnPopupPlayer(context, new PlaylistPlayQueue(infoItem)); - return true; - } - }); - - final MenuItem backgroundPlay = actionMenu.getMenu().add(R.string.controls_background_title); - backgroundPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnBackgroundPlayer(context, new PlaylistPlayQueue(infoItem)); - return true; - } - }); - - return actionMenu; - } /** * Display options for playlist thumbnails */ diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java index a910041d0..138503d39 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java @@ -1,13 +1,9 @@ package org.schabi.newpipe.info_list.holder; -import android.content.Context; import android.support.v4.content.ContextCompat; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageButton; import android.widget.ImageView; -import android.widget.PopupMenu; import android.widget.TextView; import com.nostra13.universalimageloader.core.DisplayImageOptions; @@ -17,9 +13,7 @@ import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; import org.schabi.newpipe.info_list.InfoItemBuilder; -import org.schabi.newpipe.playlist.SinglePlayQueue; import org.schabi.newpipe.util.Localization; -import org.schabi.newpipe.util.NavigationHelper; public class StreamMiniInfoItemHolder extends InfoItemHolder { @@ -27,7 +21,6 @@ public class StreamMiniInfoItemHolder extends InfoItemHolder { public final TextView itemVideoTitleView; public final TextView itemUploaderView; public final TextView itemDurationView; - public final ImageButton itemActionDropdown; StreamMiniInfoItemHolder(InfoItemBuilder infoItemBuilder, int layoutId, ViewGroup parent) { super(infoItemBuilder, layoutId, parent); @@ -36,7 +29,6 @@ public class StreamMiniInfoItemHolder extends InfoItemHolder { itemVideoTitleView = itemView.findViewById(R.id.itemVideoTitleView); itemUploaderView = itemView.findViewById(R.id.itemUploaderView); itemDurationView = itemView.findViewById(R.id.itemDurationView); - itemActionDropdown = itemView.findViewById(R.id.itemActionDropdown); } public StreamMiniInfoItemHolder(InfoItemBuilder infoItemBuilder, ViewGroup parent) { @@ -75,92 +67,6 @@ public class StreamMiniInfoItemHolder extends InfoItemHolder { } } }); - - switch (item.stream_type) { - case AUDIO_STREAM: - case VIDEO_STREAM: - case FILE: - enableActionDropdown(item); - break; - case LIVE_STREAM: - case AUDIO_LIVE_STREAM: - case NONE: - default: - disableActionDropdown(); - break; - } - } - - private void enableActionDropdown(final StreamInfoItem item) { - itemActionDropdown.setClickable(true); - itemActionDropdown.setVisibility(View.VISIBLE); - itemActionDropdown.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - final PopupMenu actionMenu = getStreamDropdown(itemBuilder.getContext(), itemActionDropdown, item); - if (itemBuilder.getOnStreamSelectedListener() != null) { - itemBuilder.getOnStreamSelectedListener().dropdownClicked(item, actionMenu); - } - actionMenu.show(); - } - }); - } - - private void disableActionDropdown() { - itemActionDropdown.setVisibility(View.GONE); - itemActionDropdown.setClickable(false); - itemActionDropdown.setOnClickListener(null); - } - - private PopupMenu getStreamDropdown(final Context context, final View anchor, final StreamInfoItem infoItem) { - PopupMenu actionMenu = new PopupMenu(context, anchor); - - final MenuItem backgroundEnqueue = actionMenu.getMenu().add(R.string.enqueue_on_background); - backgroundEnqueue.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(infoItem)); - return true; - } - }); - - final MenuItem popupEnqueue = actionMenu.getMenu().add(R.string.enqueue_on_popup); - popupEnqueue.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.enqueueOnPopupPlayer(context, new SinglePlayQueue(infoItem)); - return true; - } - }); - - final MenuItem mainPlay = actionMenu.getMenu().add(R.string.play_btn_text); - mainPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnMainPlayer(context, new SinglePlayQueue(infoItem)); - return true; - } - }); - - final MenuItem popupPlay = actionMenu.getMenu().add(R.string.controls_popup_title); - popupPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnPopupPlayer(context, new SinglePlayQueue(infoItem)); - return true; - } - }); - - final MenuItem backgroundPlay = actionMenu.getMenu().add(R.string.controls_background_title); - backgroundPlay.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - NavigationHelper.playOnBackgroundPlayer(context, new SinglePlayQueue(infoItem)); - return true; - } - }); - - return actionMenu; } /** diff --git a/app/src/main/res/drawable-hdpi/ic_more_vert_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_more_vert_black_24dp.png deleted file mode 100644 index 22acc5500..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_more_vert_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png deleted file mode 100644 index 67f07e473..000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_more_vert_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_more_vert_black_24dp.png deleted file mode 100644 index 0e4f2f6ea..000000000 Binary files a/app/src/main/res/drawable-mdpi/ic_more_vert_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png deleted file mode 100644 index 017e45ede..000000000 Binary files a/app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_more_vert_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_more_vert_black_24dp.png deleted file mode 100644 index 9f10aa275..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_more_vert_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png deleted file mode 100644 index efab8a74f..000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_more_vert_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_more_vert_black_24dp.png deleted file mode 100644 index 94d5ab98c..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_more_vert_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png deleted file mode 100644 index d32281307..000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_more_vert_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_more_vert_black_24dp.png deleted file mode 100644 index 4642a3b66..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_more_vert_black_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png deleted file mode 100644 index 2f2cb3d00..000000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/layout/list_channel_item.xml b/app/src/main/res/layout/list_channel_item.xml index 4fa74387e..547054cc0 100644 --- a/app/src/main/res/layout/list_channel_item.xml +++ b/app/src/main/res/layout/list_channel_item.xml @@ -8,8 +8,7 @@ android:background="?attr/selectableItemBackground" android:clickable="true" android:focusable="true" - android:paddingTop="@dimen/video_item_search_padding" - android:paddingBottom="@dimen/video_item_search_padding"> + android:padding="@dimen/video_item_search_padding"> - - + android:padding="@dimen/video_item_search_padding"> - - + android:padding="@dimen/video_item_search_padding"> - - + android:padding="@dimen/video_item_search_padding"> - - + android:padding="@dimen/video_item_search_padding"> - + tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum" + /> + tools:text="Uploader" /> \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 7fd512c9e..abf7c7b09 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -20,7 +20,6 @@ - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1d93b61f1..7092feaf5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -310,6 +310,4 @@ Details Audio Settings Hold To Enqueue - Enqueue on Background - Enqueue on Popup diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 85549c8c5..8f0bb02cd 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -27,7 +27,6 @@ @drawable/ic_history_black_24dp @drawable/ic_drag_handle_black_24dp @drawable/ic_fiber_manual_record_black_24dp - @drawable/ic_more_vert_black_24dp @color/light_separator_color @color/light_contrast_background_color @@ -66,7 +65,6 @@ @drawable/ic_history_white_24dp @drawable/ic_drag_handle_white_24dp @drawable/ic_fiber_manual_record_white_24dp - @drawable/ic_more_vert_white_24dp @color/dark_separator_color @color/dark_contrast_background_color