Ejemplo n.º 1
0
        private void PMenu_MenuItemClick(object sender, AndroidX.AppCompat.Widget.PopupMenu.MenuItemClickEventArgs e)
        {
            try
            {
                string url = e.Item.ItemId switch
                {
                    Resource.Id.DBLinkNamu => $"https://namu.wiki/w/{fairy.Name}{((fairy.DicNumber >= 1000) ? "(소녀전선)" : "")}",
                    Resource.Id.DBLinkInven => $"http://gf.inven.co.kr/dataninfo/item/",
                    Resource.Id.DBLink36Base => $"https://girlsfrontline.kr/fairy/{fairy.DicNumber}",
                    Resource.Id.DBLinkGFDB => $"https://gfl.zzzzz.kr/fairy.php?id={fairy.DicNumber}&lang=ko",
                    _ => "",
                };

                var intent = new Intent(this, typeof(WebBrowserActivity));
                intent.PutExtra("url", url);
                StartActivity(intent);
                OverridePendingTransition(Android.Resource.Animation.FadeIn, Android.Resource.Animation.FadeOut);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                Toast.MakeText(this, "Cannot execute link menu", ToastLength.Short).Show();
            }
        }