mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-23 07:27:02 +00:00
Implement channel menu (closes #759)
This commit is contained in:
parent
59b3362715
commit
26d18c588e
@ -36,6 +36,7 @@ import org.schabi.newpipe.util.AnimationUtils;
|
|||||||
import org.schabi.newpipe.util.ExtractorHelper;
|
import org.schabi.newpipe.util.ExtractorHelper;
|
||||||
import org.schabi.newpipe.util.KioskTranslator;
|
import org.schabi.newpipe.util.KioskTranslator;
|
||||||
import org.schabi.newpipe.util.Localization;
|
import org.schabi.newpipe.util.Localization;
|
||||||
|
import org.schabi.newpipe.util.NavigationHelper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@ -157,12 +158,22 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.menu_item_rss: {
|
case R.id.menu_item_rss: {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(currentInfo.feed_url));
|
||||||
intent.setAction(Intent.ACTION_VIEW);
|
|
||||||
intent.setData(Uri.parse(currentInfo.feed_url));
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case R.id.menu_item_openInBrowser: {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(currentInfo.url));
|
||||||
|
startActivity(intent);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case R.id.menu_item_share: {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
|
intent.setType("text/plain");
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, currentInfo.url);
|
||||||
|
startActivity(Intent.createChooser(intent, getString(R.string.share_dialog_title)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user