Implement channel menu (closes #759)

This commit is contained in:
Coffeemakr 2017-10-31 09:25:27 +01:00
parent 59b3362715
commit 26d18c588e
No known key found for this signature in database
GPG Key ID: 3F35676D8FF6E743
1 changed files with 14 additions and 3 deletions

View File

@ -36,6 +36,7 @@ import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -157,12 +158,22 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_item_rss: {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse(currentInfo.feed_url));
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(currentInfo.feed_url));
startActivity(intent);
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:
return super.onOptionsItemSelected(item);
}