public override bool OnOptionsItemSelected(IMenuItem item) { Action favAction = null; if (item.ItemId == AppView.AddFavoritesId) { favAction = new Action(async() => { if (await StorageData.SaveSeriesToFavoritesFile(ShowData)) { isFavorite = true; InvalidateOptionsMenu(); } else { Error.Instance.ShowErrorSnack(ShowData.Title + " could not be added to favorites.", this.titleContainer); } }); } else if (item.ItemId == AppView.RemoveFavoritesId) { favAction = new Action(async() => { if (await StorageData.RemoveSeriesFromFavoritesFile(ShowData)) { isFavorite = false; InvalidateOptionsMenu(); } else { Error.Instance.ShowErrorSnack(ShowData.Title + " could not be removed from favorites.", this.titleContainer); } }); } else if (item.ItemId == AppView.ReloadId) { favAction = new Action(() => { if (loadingView.Visibility != ViewStates.Visible) { LoadData(Intent.Extras.GetString("itemLink")); } else { Error.Instance.ShowErrorTip("Data is loading... Please wait!", this); } }); } return(AppView.OnOptionsItemSelected(item, this, favAction)); }
public override bool OnOptionsItemSelected(IMenuItem item) { Action seriesHome = null; if (item.ItemId == AppView.GoToSeriesHomeId) { seriesHome = new Action(() => { var intent = new Intent(this, typeof(ShowDetailActivity)); intent.PutExtra("itemLink", epData.EpisodeShowLink); StartActivity(intent); }); } else if (item.ItemId == AppView.ReloadId) { seriesHome = new Action(() => { if (loadingView.Visibility != ViewStates.Visible) LoadEpisodeData(Intent.GetStringExtra("itemLink")); else Error.Instance.ShowErrorTip("Data is loading... Please wait!", this); }); } return AppView.OnOptionsItemSelected(item, this, seriesHome); }
public override bool OnOptionsItemSelected(IMenuItem item) { return(AppView.OnOptionsItemSelected(item, this)); }